In the ArangoDB manual, in section Modify a graph definition during runtime, the following ways for modifying edge definitions at runtime are shown:
Adding a new edge definition to an existing graph:
/* load graph module */
var graph_module = require("org/arangodb/general-graph");
/* load existing graph by name */
var graph = graph_module._graph("myGraph");
/* add a relation for edge collection myEC2, with vertices
between collections myVC1 and myVC3 */
var defs = graph_module._relation("myEC2", ["myVC1"], ["myVC3"]);
/* update the existing graph's definition */
graph._extendEdgeDefinitions(defs);
Modifying an existing edge definition in an existing graph:
/* load graph module */
var graph_module = require("org/arangodb/general-graph");
/* load existing graph by name */
var graph = graph_module._graph("myGraph");
/* update the relation for edge collection myEC2, with vertices
between collections myVC23 and [ myVC42, myVC99 ] */
var defs = graph_module._relation("myEC2", ["myVC23"], ["myVC42", "myVC99"]);
/* update the existing graph's definition */
graph._editEdgeDefinitions(defs);