knowledgeGraph(projectReference: ID!, input: KnowledgeGraphInput): KnowledgeGraph!Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
projectReference | ID! | Yes | Project whose knowledge is selected. Ordinary callers require project.knowledge.read. A run-bound MCP service credential instead must match the persisted run’s project and agent plus its actor or runtime transport binding; its effective sealed authority must grant the invoked tool and a knowledge selector. On project-scoped MCP endpoints, the scoped project supplies this value when omitted. |
input | KnowledgeGraphInput | No |
Input fields
input
KnowledgeGraphInput
| Field | Type | Required | Description |
|---|---|---|---|
lookupTarget | KnowledgeLookupTargetInput | No | Source to read; omit for the main preview branch. |
callerSelector | JSON | No | Caller-selected document scope. Source membership and server-trusted knowledge policy are intersected with this selector before pagination; denied nodes, edges, broken-link labels and counts are filtered. |
rootFileVersionId | UUID | No | Start node by file version ID; or rootPath. |
rootPath | String | No | Start node by path, 1 to 1024 characters. |
maxDepth | Int | No | Link hops from the root, 0 to 3; omit the root to read the whole visible set. Responses over 512 KiB fail with a size limit (REST 413, MCP PAYLOAD_TOO_LARGE). Narrow the graph with root_path, max_depth, filters or pagination.limit (GraphQL rootPath, maxDepth, filters or pagination.limit). |
filters | KnowledgeFiltersInput | No | |
pagination | KnowledgeGraphPaginationInput | No |
Response
ReturnsKnowledgeGraph!. Open the type for its fields and nested types.
| Field | Type | Description |
|---|---|---|
nodes | [KnowledgeGraphNode!]! | Visible knowledge files as nodes. Markdown document links are edges; external and broken links are returned separately. Use the graph to find related files. |
edges | [KnowledgeGraphEdge!]! | |
externalLinks | [KnowledgeGraphExternalLink!]! | |
brokenLinks | [KnowledgeGraphBrokenLink!]! | |
returnedNodes | Int! | |
totalNodes | Int! | |
partial | Boolean! | True when nodes or links were left out of this page. |
linksTruncated | Boolean! | True when the link count or byte budget left links out. |
KnowledgeGraph.
Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.
Example
query KnowledgeGraph($projectReference: ID!, $input: KnowledgeGraphInput) {
knowledgeGraph(projectReference: $projectReference, input: $input) {
limit
linksTruncated
partial
returnedNodes
totalNodes
nodes {
fileId
fileVersionId
path
reserved
tags
}
edges {
ordinal
sourceFileVersionId
targetFileVersionId
}
pageInfo {
hasNextPage
endCursor
hasPreviousPage
startCursor
}
}
}
{
"projectReference": "00000000-0000-4000-8000-000000000001"
}