Skip to content

fix(graphql): repair editor GraphQL config with a committed schema snapshot - #3451

Open
setchy wants to merge 2 commits into
mainfrom
fix/graphql-lsp-config
Open

setchy wants to merge 2 commits into
mainfrom
fix/graphql-lsp-config

Conversation

@setchy

@setchy setchy commented Oct 17, 2026

Copy link
Copy Markdown
Member

Why

graphql.config.ts — the config the VS Code GraphQL extension reads — pointed at both:

  • a schema file codegen stopped producing, and
  • a documents glob in a directory that no longer exists (documents moved to src/renderer/utils/forges/github/).

The language server therefore had no schema to validate against, and the path could not be fixed by editing it alone — the file was never produced.

What changed

  • codegen.ts: add a schema-ast output writing schema.graphql next to the generated operation types (reuses the already-installed @graphql-codegen/schema-ast).
  • graphql.config.ts: point schema at the committed snapshot and documents at src/renderer/utils/forges/github/**/*.graphql. Bitbucket documents target a different schema and stay excluded.
  • .gitignore: un-ignore the snapshot via a targeted negation, mirroring the existing screenshot-baseline pattern.

Verification

  • pnpm codegen writes the snapshot; the generated graphql.ts is unchanged.
  • Snapshot is stable across a second codegen run (identical SHA-256).
  • The config loads through graphql-config with GITHUB_TOKEN unset: schema resolves from the local snapshot (1839 types), documents = the 5 GitHub operations, 0 SDL definitions.
  • The documents glob does not match the Bitbucket document set.
  • pnpm check passes.

Stacking

Based on fix/graphql-codegen-plugin-resolution (#3450) because pnpm codegen cannot run until that dependency fix lands. When #3450 merges, this PR retargets to main automatically.

OpenSpec change: repair-graphql-lsp-config

graphql-codegen resolves plugin names from the project root, so the typed-document-node plugin declared in codegen.ts must be a declared dependency. It was previously reachable only through the removed hoisted pnpm layout, which broke pnpm codegen under the default isolated linker.

OpenSpec change: fix-graphql-codegen-plugin-resolution
…apshot

graphql.config.ts referenced a schema file codegen no longer produced and a documents glob in a directory that no longer existed, so the VS Code GraphQL extension had no schema.

- Re-add a schema-ast output to codegen.ts, writing schema.graphql next to the generated types.
- Point graphql.config.ts at the committed snapshot and the current GitHub documents.
- Un-ignore the snapshot so it is committed alongside the operation types.

Stacked on #3450, which is required for pnpm codegen to run.

OpenSpec change: repair-graphql-lsp-config
@setchy
setchy requested a review from afonsojramos as a code owner October 17, 2026 03:57
Base automatically changed from fix/graphql-codegen-plugin-resolution to main October 17, 2026 04:01
@github-actions github-actions Bot added bug Something isn't working dependency Dependency updates labels Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependency Dependency updates

Development

Successfully merging this pull request may close these issues.

1 participant