Ultrahost/ docs

A graph has a name. Nodes and edges inside it have types you choose, such as Tenant and RENTS.

Paths in the tables are relative to https://api.ultrahost.com/v1/projects/{projectId}. Pagination, idempotency, and errors are described in Conventions.

Create

Graphs

SDKRESTDescription
graph.create(name, config?)POST /graphsCreate a graph
graph.get(name)GET /graphs/{name}Retrieve graph configuration
graph.list()GET /graphsList graphs
graph.delete(name)DELETE /graphs/{name}Delete a graph

Nodes and edges

SDKRESTDescription
graph.createNode(graph, node)POST /graphs/{graph}/nodesCreate a node
graph.createEdge(graph, edge)POST /graphs/{graph}/edgesCreate a relationship
ts
await ultrahost.graph.createNode("real-estate", {
  id: "tenant-123",
  type: "Tenant",
  properties: { name: "John Smith" }
});

await ultrahost.graph.createEdge("real-estate", {
  from: "tenant-123",
  to: "property-456",
  type: "RENTS"
});

Create the graph before writing nodes. As with documents, the first write does not silently provision the graph.

Configure

Traversal needs explicit limits: maximum depth, maximum result size, and a bound on how long a query may run. Those limits belong on the request and have platform defaults, so an unbounded walk is not the default.

graph.create(name, config?) is where graph-level defaults live. There is no separate settings resource beyond that optional config object.

Use

SDKRESTDescription
graph.getNode(graph, id)GET /graphs/{graph}/nodes/{id}Retrieve a node
graph.updateNode(graph, id, data)PATCH /graphs/{graph}/nodes/{id}Update a node
graph.deleteNode(graph, id)DELETE /graphs/{graph}/nodes/{id}Delete a node
graph.findNodes(graph, query)POST /graphs/{graph}/nodes/queryFind matching nodes
graph.getEdge(graph, id)GET /graphs/{graph}/edges/{id}Retrieve a relationship
graph.deleteEdge(graph, id)DELETE /graphs/{graph}/edges/{id}Delete a relationship
graph.neighbors(graph, nodeId, options?)POST /graphs/{graph}/neighborsConnected nodes
graph.traverse(graph, options)POST /graphs/{graph}/traverseTraverse the graph
graph.shortestPath(graph, from, to)POST /graphs/{graph}/shortest-pathShortest path
graph.subgraph(graph, options)POST /graphs/{graph}/subgraphA connected subgraph
ts
const properties = await ultrahost.graph.neighbors(
  "real-estate",
  "tenant-123",
  { relationship: "RENTS", direction: "outbound" }
);

neighbors is the everyday call. traverse, shortestPath, and subgraph are the ones that must enforce depth and size limits.