Skip to content

Schema Sources

The schema field in your config tells GraphQL Analyzer where to find your GraphQL schema.

schema: schema.graphql
schema: schema/**/*.graphql

Multiple schema files are merged into a single schema.

schema:
- schema.graphql
- extensions/*.graphql
schema: https://api.example.com/graphql

The 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.

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
FieldRequiredDescription
urlYesThe GraphQL endpoint URL to introspect
headersNoMap of header name → value; supports ${VAR} interpolation
timeoutNoRequest timeout in seconds (default: 30)
retryNoNumber 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.

In multi-project configs, each project has its own schema:

projects:
api:
schema: api/schema.graphql
client:
schema: https://api.example.com/graphql

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.

  • 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
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).

ConcernBehavior
ValidationOperations are validated against the resolved schema
NavigationGo-to-definition prefers source files, falling back to the resolved schema if the definition isn’t found in source
SDL validationSkipped on source schema files (since they may not be valid standalone)
LintingLint rules run on source schema files
HoverShows 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.