dokkaiv0.1.0
API Reference

Get an entity's neighborhood

BFS from an entity over call / inheritance / definition edges.

GET/graph/{project}/neighborhoodany

BFS from the entity's node over CALLS, INHERITS, IMPLEMENTS, OVERRIDES, DEFINES and DEFINES_METHOD edges only — never IMPORTS or containment edges.

Returned nodes carry a hop field (0 = the center entity); the center is also returned separately as center.

Path parameters

projectstringrequired
The project_name.

Query parameters

entitystringrequired
Qualified name to center the neighborhood on.
depthinteger
Number of hops to expand. Default 1.
directionenum
in | out | both. Which edge direction to follow. Default both.
limitinteger
Max nodes to return, root included, closest-first. Default 200.

Responses

200The entity's neighborhood
json
{
  "project": "your-repo",
  "entity": "src.http.RequestHandler",
  "center": { "id": 42, "kind": "Class" },
  "nodes": [ { "id": 42, "hop": 0 }, { "id": 51, "hop": 1 } ],
  "edges": [ { "source": 42, "target": 51, "type": "CALLS" } ],
  "stats": { "depth": 1, "direction": "both", "limit": 200, "returned_nodes": 2, "returned_edges": 1, "truncated": false }
}
404No graph, or entity not found
json
{ "detail": "entity '...' not found in project 'your-repo' graph" }