From bf2da3137189088f829b60ef0e993c1516597307 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 17 Oct 2026 08:26:10 -0400 Subject: [PATCH 1/2] fix(graphql): support GitHub and Bitbucket schemas in the editor config graphql.config.ts pointed at a schema file codegen no longer produced and a documents directory that no longer exists, and the Bitbucket documents had no editor schema at all. - Rewrite graphql.config.ts as a multi-project config: a github project (local gitignored snapshot + GitHub documents) and a bitbucket project (public Atlassian gateway + Bitbucket documents). - Add a schema-ast output to codegen.ts so the GitHub snapshot is generated locally and stays gitignored (not committed). The Bitbucket schema comes from https://developer.atlassian.com/gateway/api/graphql (public, no credentials), matching setchy/atlassify. OpenSpec change: repair-graphql-lsp-config --- codegen.ts | 3 +++ graphql.config.ts | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/codegen.ts b/codegen.ts index ddbe02474..8c49d665a 100644 --- a/codegen.ts +++ b/codegen.ts @@ -42,6 +42,9 @@ const config: CodegenConfig = { useTypeImports: true, }, }, + 'src/renderer/utils/forges/github/graphql/generated/schema.graphql': { + plugins: ['schema-ast'], + }, }, }; diff --git a/graphql.config.ts b/graphql.config.ts index 58c8a0585..62af7627a 100644 --- a/graphql.config.ts +++ b/graphql.config.ts @@ -1,8 +1,16 @@ import type { IGraphQLConfig } from 'graphql-config'; const config: IGraphQLConfig = { - schema: './src/renderer/utils/api/graphql/generated/schema.graphql', - documents: ['src/renderer/utils/api/**/*.graphql'], + projects: { + github: { + schema: './src/renderer/utils/forges/github/graphql/generated/schema.graphql', + documents: ['src/renderer/utils/forges/github/**/*.graphql'], + }, + bitbucket: { + schema: 'https://developer.atlassian.com/gateway/api/graphql', + documents: ['src/renderer/utils/forges/bitbucket/**/*.graphql'], + }, + }, }; export default config; From 71152d482c147e7bcbc9c0b3d20c3419844d7b47 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 17 Oct 2026 09:12:10 -0400 Subject: [PATCH 2/2] fix(codegen): declare the GitHub schema snapshot output as a sibling generates entry Merging main into this branch nested the schema-ast output inside the Bitbucket output object, where a string key is not a valid property. The cache-disabled type check failed with TS2353 on that line. - Move the GitHub schema snapshot output to a sibling 'generates' entry, inside the GITHUB_TOKEN gate because it needs the GitHub schema. - Extract the shared GitHub schema pointer to a typed const so both GitHub outputs reference it. --- codegen.ts | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/codegen.ts b/codegen.ts index 467632318..9f8ff95b8 100644 --- a/codegen.ts +++ b/codegen.ts @@ -25,27 +25,26 @@ const generates: CodegenConfig['generates'] = { // validation against it is skipped. See setchy/atlassify for the same workaround. skipDocumentsValidation: true, }, - 'src/renderer/utils/forges/github/graphql/generated/schema.graphql': { - plugins: ['schema-ast'], - }, }, }; if (process.env.GITHUB_TOKEN) { - generates['src/renderer/utils/forges/github/graphql/generated/graphql.ts'] = { - schema: { - 'https://api.github.com/graphql': { - headers: { - Authorization: `Bearer ${process.env.GITHUB_TOKEN}`, - // Hierarchy and issue fields each require their GraphQL schema feature. - 'GraphQL-Features': 'sub_issues,issue_fields', - }, - // GitHub's live schema currently fails graphql-js's stricter - // interface-deprecation-consistency validation (added in graphql v17). - // Skip validation so introspection can still succeed. - assumeValid: true, + const githubSchema: CodegenConfig['schema'] = { + 'https://api.github.com/graphql': { + headers: { + Authorization: `Bearer ${process.env.GITHUB_TOKEN}`, + // Hierarchy and issue fields each require their GraphQL schema feature. + 'GraphQL-Features': 'sub_issues,issue_fields', }, + // GitHub's live schema currently fails graphql-js's stricter + // interface-deprecation-consistency validation (added in graphql v17). + // Skip validation so introspection can still succeed. + assumeValid: true, }, + }; + + generates['src/renderer/utils/forges/github/graphql/generated/graphql.ts'] = { + schema: githubSchema, documents: ['src/renderer/utils/forges/github/**/*.graphql'], plugins: ['typescript-operations', 'typed-document-node'], config: { @@ -58,6 +57,12 @@ if (process.env.GITHUB_TOKEN) { useTypeImports: true, }, }; + + // Schema snapshot the GraphQL editor loads offline (see graphql.config.ts). + generates['src/renderer/utils/forges/github/graphql/generated/schema.graphql'] = { + schema: githubSchema, + plugins: ['schema-ast'], + }; } else { // oxlint-disable-next-line no-console -- CLI script output console.warn(