Graph
query_graph
Trace definitions, references, call chains, component trees, state flow, and refactor impact across files and monorepo packages.
query_graph answers cross-file relationship questions by combining fast SQLite candidate filtering with scoped TypeScript Language Service verification. In monorepos, results are grouped by package.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
query | 'definition' | 'references' | 'call_hierarchy' | 'component_tree' | 'state_flow' | 'impact' (required) | — | Query mode. |
target | { symbol_id?, file?, symbol?, member?, line?, column? } (required) | — | Target symbol, file, prop/event name, or cursor position. |
direction | 'up' | 'down' | 'both' | 'up' | Traversal direction for call_hierarchy and component_tree. |
scope | { packages?: string[], max_depth?: number } | max_depth: 4 | Limit traversal to specific packages or depth. |
limit | integer (1..500) | 30 | Maximum items returned per page. |
cursor | string | — | Pagination cursor (o_<offset>). |
root | string | session root | Workspace root directory. |
format | 'text' | 'json' | 'text' | Output format. |
max_bytes | integer (>= 512) | 16384 | Maximum UTF-8 response size. |
Query Modes
definition: Go to Definition across files, barrel re-exports, workspacepackage.json#exports, and Nuxt.nuxt/imports.d.ts.references: Find All References across.ts,.tsx,.vue,.svelte, and.astrowith line/column positions mapped back to original source files, plus SQLite graph edges to catch Nuxt auto-imports even if.nuxt/imports.d.tshas not been generated yet.call_hierarchy: Callers (up) and callees (down) for functions, composables, event handlers, and outbound HTTP calls.component_tree: Upward consumers (up) or downward rendered children (down) across packages, including through barrel re-exports. Capped at 500 nodes per query (COMPONENT_TREE_TRUNCATEDif reached).state_flow: Readers, writers, watchers, and providers/consumers for Pinia stores (use*Store), NuxtuseState(), React Context, and Vueprovide/inject.impact: Lists verified edit sites when changing a component, prop, event, slot, or symbol, along with explicitomissionsfor dynamic spreads (v-bind,{...props}).
Example
{
"query": "impact",
"target": {
"file": "apps/web/components/ui/button/Button.vue",
"member": "variant"
}
}