Expand description
gqls — GraphQL schema search.
Layered like rq: a source loader turns a schema (SDL file, or — planned
— an introspection URL) into flat model::SchemaRecords, and a search
layer ranks them. Two capabilities are borrowed rather than rebuilt:
- fuzzy ranking — adapted from
rq’ssearch/score.rs(~/code/lib/rust/rq); seesearch::score. - semantic search — lifted from
ae’s local embedding pipeline (~/code/lib/rust/ae:embed.rs+mrl.rs); seesemantic. Behind thesemanticcargo feature (pulls in ONNX Runtime).
Modules§
- cli
- clap CLI, dispatch, and output formatting (text / json / ndjson).
- load
- Schema ingestion: a source string is either an http(s) URL (introspect)
or a path to an SDL file. Both produce the same
SchemaRecordlist, so nothing downstream cares which it was. When no source is given,discoverfinds a schema in the current directory tree. - logging
- Stderr verbosity, set once from
-q/-vand shared across the CLI. - model
- The language-agnostic record model: every type, field, arg, enum value,
and directive in a schema flattens to one
SchemaRecord. Search and output operate only on these — they never touch a parser or a transport. - paths
- Shared on-disk locations. gqls keeps everything cacheable under one base
dir (
$XDG_CACHE_HOME/gqls, else~/.cache/gqls) — embedding vectors, the introspection response cache, and the background-warm lockfiles. - resolve
- Field → resolver jump.
- search
- The read path: score every record against the query, rank, cut the weak tail.
- semantic
- Semantic (embedding) search over schema records.