query_graphql
Run GraphQL queries on the code graph to fetch nested data with pagination. Ideal for retrieving nodes, edges, and graph traversal results in a single query.
Instructions
Execute a GraphQL query on the code graph.
GraphQL provides typed, nested queries with pagination — complementary to Datalog. Use GraphQL when you need nested data in one query (node + edges + neighbors). Use Datalog (query_graph) for pattern matching and logical rules.
SCHEMA HIGHLIGHTS:
node(id: ID!): Node — get a single node
nodes(filter: {type, name, file, exported}, first, after): NodeConnection — paginated search
bfs/dfs(startIds, maxDepth, edgeTypes): [ID!]! — graph traversal
reachability(from, to, edgeTypes, maxDepth): Boolean — path existence
datalog(query, limit, offset): DatalogResult — Datalog passthrough
findCalls(target, className): [CallInfo!]! — call graph
traceDataFlow(source, file, direction, maxDepth): [[String!]!]! — data flow
stats: GraphStats — node/edge counts
Node fields: id, name, type, file, line, column, exported, metadata, outgoingEdges(types), incomingEdges(types), children, parent
EXAMPLE: query { nodes(filter: {type: "FUNCTION", file: "src/api"}, first: 5) { edges { node { name, file, line outgoingEdges(types: ["CALLS"]) { edges { node { dst { name, file } } } } } } totalCount } }
Use get_documentation(topic="graphql-schema") for the full schema.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | GraphQL query string | |
| variables | No | Optional variables for the query (JSON object) | |
| operationName | No | Optional operation name (when query contains multiple operations) |