diff --git a/.changeset/graphql-17-documents.md b/.changeset/graphql-17-documents.md new file mode 100644 index 00000000..acd9f69d --- /dev/null +++ b/.changeset/graphql-17-documents.md @@ -0,0 +1,7 @@ +--- +'@stats-forge/github-stats-forge-core': patch +--- + +build: regenerate the GraphQL documents with graphql 17 + +Input objects in the query text gain inner spaces; what GitHub is asked is unchanged. diff --git a/packages/core/AGENTS.md b/packages/core/AGENTS.md index 5ac192e9..734fbc22 100644 --- a/packages/core/AGENTS.md +++ b/packages/core/AGENTS.md @@ -218,11 +218,20 @@ dev-only — no codegen dependency reaches consumers. It is covered by source file. The repo-root `scripts/` is covered the same way, by `tsconfig.scripts.json` at the root. -**`graphql` is held at 16 — 17 cannot generate these types.** v17 enforces that an -implementation field is not deprecated where the interface field it satisfies isn't, and -GitHub's published SDL breaks it on five fields across `TeamDiscussion` and -`TeamDiscussionComment`. The generator's `buildSchema(…, { assumeValidSDL: true })` does -not help: codegen runs `assertValidSchema` of its own inside `validateGraphQlDocuments`, -so `check-graphql-types` fails before writing anything. `@octokit/graphql-schema` also -depends on graphql `^16.0.0`, so 17 puts two copies in the lockfile for no gain. Tried and -reverted on 2026-09-13; retry only once GitHub's SDL is clean or octokit moves to 17. +**`graphql` is 17, and the generator builds GitHub's schema with `assumeValid: true` to get +there.** v17 enforces that an implementation field is not deprecated where the interface +field it satisfies isn't, and GitHub's published SDL breaks it on fifteen fields, from +`Project.id` to `TeamDiscussionComment.url`. `assumeValidSDL` alone does not cover it: +codegen runs `assertValidSchema` inside `validateGraphQlDocuments`, and `assumeValid` on +`buildSchema` is what answers that. **The queries are still validated against the schema** — +a misspelt field fails `check-graphql-types` as before; only GitHub's own SDL goes unchecked. +It was held at 16 from 2026-09-13 to 2026-10-10, the first attempt having stopped at that +error without trying the flag. + +- **An override in `pnpm-workspace.yaml` is what keeps graphql 16 out of the lockfile**, + `@octokit/graphql-schema` depending on `^16.0.0`. That range serves its `validate` export, + which nothing here calls — the generator reads only the `idl` string. It loads under 17 + all the same, `check-graphql-types` importing it on every run. Drop the override when + octokit moves to 17. +- **v17's `print` spaces an input object** — `{ field: SIZE, direction: DESC }` — which is the + whole of what changed in the generated documents when it landed. diff --git a/packages/core/package.json b/packages/core/package.json index e4e845d3..5f1e1f6a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -95,7 +95,7 @@ "@testing-library/jest-dom": "7.0.1", "@types/node": "24.19.1", "@uppercod/css-to-object": "1.1.1", - "graphql": "16.14.2", + "graphql": "17.0.2", "js-yaml": "5.4.3", "jsdom": "catalog:default", "vitest": "catalog:default" diff --git a/packages/core/scripts/generate-graphql-types.ts b/packages/core/scripts/generate-graphql-types.ts index 03addec6..a174c6dc 100644 --- a/packages/core/scripts/generate-graphql-types.ts +++ b/packages/core/scripts/generate-graphql-types.ts @@ -63,8 +63,9 @@ const config: TypeScriptPluginConfig & TypeScriptDocumentsPluginConfig = { scalars: { DateTime: 'string' }, }; -// GitHub's SDL declares a few fields twice, which trips SDL validation -const schemaAst = buildSchema(githubSchema.idl, { assumeValidSDL: true }); +// GitHub's SDL declares a few fields twice, which trips SDL validation, and deprecates fields +// whose interface does not, which trips graphql 17's schema validation +const schemaAst = buildSchema(githubSchema.idl, { assumeValidSDL: true, assumeValid: true }); // printed once: every query output reuses it const schemaDocument = parse(printSchema(schemaAst)); diff --git a/packages/core/src/graphql/generated/organization.ts b/packages/core/src/graphql/generated/organization.ts index c378798c..55cd8319 100644 --- a/packages/core/src/graphql/generated/organization.ts +++ b/packages/core/src/graphql/generated/organization.ts @@ -65,7 +65,7 @@ query getOrganization($login: String!, $after: String) { after: $after privacy: PUBLIC isFork: false - orderBy: {field: STARGAZERS, direction: DESC} + orderBy: { field: STARGAZERS, direction: DESC } ) { totalCount pageInfo { diff --git a/packages/core/src/graphql/generated/stats.ts b/packages/core/src/graphql/generated/stats.ts index 644f554f..839fa4d6 100644 --- a/packages/core/src/graphql/generated/stats.ts +++ b/packages/core/src/graphql/generated/stats.ts @@ -108,7 +108,7 @@ fragment RepoStars on User { first: 100 after: $after ownerAffiliations: $ownerAffiliations - orderBy: {direction: DESC, field: STARGAZERS} + orderBy: { direction: DESC, field: STARGAZERS } ) { totalCount nodes { @@ -175,7 +175,7 @@ fragment RepoStars on User { first: 100 after: $after ownerAffiliations: $ownerAffiliations - orderBy: {direction: DESC, field: STARGAZERS} + orderBy: { direction: DESC, field: STARGAZERS } ) { totalCount nodes { diff --git a/packages/core/src/graphql/generated/top-languages.ts b/packages/core/src/graphql/generated/top-languages.ts index 37cbe489..b254277a 100644 --- a/packages/core/src/graphql/generated/top-languages.ts +++ b/packages/core/src/graphql/generated/top-languages.ts @@ -51,7 +51,7 @@ query topLanguages($login: String!, $ownerAffiliations: [RepositoryAffiliation]) } fragment TopLanguagesRepository on Repository { name - languages(first: 10, orderBy: {field: SIZE, direction: DESC}) { + languages(first: 10, orderBy: { field: SIZE, direction: DESC }) { edges { ...TopLanguage } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index df76fffc..a1e5462e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -179,6 +179,7 @@ catalogs: overrides: node-fetch: npm:node-fetch-native@^1.6.7 + '@octokit/graphql-schema>graphql': ^17.0.0 importers: @@ -338,13 +339,13 @@ importers: devDependencies: '@graphql-codegen/core': specifier: 6.2.2 - version: 6.2.2(graphql@16.14.2) + version: 6.2.2(graphql@17.0.2) '@graphql-codegen/typescript': specifier: 6.1.1 - version: 6.1.1(graphql@16.14.2) + version: 6.1.1(graphql@17.0.2) '@graphql-codegen/typescript-operations': specifier: 6.1.10 - version: 6.1.10(graphql@16.14.2) + version: 6.1.10(graphql@17.0.2) '@octokit/graphql-schema': specifier: 15.26.1 version: 15.26.1 @@ -361,8 +362,8 @@ importers: specifier: 1.1.1 version: 1.1.1 graphql: - specifier: 16.14.2 - version: 16.14.2 + specifier: 17.0.2 + version: 17.0.2 js-yaml: specifier: 5.4.3 version: 5.4.3 @@ -2786,9 +2787,9 @@ packages: peerDependencies: graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - graphql@16.14.2: - resolution: {integrity: sha512-Chq1s4CY7jmh8gO2qvLIJyfCDIN+EHLFW/9iShnp1z8FjBQMoodWP1kDC36VAMXXIvAjj4ARa7ntfAV2BrjsbA==} - engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + graphql@17.0.2: + resolution: {integrity: sha512-FRWbddMxfkjiB7z+aQDWIR+E34xo9I8c9mtK2RPv8PmMzKRvrdsreHL/Ui/TmwHJfhHChEtsFPyMHKI+xuarQQ==} + engines: {node: ^22.0.0 || ^24.0.0 || ^25.0.0 || >=26.0.0} h3@1.15.11: resolution: {integrity: sha512-L3THSe2MPeBwgIZVSH5zLdBBU90TOxarvhK9d04IDY2AmVS8j2Jz2LIWtwsGOU3lu2I5jCN7FNvVfY2+XyF+mg==} @@ -4221,10 +4222,10 @@ snapshots: '@andrewbranch/untar.js@1.0.4': {} - '@ardatan/relay-compiler@13.0.2(graphql@16.14.2)': + '@ardatan/relay-compiler@13.0.2(graphql@17.0.2)': dependencies: '@babel/runtime': 8.0.0 - graphql: 16.14.2 + graphql: 17.0.2 immutable: 5.1.9 invariant: 2.2.4 @@ -4834,106 +4835,106 @@ snapshots: '@floating-ui/utils@0.2.12': {} - '@graphql-codegen/core@6.2.2(graphql@16.14.2)': + '@graphql-codegen/core@6.2.2(graphql@17.0.2)': dependencies: - '@graphql-codegen/plugin-helpers': 7.4.2(graphql@16.14.2) - '@graphql-tools/schema': 10.1.3(graphql@16.14.2) - '@graphql-tools/utils': 12.0.3(graphql@16.14.2) - graphql: 16.14.2 + '@graphql-codegen/plugin-helpers': 7.4.2(graphql@17.0.2) + '@graphql-tools/schema': 10.1.3(graphql@17.0.2) + '@graphql-tools/utils': 12.0.3(graphql@17.0.2) + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-codegen/plugin-helpers@7.4.2(graphql@16.14.2)': + '@graphql-codegen/plugin-helpers@7.4.2(graphql@17.0.2)': dependencies: - '@graphql-tools/utils': 12.0.3(graphql@16.14.2) + '@graphql-tools/utils': 12.0.3(graphql@17.0.2) change-case-all: 2.1.0 common-tags: 1.8.2 - graphql: 16.14.2 + graphql: 17.0.2 import-from: 4.0.0 tslib: 2.8.1 - '@graphql-codegen/schema-ast@6.1.0(graphql@16.14.2)': + '@graphql-codegen/schema-ast@6.1.0(graphql@17.0.2)': dependencies: - '@graphql-codegen/plugin-helpers': 7.4.2(graphql@16.14.2) - '@graphql-tools/utils': 11.2.2(graphql@16.14.2) - graphql: 16.14.2 + '@graphql-codegen/plugin-helpers': 7.4.2(graphql@17.0.2) + '@graphql-tools/utils': 11.2.2(graphql@17.0.2) + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-codegen/typescript-operations@6.1.10(graphql@16.14.2)': + '@graphql-codegen/typescript-operations@6.1.10(graphql@17.0.2)': dependencies: - '@graphql-codegen/plugin-helpers': 7.4.2(graphql@16.14.2) - '@graphql-codegen/schema-ast': 6.1.0(graphql@16.14.2) - '@graphql-codegen/visitor-plugin-common': 7.2.9(graphql@16.14.2) + '@graphql-codegen/plugin-helpers': 7.4.2(graphql@17.0.2) + '@graphql-codegen/schema-ast': 6.1.0(graphql@17.0.2) + '@graphql-codegen/visitor-plugin-common': 7.2.9(graphql@17.0.2) auto-bind: 5.0.1 - graphql: 16.14.2 + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-codegen/typescript@6.1.1(graphql@16.14.2)': + '@graphql-codegen/typescript@6.1.1(graphql@17.0.2)': dependencies: - '@graphql-codegen/plugin-helpers': 7.4.2(graphql@16.14.2) - '@graphql-codegen/schema-ast': 6.1.0(graphql@16.14.2) - '@graphql-codegen/visitor-plugin-common': 7.2.9(graphql@16.14.2) + '@graphql-codegen/plugin-helpers': 7.4.2(graphql@17.0.2) + '@graphql-codegen/schema-ast': 6.1.0(graphql@17.0.2) + '@graphql-codegen/visitor-plugin-common': 7.2.9(graphql@17.0.2) auto-bind: 5.0.1 - graphql: 16.14.2 + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-codegen/visitor-plugin-common@7.2.9(graphql@16.14.2)': + '@graphql-codegen/visitor-plugin-common@7.2.9(graphql@17.0.2)': dependencies: - '@graphql-codegen/plugin-helpers': 7.4.2(graphql@16.14.2) - '@graphql-tools/optimize': 2.0.0(graphql@16.14.2) - '@graphql-tools/relay-operation-optimizer': 7.1.12(graphql@16.14.2) - '@graphql-tools/utils': 12.0.3(graphql@16.14.2) + '@graphql-codegen/plugin-helpers': 7.4.2(graphql@17.0.2) + '@graphql-tools/optimize': 2.0.0(graphql@17.0.2) + '@graphql-tools/relay-operation-optimizer': 7.1.12(graphql@17.0.2) + '@graphql-tools/utils': 12.0.3(graphql@17.0.2) auto-bind: 5.0.1 change-case-all: 2.1.0 dependency-graph: 1.0.0 - graphql: 16.14.2 - graphql-tag: 2.12.7(graphql@16.14.2) + graphql: 17.0.2 + graphql-tag: 2.12.7(graphql@17.0.2) parse-filepath: 1.0.2 tslib: 2.8.1 - '@graphql-tools/merge@9.2.6(graphql@16.14.2)': + '@graphql-tools/merge@9.2.6(graphql@17.0.2)': dependencies: - '@graphql-tools/utils': 12.0.3(graphql@16.14.2) - graphql: 16.14.2 + '@graphql-tools/utils': 12.0.3(graphql@17.0.2) + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-tools/optimize@2.0.0(graphql@16.14.2)': + '@graphql-tools/optimize@2.0.0(graphql@17.0.2)': dependencies: - graphql: 16.14.2 + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-tools/relay-operation-optimizer@7.1.12(graphql@16.14.2)': + '@graphql-tools/relay-operation-optimizer@7.1.12(graphql@17.0.2)': dependencies: - '@ardatan/relay-compiler': 13.0.2(graphql@16.14.2) - '@graphql-tools/utils': 12.0.3(graphql@16.14.2) - graphql: 16.14.2 + '@ardatan/relay-compiler': 13.0.2(graphql@17.0.2) + '@graphql-tools/utils': 12.0.3(graphql@17.0.2) + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-tools/schema@10.1.3(graphql@16.14.2)': + '@graphql-tools/schema@10.1.3(graphql@17.0.2)': dependencies: - '@graphql-tools/merge': 9.2.6(graphql@16.14.2) - '@graphql-tools/utils': 12.0.3(graphql@16.14.2) - graphql: 16.14.2 + '@graphql-tools/merge': 9.2.6(graphql@17.0.2) + '@graphql-tools/utils': 12.0.3(graphql@17.0.2) + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-tools/utils@11.2.2(graphql@16.14.2)': + '@graphql-tools/utils@11.2.2(graphql@17.0.2)': dependencies: - '@graphql-typed-document-node/core': 3.2.0(graphql@16.14.2) + '@graphql-typed-document-node/core': 3.2.0(graphql@17.0.2) '@whatwg-node/promise-helpers': 1.3.2 cross-inspect: 1.0.1 - graphql: 16.14.2 + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-tools/utils@12.0.3(graphql@16.14.2)': + '@graphql-tools/utils@12.0.3(graphql@17.0.2)': dependencies: - '@graphql-typed-document-node/core': 3.2.0(graphql@16.14.2) + '@graphql-typed-document-node/core': 3.2.0(graphql@17.0.2) '@whatwg-node/promise-helpers': 2.0.0 cross-inspect: 1.0.1 - graphql: 16.14.2 + graphql: 17.0.2 tslib: 2.8.1 - '@graphql-typed-document-node/core@3.2.0(graphql@16.14.2)': + '@graphql-typed-document-node/core@3.2.0(graphql@17.0.2)': dependencies: - graphql: 16.14.2 + graphql: 17.0.2 '@img/colour@1.1.0': optional: true @@ -5237,8 +5238,8 @@ snapshots: '@octokit/graphql-schema@15.26.1': dependencies: - graphql: 16.14.2 - graphql-tag: 2.12.7(graphql@16.14.2) + graphql: 17.0.2 + graphql-tag: 2.12.7(graphql@17.0.2) '@oslojs/encoding@1.1.0': {} @@ -6345,12 +6346,12 @@ snapshots: graceful-fs@4.2.11: {} - graphql-tag@2.12.7(graphql@16.14.2): + graphql-tag@2.12.7(graphql@17.0.2): dependencies: - graphql: 16.14.2 + graphql: 17.0.2 tslib: 2.8.1 - graphql@16.14.2: {} + graphql@17.0.2: {} h3@1.15.11: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 19b480f6..f7efe48a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -7,6 +7,8 @@ overrides: # no code of either package runs here, the site importing webawesome's components and # never the @lit-labs/ssr behind them. node-fetch: npm:node-fetch-native@^1.6.7 + # It asks for ^16 on behalf of a `validate` nothing here calls; the generator reads only its SDL. + '@octokit/graphql-schema>graphql': ^17.0.0 allowBuilds: # astro's bundler; it fetches its platform binary in a postinstall