@gleanql/compiler
v0.1.20
Published
Glean's static analyzer: compiles accessor-style reads in route files to GraphQL operations
Maintainers
Readme
@gleanql/compiler
The static analyzer for GleanQL — GraphQL without writing GraphQL. It reads your React components with a real TypeScript program and turns their field reads into compiled GraphQL operations:
- Follows reads through JSX props (across files), helpers,
.map/.filter/.findcallbacks (inline, destructured, or named function references), conditional components, registries, and"use client"islands. - Lifts root arguments into operation variables, builds the per-component
read map (which drives component-sliced
refresh()and dev read-masking), and handles union narrowing, lazy boundaries, and more. - Anything it can't follow is a diagnostic — the invariant is that the compiler may refuse, but it never silently under-fetches.
- Two interchangeable type-check engines: the in-process
typescriptcompiler (default) and the experimental Go-nativetsgo.
You normally don't install this directly — the
@gleanql/vite
plugin drives it.
Docs
Full documentation (including the golden-case behavior catalog) lives in the GleanQL repo.
MIT
