Graphs

Create a graph

To create a graph, you must name the graph and define its edges.

Note: Requires Administrator permissions to access the GeoFabric and Read Only access on every collection used within this graph.

post/_fabric/{fabric}/_api/graph

Request

Path parameters

fabricstring string required

The name of the fabric.

Request body

namestring required

Name of the graph.

optionsApiGharialCreateOpts

A JSON object to define options for creating collections within this graph. It can contain the following attributes:

Example request

{
  "edgeDefinitions": [
    {
      "collection": "edgeName",
      "from": [
        "sourceNode"
      ],
      "to": [
        "destinationNode"
      ]
    }
  ],
  "name": "exampleGraph"
}

Response

Successfully created the graph 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.