From 74436b431f4d618cc8ded290352111ec241ad234 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 17:39:06 +1000 Subject: [PATCH 1/6] chore(release): update monorepo packages versions (#10907) Co-authored-by: github-actions[bot] --- .changeset/beige-insects-try.md | 6 ------ .changeset/famous-rats-laugh.md | 5 ----- .../other/visitor-plugin-common/CHANGELOG.md | 9 +++++++++ .../other/visitor-plugin-common/package.json | 2 +- .../plugins/typescript/operations/CHANGELOG.md | 13 +++++++++++++ .../plugins/typescript/operations/package.json | 2 +- packages/presets/client/CHANGELOG.md | 15 +++++++++++++++ packages/presets/client/package.json | 2 +- 8 files changed, 40 insertions(+), 14 deletions(-) delete mode 100644 .changeset/beige-insects-try.md delete mode 100644 .changeset/famous-rats-laugh.md diff --git a/.changeset/beige-insects-try.md b/.changeset/beige-insects-try.md deleted file mode 100644 index 4d95b40ca11..00000000000 --- a/.changeset/beige-insects-try.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@graphql-codegen/visitor-plugin-common': patch -'@graphql-codegen/client-preset': patch ---- - -Fix fragment masking generation when conditional directive is used diff --git a/.changeset/famous-rats-laugh.md b/.changeset/famous-rats-laugh.md deleted file mode 100644 index dc37a673c05..00000000000 --- a/.changeset/famous-rats-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/typescript-operations': patch ---- - -Fix types when introspection is used and values are not generated or imported correctly diff --git a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md index f241a1e0426..8a6c8d4f836 100644 --- a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md +++ b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md @@ -1,5 +1,14 @@ # @graphql-codegen/visitor-plugin-common +## 7.2.3 + +### Patch Changes + +- [#10904](https://github.com/dotansimha/graphql-code-generator/pull/10904) + [`2dd1531`](https://github.com/dotansimha/graphql-code-generator/commit/2dd1531475193de473cb5220926faf8715a64854) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix fragment masking generation when + conditional directive is used + ## 7.2.2 ### Patch Changes diff --git a/packages/plugins/other/visitor-plugin-common/package.json b/packages/plugins/other/visitor-plugin-common/package.json index 6b18f255dff..556d5d50384 100644 --- a/packages/plugins/other/visitor-plugin-common/package.json +++ b/packages/plugins/other/visitor-plugin-common/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/visitor-plugin-common", - "version": "7.2.2", + "version": "7.2.3", "type": "module", "repository": { "type": "git", diff --git a/packages/plugins/typescript/operations/CHANGELOG.md b/packages/plugins/typescript/operations/CHANGELOG.md index 16cac79e86b..625eae53642 100644 --- a/packages/plugins/typescript/operations/CHANGELOG.md +++ b/packages/plugins/typescript/operations/CHANGELOG.md @@ -1,5 +1,18 @@ # @graphql-codegen/typescript-operations +## 6.1.3 + +### Patch Changes + +- [#10905](https://github.com/dotansimha/graphql-code-generator/pull/10905) + [`5a9f96c`](https://github.com/dotansimha/graphql-code-generator/commit/5a9f96cde55b310976729d5fc3cc2e7aa98ace31) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix types when introspection is used and + values are not generated or imported correctly + +- Updated dependencies + [[`2dd1531`](https://github.com/dotansimha/graphql-code-generator/commit/2dd1531475193de473cb5220926faf8715a64854)]: + - @graphql-codegen/visitor-plugin-common@7.2.3 + ## 6.1.2 ### Patch Changes diff --git a/packages/plugins/typescript/operations/package.json b/packages/plugins/typescript/operations/package.json index 157b48c4c4f..96c3f68e726 100644 --- a/packages/plugins/typescript/operations/package.json +++ b/packages/plugins/typescript/operations/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/typescript-operations", - "version": "6.1.2", + "version": "6.1.3", "type": "module", "description": "GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments", "repository": { diff --git a/packages/presets/client/CHANGELOG.md b/packages/presets/client/CHANGELOG.md index 547312e6e19..8736abc8c08 100644 --- a/packages/presets/client/CHANGELOG.md +++ b/packages/presets/client/CHANGELOG.md @@ -1,5 +1,20 @@ # @graphql-codegen/client-preset +## 6.1.1 + +### Patch Changes + +- [#10904](https://github.com/dotansimha/graphql-code-generator/pull/10904) + [`2dd1531`](https://github.com/dotansimha/graphql-code-generator/commit/2dd1531475193de473cb5220926faf8715a64854) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix fragment masking generation when + conditional directive is used + +- Updated dependencies + [[`2dd1531`](https://github.com/dotansimha/graphql-code-generator/commit/2dd1531475193de473cb5220926faf8715a64854), + [`5a9f96c`](https://github.com/dotansimha/graphql-code-generator/commit/5a9f96cde55b310976729d5fc3cc2e7aa98ace31)]: + - @graphql-codegen/visitor-plugin-common@7.2.3 + - @graphql-codegen/typescript-operations@6.1.3 + ## 6.1.0 ### Minor Changes diff --git a/packages/presets/client/package.json b/packages/presets/client/package.json index e169cf7de25..5b626be03ad 100644 --- a/packages/presets/client/package.json +++ b/packages/presets/client/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/client-preset", - "version": "6.1.0", + "version": "6.1.1", "type": "module", "description": "GraphQL Code Generator preset for client.", "repository": { From 1624c8aae53176a21c0dbbe1fb0d7d565ba50e22 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Wed, 5 Aug 2026 20:21:02 +1000 Subject: [PATCH 2/6] Fix operations plugin unncessarily visiting schema (#10910) --- .changeset/tricky-boats-watch.md | 6 ++++++ packages/plugins/typescript/operations/src/index.ts | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/tricky-boats-watch.md diff --git a/.changeset/tricky-boats-watch.md b/.changeset/tricky-boats-watch.md new file mode 100644 index 00000000000..c45c63851da --- /dev/null +++ b/.changeset/tricky-boats-watch.md @@ -0,0 +1,6 @@ +--- +'@graphql-codegen/typescript-operations': patch +--- + +Fix performance issue when config.importSchemaTypesFrom is set, and the provided schema is still +unnecessarily visited diff --git a/packages/plugins/typescript/operations/src/index.ts b/packages/plugins/typescript/operations/src/index.ts index 393f5703df9..f2a1d59fce6 100644 --- a/packages/plugins/typescript/operations/src/index.ts +++ b/packages/plugins/typescript/operations/src/index.ts @@ -81,8 +81,16 @@ export const plugin: PluginFunction< // #region generateSchemaTypes // When Input and Enum appear in Result selection sets, we need to // generate those types so they can be referred to correctly - const schemaTypes = oldVisit(transformSchemaAST(schema, config).ast, { leave: visitor }); - const schemaTypesDefinitions = findTransformedDefinitions(schemaTypes); + // + // Note: we don't run visitor on the schema when i.e. `!config.importSchemaTypesFrom` + // because the schema types are supposedly already generated elsewhere. + // In such cases, running the visitor on the schema will do unncessary work + let schemaTypesDefinitions: string[] = []; + if (!config.importSchemaTypesFrom) { + const schemaTypes = oldVisit(transformSchemaAST(schema, config).ast, { leave: visitor }); + schemaTypesDefinitions = findTransformedDefinitions(schemaTypes); + } + // #endregion // #region generateIntrospectionTypesDefinitions From e2bf378f9ed4954053c7ed3cf6c0c42a1ce3c04f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 20:30:08 +1000 Subject: [PATCH 3/6] chore(release): update monorepo packages versions (#10911) Co-authored-by: github-actions[bot] --- .changeset/tricky-boats-watch.md | 6 ------ packages/plugins/typescript/operations/CHANGELOG.md | 9 +++++++++ packages/plugins/typescript/operations/package.json | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 .changeset/tricky-boats-watch.md diff --git a/.changeset/tricky-boats-watch.md b/.changeset/tricky-boats-watch.md deleted file mode 100644 index c45c63851da..00000000000 --- a/.changeset/tricky-boats-watch.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@graphql-codegen/typescript-operations': patch ---- - -Fix performance issue when config.importSchemaTypesFrom is set, and the provided schema is still -unnecessarily visited diff --git a/packages/plugins/typescript/operations/CHANGELOG.md b/packages/plugins/typescript/operations/CHANGELOG.md index 625eae53642..cf853455f94 100644 --- a/packages/plugins/typescript/operations/CHANGELOG.md +++ b/packages/plugins/typescript/operations/CHANGELOG.md @@ -1,5 +1,14 @@ # @graphql-codegen/typescript-operations +## 6.1.4 + +### Patch Changes + +- [#10910](https://github.com/dotansimha/graphql-code-generator/pull/10910) + [`1624c8a`](https://github.com/dotansimha/graphql-code-generator/commit/1624c8aae53176a21c0dbbe1fb0d7d565ba50e22) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix performance issue when + config.importSchemaTypesFrom is set, and the provided schema is still unnecessarily visited + ## 6.1.3 ### Patch Changes diff --git a/packages/plugins/typescript/operations/package.json b/packages/plugins/typescript/operations/package.json index 96c3f68e726..b26d4186f23 100644 --- a/packages/plugins/typescript/operations/package.json +++ b/packages/plugins/typescript/operations/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/typescript-operations", - "version": "6.1.3", + "version": "6.1.4", "type": "module", "description": "GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments", "repository": { From f570a1a30d1073ab9459aaa1907a112e3269acf3 Mon Sep 17 00:00:00 2001 From: Vincent Gao Date: Wed, 5 Aug 2026 13:49:23 +0200 Subject: [PATCH 4/6] fix: run the windows-latest CI legs on Windows (#10908) * fix: run the windows-latest CI legs on Windows The test and test-watcher jobs define an os matrix axis with a single windows-latest include entry, but that leg has never run on Windows: - the include entry uses the key node-version while the axis is node_version, so the windows combination is created with an empty matrix.node_version; - runs-on is hardcoded to ubuntu-latest, so the leg executes on Ubuntu with the runner's default Node. Consume matrix.os in runs-on and fix the include key so the windows leg runs on a Windows runner with the pinned Node version. Add a workflow matrix check (run in CI) that validates every workflow file, so this class of silent misconfiguration fails the build instead of degrading the matrix. * Remove workflows check --------- Co-authored-by: Eddy Nguyen --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad9d8795768..f50bcd253e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -178,7 +178,7 @@ jobs: name: Unit Test on Node ${{matrix.node_version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}} - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} needs: - lint - prettier-check @@ -189,7 +189,7 @@ jobs: node_version: [22, 24] graphql_version: [15, 16, 17] include: - - node-version: 22 + - node_version: 22 os: windows-latest graphql_version: 16 steps: @@ -223,7 +223,7 @@ jobs: name: Watcher Unit Test on Node ${{matrix.node_version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}} - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} needs: - lint - prettier-check @@ -234,7 +234,7 @@ jobs: node_version: [20] graphql_version: [15, 16] include: - - node-version: 20 + - node_version: 20 os: windows-latest graphql_version: 16 steps: From b36c0843de8d5f5958f1eabee74fd72086d63953 Mon Sep 17 00:00:00 2001 From: Jayden Seric Date: Wed, 5 Aug 2026 22:04:32 +1000 Subject: [PATCH 5/6] Add types and tests for TypeScript operations plugin option `disableDescriptions` (#10909) * Add types and tests for TypeScript operations plugin option `disableDescriptions` * Add a changeset. --------- Co-authored-by: Eddy Nguyen --- .changeset/fluffy-carpets-sniff.md | 5 +++ .../typescript/operations/src/config.ts | 26 ++++++++++++ .../operations/tests/ts-documents.spec.ts | 41 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .changeset/fluffy-carpets-sniff.md diff --git a/.changeset/fluffy-carpets-sniff.md b/.changeset/fluffy-carpets-sniff.md new file mode 100644 index 00000000000..9868d8aff8d --- /dev/null +++ b/.changeset/fluffy-carpets-sniff.md @@ -0,0 +1,5 @@ +--- +'@graphql-codegen/typescript-operations': patch +--- + +Added missing types and tests for the TypeScript operations plugin option `disableDescriptions`. diff --git a/packages/plugins/typescript/operations/src/config.ts b/packages/plugins/typescript/operations/src/config.ts index eb2db30ad27..23d96183bc3 100644 --- a/packages/plugins/typescript/operations/src/config.ts +++ b/packages/plugins/typescript/operations/src/config.ts @@ -132,6 +132,32 @@ export interface TypeScriptDocumentsPluginConfig extends RawDocumentsConfig { * ``` */ noExport?: boolean; + + /** + * @description Set the value to `true` in order to disable all description generation. + * @default false + * + * @exampleMarkdown + * ## Disable description generation + * ```ts filename="codegen.ts" + * import type { CodegenConfig } from '@graphql-codegen/cli' + * + * const config: CodegenConfig = { + * // ... + * generates: { + * 'path/to/file.ts': { + * plugins: ['typescript-operations'], + * config: { + * disableDescriptions: true + * } + * } + * } + * } + * export default config + * ``` + */ + disableDescriptions?: boolean; + /** * @name addOperationExport * @type boolean diff --git a/packages/plugins/typescript/operations/tests/ts-documents.spec.ts b/packages/plugins/typescript/operations/tests/ts-documents.spec.ts index 1d98e92f2e5..262d82dcae4 100644 --- a/packages/plugins/typescript/operations/tests/ts-documents.spec.ts +++ b/packages/plugins/typescript/operations/tests/ts-documents.spec.ts @@ -48,6 +48,47 @@ describe('TypeScript Operations Plugin', () => { await validate(content); }); + describe('disableDescriptions', () => { + const description = 'Description.'; + const testSchema = buildSchema(/* GraphQL */ ` + "${description}" + enum A { + B + } + + type Query { + a: A + } + `); + const document = parse(/* GraphQL */ ` + query { + a + } + `); + + it('Should generate descriptions when set to false', async () => { + const { content } = await plugin( + testSchema, + [{ document }], + { disableDescriptions: false }, + { outputFile: '' }, + ); + + expect(content).toContain(description); + }); + + it('Should not generate descriptions when set to true', async () => { + const { content } = await plugin( + testSchema, + [{ document }], + { disableDescriptions: true }, + { outputFile: '' }, + ); + + expect(content).not.toContain(description); + }); + }); + it('Can merge an inline fragment with a spread', async () => { const testSchema = buildSchema(/* GraphQL */ ` interface Comment { From 5348c43eb3a410bbf6c9b0881d133d31aeab5725 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:16:01 +1000 Subject: [PATCH 6/6] chore(release): update monorepo packages versions (#10913) Co-authored-by: github-actions[bot] --- .changeset/fluffy-carpets-sniff.md | 5 ----- packages/plugins/typescript/operations/CHANGELOG.md | 9 +++++++++ packages/plugins/typescript/operations/package.json | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 .changeset/fluffy-carpets-sniff.md diff --git a/.changeset/fluffy-carpets-sniff.md b/.changeset/fluffy-carpets-sniff.md deleted file mode 100644 index 9868d8aff8d..00000000000 --- a/.changeset/fluffy-carpets-sniff.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/typescript-operations': patch ---- - -Added missing types and tests for the TypeScript operations plugin option `disableDescriptions`. diff --git a/packages/plugins/typescript/operations/CHANGELOG.md b/packages/plugins/typescript/operations/CHANGELOG.md index cf853455f94..a86e63fd561 100644 --- a/packages/plugins/typescript/operations/CHANGELOG.md +++ b/packages/plugins/typescript/operations/CHANGELOG.md @@ -1,5 +1,14 @@ # @graphql-codegen/typescript-operations +## 6.1.5 + +### Patch Changes + +- [#10909](https://github.com/dotansimha/graphql-code-generator/pull/10909) + [`b36c084`](https://github.com/dotansimha/graphql-code-generator/commit/b36c0843de8d5f5958f1eabee74fd72086d63953) + Thanks [@jaydenseric](https://github.com/jaydenseric)! - Added missing types and tests for the + TypeScript operations plugin option `disableDescriptions`. + ## 6.1.4 ### Patch Changes diff --git a/packages/plugins/typescript/operations/package.json b/packages/plugins/typescript/operations/package.json index b26d4186f23..95f6b0d3591 100644 --- a/packages/plugins/typescript/operations/package.json +++ b/packages/plugins/typescript/operations/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/typescript-operations", - "version": "6.1.4", + "version": "6.1.5", "type": "module", "description": "GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments", "repository": {