Expand description
Graph visualization endpoints for React Flow UI integration.
These endpoints expose the entity graph structure (nodes and edges) in formats optimized for graph visualization libraries like React Flow.
§Endpoints
| Route | Method | Description |
|---|---|---|
/api/graph/flow | POST | Full graph as nodes + edges for React Flow |
/api/graph/edges | POST | All ref relationships as explicit edges |
/api/graph/tree | POST | Recursive subtree from a root entity |
/api/graph/neighbors | POST | N-hop neighborhood around an entity |
/api/graph/path | POST | Shortest path between two entities |
/api/graph/stats | GET | Graph metrics and statistics |
§React Flow Data Model
React Flow expects two arrays: nodes and edges.
- Node:
{ id, type, data, position: { x, y }, parentId? } - Edge:
{ id, source, target, label, type }
The graph/flow endpoint returns two grids: a nodes grid and an edges
grid (edges encoded in the response grid’s metadata under edgesGrid).
When Accept: application/json is used, it returns the native React Flow
JSON structure instead.
Functions§
- handle_
edges - Returns all ref relationships as explicit edge rows.
- handle_
flow - Returns the entity graph formatted for React Flow consumption.
- handle_
neighbors - Returns N-hop neighborhood around an entity.
- handle_
path - Finds the shortest path between two entities.
- handle_
stats - Returns graph statistics and metrics.
- handle_
tree - Returns a hierarchical subtree from a root entity.