Schema Sources
The schema field in your config tells GraphQL Analyzer where to find your GraphQL schema.
Local file
Section titled “Local file”schema: schema.graphqlGlob pattern
Section titled “Glob pattern”schema: schema/**/*.graphqlMultiple schema files are merged into a single schema.
Multiple sources
Section titled “Multiple sources”schema: - schema.graphql - extensions/*.graphqlRemote URL (introspection)
Section titled “Remote URL (introspection)”schema: https://api.example.com/graphqlThe tool fetches the schema via introspection query. Introspection runs each time the schema is loaded; results are held in memory by the running LSP/CLI process.
Remote schema with options
Section titled “Remote schema with options”For authenticated endpoints or custom timeouts, use the structured form:
schema: url: https://api.example.com/graphql headers: Authorization: Bearer ${API_TOKEN} timeout: 60 retry: 3| Field | Required | Description |
|---|---|---|
url | Yes | The GraphQL endpoint URL to introspect |
headers | No | Map of header name → value; supports ${VAR} interpolation |
timeout | No | Request timeout in seconds (default: 30) |
retry | No | Number of retry attempts on failure (default: 0) |
See Environment variable interpolation for how to keep secrets out of your config file.
See Remote Schema Introspection for additional details.
Per-project schemas
Section titled “Per-project schemas”In multi-project configs, each project has its own schema:
projects: api: schema: api/schema.graphql client: schema: https://api.example.com/graphqlResolved schema
Section titled “Resolved schema”If your build pipeline transforms the schema (e.g., composing subgraphs, stripping federation directives, or applying code generation), the source .graphql files may not represent the final schema used at runtime. The resolvedSchema option lets you point the analyzer at the build output while keeping source files for navigation and linting.
When to use it
Section titled “When to use it”- Your schema goes through a build step before deployment (e.g.,
rover supergraph compose, codegen) - Source schema files contain directives or syntax that would fail standard SDL validation
- You want validation against the final, resolved schema but still want to navigate and lint source files
Configuration
Section titled “Configuration”schema: "src/schema/**/*.graphql"documents: "src/**/*.{graphql,ts,tsx}"
extensions: graphql-analyzer: resolvedSchema: "dist/schema.graphql"The resolvedSchema value is a path to a single SDL file (globs are not supported).
How it works
Section titled “How it works”| Concern | Behavior |
|---|---|
| Validation | Operations are validated against the resolved schema |
| Navigation | Go-to-definition prefers source files, falling back to the resolved schema if the definition isn’t found in source |
| SDL validation | Skipped on source schema files (since they may not be valid standalone) |
| Linting | Lint rules run on source schema files |
| Hover | Shows an indicator when a type comes from the resolved schema |
This means you get the best of both worlds: accurate validation against what actually runs in production, and ergonomic navigation and linting against the files you edit.