Walks a node’s edges and returns one hit per traversed edge. Direction is outgoing, incoming, or both; an optional edge-type filter restricts the walk. Each hit embeds both the traversed edge and the neighbor node in full, so a follow-up read is rarely needed. A missing node yields an empty page.
Paginated responses use opaque cursors. Clients should pass the returned cursor back to the same command shape and must not parse cursor contents.
Examples
Find a node’s neighbors along outgoing edges.
CLI
$ strata graph create social
$ strata graph add-node social alice
$ strata graph add-node social bob
$ strata graph add-edge social alice knows bob
$ strata graph neighbors social alice outgoing
Wire
{"graph":"social","type":"graph_create"}
{"graph":"social","node_id":"alice","type":"graph_add_node"}
{"graph":"social","node_id":"bob","type":"graph_add_node"}
{"dst":"bob","edge_type":"knows","graph":"social","src":"alice","type":"graph_add_edge"}
{"direction":"outgoing","graph":"social","node_id":"alice","type":"graph_neighbors"}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
as_of | integer | no | Optional timestamp in microseconds. Reads the graph state visible at that instant. |
cursor | string | no | Optional exclusive cursor. |
direction | GraphDirection | yes | Traversal direction. |
edge_type | string | no | Optional edge type filter. |
graph | string | yes | Graph name. |
limit | integer | no | Optional item limit. Defaults to 100. |
node_id | string | yes | Node id. |
Plus the optional scope: branch and space (default to the session branch and the "default" space).
Returns
Page<GraphNeighborHit, String>.
Errors
failed_precondition.engine.runtime_closednot_found.engine.branchinvalid_argument.engine.product_spaceinvalid_argument.engine.graph_namenot_found.engine.graphinvalid_argument.engine.graph_node_idinvalid_argument.engine.graph_edge_type
Invocation
- CLI:
strata graph neighbors - Wire type:
graph_neighbors