Graphs

Add edge definition

Adds an additional edge definition to the graph.

This edge definition has to contain a collection and an array of each from and to vertex collections. An edge definition can only be added if this definition is either not used in any other graph, or it is used with exactly the same definition. It is not possible to store a definition "e" from "v1" to "v2" in the one graph, and "e" from "v2" to "v1" in the other graph.

Note: Requires administrator permissions.

post/_fabric/{fabric}/_api/graph/{graph}/edge

Request

Path parameters

fabricstring string required

The name of the fabric.

graphstring string required

The name of the graph.

Request body

collectionstring required

The name of the edge collection to be used.

fromstring[]

One or many vertex collections that can contain source vertices.

tostring[]

One or many vertex collections that can contain target vertices.

Example request

{
  "collection": "edgeCollectionTest",
  "from": [
    "sourceVertex"
  ],
  "to": [
    "destinationVertex"
  ]
}

Response

Successfully added edge when waitForSync is enabled.

codeinteger

HTTP response code.

errorboolean required

Flag if there is an error in response. False for this response.

Example response

{
  "code": 201,
  "graph": {
    "_id": "_graphs/graph1",
    "_key": "graph1",
    "_rev": "_drxzsai--_",
    "edgedefinitions": [
      {
        "collection": "edgeName",
        "from": [
          "sourceNode"
        ],
        "to": [
          "destinationNode"
        ]
      }
    ],
    "name": "graph1",
    "orphanCollections": [
      "emptyNode"
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.