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

ParameterTypeDefaultDescription
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: 4Limit traversal to specific packages or depth.
limitinteger (1..500)30Maximum items returned per page.
cursorstring—Pagination cursor (o_<offset>).
rootstringsession rootWorkspace root directory.
format'text' | 'json''text'Output format.
max_bytesinteger (>= 512)16384Maximum UTF-8 response size.

Query Modes

  • definition: Go to Definition across files, barrel re-exports, workspace package.json#exports, and Nuxt .nuxt/imports.d.ts.
  • references: Find All References across .ts, .tsx, .vue, .svelte, and .astro with line/column positions mapped back to original source files, plus SQLite graph edges to catch Nuxt auto-imports even if .nuxt/imports.d.ts has 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_TRUNCATED if reached).
  • state_flow: Readers, writers, watchers, and providers/consumers for Pinia stores (use*Store), Nuxt useState(), React Context, and Vue provide/inject.
  • impact: Lists verified edit sites when changing a component, prop, event, slot, or symbol, along with explicit omissions for dynamic spreads (v-bind, {...props}).

Example

{
  "query": "impact",
  "target": {
    "file": "apps/web/components/ui/button/Button.vue",
    "member": "variant"
  }
}