Skip to main content

Module queries

Module queries 

Source
Expand description

Stored-query registry.

A server-side registry of named, parameter-typed .gq queries that operators declare in omnigraph.yaml (per-graph, or top-level in single mode) and the server loads at startup. Each entry is parsed and its identity asserted here (load); type-checking against the live schema happens separately (a check pass) so the loader stays callable without an open engine (the CLI’s offline queries check).

Identity is the query name: the manifest key must equal the query <name> symbol declared in the referenced .gq file. The two are asserted equal at load — one name, two places that must agree. Renaming either is a breaking change to callers, by design.

Structs§

Breakage
A stored query that fails to type-check against the live schema — e.g. it references a node/edge type or property that was renamed or removed by a migration. Breakages block server boot (same posture as bad policy YAML), surfacing schema drift at the deploy boundary rather than silently at invocation time.
CheckReport
Outcome of validating a registry against a schema. Breakages are fatal (boot refuses); warnings are advisory.
LoadError
A single registry load failure. Collected (not fail-fast) so a bad omnigraph.yaml surfaces every broken entry at once, matching the bad-policy-YAML posture.
QueryRegistry
A loaded, identity-checked stored-query registry for one graph.
RegistrySpec
In-memory registry spec: a query’s name + already-read .gq source. The input to QueryRegistry::from_specs — built by the server’s cluster boot and by the CLI’s queries tooling from a cluster serving snapshot.
StoredQuery
One loaded stored query. source is the full .gq file text — the invocation handler hands it to run_query / run_mutate verbatim, which reuse the same parse/IR/exec path as the inline routes (no parallel implementation).
Warning
A non-blocking advisory found during validation. Logged at boot; never blocks startup. Currently: an MCP-exposed query that declares a parameter an agent cannot realistically supply.

Functions§

check
Validate a loaded registry against the live schema.
format_check_breakages
Format every breakage in a registry check report into a multi-line operator-facing message, naming each offending query.