diff --git a/.changeset/brave-modules-skip.md b/.changeset/brave-modules-skip.md deleted file mode 100644 index 9912f1cc1f8..00000000000 --- a/.changeset/brave-modules-skip.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/graphql-modules-preset': patch ---- - -Skip sources without a `location` when grouping sources by module, instead of throwing from `path.normalize`, and skip sources without a `document` AST when building each module's document. Generated output from the CLI is unchanged. diff --git a/.changeset/calm-owls-guard.md b/.changeset/calm-owls-guard.md deleted file mode 100644 index 5b06c7777c5..00000000000 --- a/.changeset/calm-owls-guard.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/core': patch ---- - -Skip documents without a `document` AST when validating documents against the schema, instead of passing `undefined` to validation. Generated output from the CLI is unchanged. diff --git a/.changeset/quiet-foxes-skip.md b/.changeset/quiet-foxes-skip.md deleted file mode 100644 index c8854ce8573..00000000000 --- a/.changeset/quiet-foxes-skip.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/typescript-document-nodes': patch ---- - -Skip documents without a `document` AST instead of throwing from `concatAST` when the plugin is called directly with one. Generated output from the CLI is unchanged. diff --git a/.changeset/quiet-pens-return.md b/.changeset/quiet-pens-return.md deleted file mode 100644 index a938ccaecca..00000000000 --- a/.changeset/quiet-pens-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/add': patch ---- - -The plugin output's `content` is now an empty string (`''`) instead of `null` when `placement` is `prepend` or `append`. This matches the `ComplexPluginOutput` type (`content: string`). Code that calls the plugin directly and checks `content === null` should check for an empty string instead. Generated files are unchanged. diff --git a/.changeset/tidy-tags-guard.md b/.changeset/tidy-tags-guard.md deleted file mode 100644 index be3832d79b7..00000000000 --- a/.changeset/tidy-tags-guard.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/testing': patch ---- - -Make `validateTs`/`compileTs` type-check under `strict: true`: fall back to the compiler host's script target when the passed options have no `target`, and only compute a diagnostic's line/column when it has a `start` position. Adds `@types/common-tags` as a devDependency. diff --git a/.changeset/tidy-typed-nodes.md b/.changeset/tidy-typed-nodes.md deleted file mode 100644 index e079ae76f70..00000000000 --- a/.changeset/tidy-typed-nodes.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/typed-document-node': patch ---- - -Skip documents without a `document` AST instead of throwing from `concatAST` when the plugin is called directly with one, and don't add an empty import when `documentNodeImport` has no module. Generated output from the CLI is unchanged. diff --git a/.changeset/typed-old-visit.md b/.changeset/typed-old-visit.md deleted file mode 100644 index 7982132b9a5..00000000000 --- a/.changeset/typed-old-visit.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@graphql-codegen/plugin-helpers': minor ---- - -Type `oldVisit`'s return value instead of returning `any`. For a `DocumentNode`, the result is now `OldVisitDocumentResult`, whose `definitions` are `unknown[]` because leave visitors can replace each definition with any value (usually a string), and definitions without a leave visitor stay as AST nodes. When a `Document` leave visitor returns its own value, pass its type as `oldVisit(...)`. For other roots, the result is `unknown` unless `TResult` is given. - -Code that used the result as `any`, for example `const definitions: string[] = result.definitions`, now needs to filter for strings, cast (`result.definitions as string[]`), or pass `oldVisit(...)`. Runtime behavior and generated output are unchanged. diff --git a/.changeset/wide-config-values.md b/.changeset/wide-config-values.md deleted file mode 100644 index 6c011d95371..00000000000 --- a/.changeset/wide-config-values.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/visitor-plugin-common': patch ---- - -Type `getConfigValue`'s `value` parameter as `T | null | undefined`, so the result is non-nullable when a non-nullable default is given. diff --git a/packages/graphql-codegen-core/CHANGELOG.md b/packages/graphql-codegen-core/CHANGELOG.md index 270e716f5bf..f0bd604c89e 100644 --- a/packages/graphql-codegen-core/CHANGELOG.md +++ b/packages/graphql-codegen-core/CHANGELOG.md @@ -1,5 +1,19 @@ # @graphql-codegen/core +## 6.2.1 + +### Patch Changes + +- [#10991](https://github.com/dotansimha/graphql-code-generator/pull/10991) + [`dc70125`](https://github.com/dotansimha/graphql-code-generator/commit/dc7012530290b1b7fa8ad1b017b66e18a6db6078) + Thanks [@eddeee888](https://github.com/eddeee888)! - Skip documents without a `document` AST when + validating documents against the schema, instead of passing `undefined` to validation. Generated + output from the CLI is unchanged. + +- Updated dependencies + [[`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3)]: + - @graphql-codegen/plugin-helpers@7.4.0 + ## 6.2.0 ### Minor Changes diff --git a/packages/graphql-codegen-core/package.json b/packages/graphql-codegen-core/package.json index af48820e85e..3e4bcd566f2 100644 --- a/packages/graphql-codegen-core/package.json +++ b/packages/graphql-codegen-core/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/core", - "version": "6.2.0", + "version": "6.2.1", "type": "module", "repository": { "type": "git", diff --git a/packages/plugins/other/add/CHANGELOG.md b/packages/plugins/other/add/CHANGELOG.md index 8efd718a69f..d855cf88744 100644 --- a/packages/plugins/other/add/CHANGELOG.md +++ b/packages/plugins/other/add/CHANGELOG.md @@ -1,5 +1,20 @@ # @graphql-codegen/add +## 7.1.1 + +### Patch Changes + +- [#10986](https://github.com/dotansimha/graphql-code-generator/pull/10986) + [`9597b5b`](https://github.com/dotansimha/graphql-code-generator/commit/9597b5bc76c24b66f3e7b000e1038ad8d6ab3450) + Thanks [@eddeee888](https://github.com/eddeee888)! - The plugin output's `content` is now an empty + string (`''`) instead of `null` when `placement` is `prepend` or `append`. This matches the + `ComplexPluginOutput` type (`content: string`). Code that calls the plugin directly and checks + `content === null` should check for an empty string instead. Generated files are unchanged. + +- Updated dependencies + [[`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3)]: + - @graphql-codegen/plugin-helpers@7.4.0 + ## 7.1.0 ### Minor Changes diff --git a/packages/plugins/other/add/package.json b/packages/plugins/other/add/package.json index ccd04f4567f..526f8d81ba2 100644 --- a/packages/plugins/other/add/package.json +++ b/packages/plugins/other/add/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/add", - "version": "7.1.0", + "version": "7.1.1", "type": "module", "description": "GraphQL Code Generator plugin for adding custom content to your output file", "repository": { diff --git a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md index 9de987a0c8f..4bbb830441c 100644 --- a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md +++ b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md @@ -1,5 +1,18 @@ # @graphql-codegen/visitor-plugin-common +## 7.2.6 + +### Patch Changes + +- [#10993](https://github.com/dotansimha/graphql-code-generator/pull/10993) + [`be69e9d`](https://github.com/dotansimha/graphql-code-generator/commit/be69e9d1a9c234061754a1922b8b961ec80a2fcb) + Thanks [@eddeee888](https://github.com/eddeee888)! - Type `getConfigValue`'s `value` parameter as + `T | null | undefined`, so the result is non-nullable when a non-nullable default is given. + +- Updated dependencies + [[`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3)]: + - @graphql-codegen/plugin-helpers@7.4.0 + ## 7.2.5 ### Patch Changes diff --git a/packages/plugins/other/visitor-plugin-common/package.json b/packages/plugins/other/visitor-plugin-common/package.json index 5867c5585b8..a2961193eb7 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.5", + "version": "7.2.6", "type": "module", "repository": { "type": "git", diff --git a/packages/plugins/typescript/document-nodes/CHANGELOG.md b/packages/plugins/typescript/document-nodes/CHANGELOG.md index d384206711d..356b7c16c40 100644 --- a/packages/plugins/typescript/document-nodes/CHANGELOG.md +++ b/packages/plugins/typescript/document-nodes/CHANGELOG.md @@ -1,5 +1,21 @@ # @graphql-codegen/typescript-document-nodes +## 6.1.1 + +### Patch Changes + +- [#10990](https://github.com/dotansimha/graphql-code-generator/pull/10990) + [`df288d8`](https://github.com/dotansimha/graphql-code-generator/commit/df288d8e047bbb7581a9bdc34c465a2988535e80) + Thanks [@eddeee888](https://github.com/eddeee888)! - Skip documents without a `document` AST + instead of throwing from `concatAST` when the plugin is called directly with one. Generated output + from the CLI is unchanged. + +- Updated dependencies + [[`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3), + [`be69e9d`](https://github.com/dotansimha/graphql-code-generator/commit/be69e9d1a9c234061754a1922b8b961ec80a2fcb)]: + - @graphql-codegen/plugin-helpers@7.4.0 + - @graphql-codegen/visitor-plugin-common@7.2.6 + ## 6.1.0 ### Minor Changes diff --git a/packages/plugins/typescript/document-nodes/package.json b/packages/plugins/typescript/document-nodes/package.json index f993356532d..5a387a58325 100644 --- a/packages/plugins/typescript/document-nodes/package.json +++ b/packages/plugins/typescript/document-nodes/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/typescript-document-nodes", - "version": "6.1.0", + "version": "6.1.1", "type": "module", "description": "GraphQL Code Generator plugin for generating TypeScript modules with embedded GraphQL document nodes", "repository": { diff --git a/packages/plugins/typescript/typed-document-node/CHANGELOG.md b/packages/plugins/typescript/typed-document-node/CHANGELOG.md index c351098ca8a..d0a45c15b88 100644 --- a/packages/plugins/typescript/typed-document-node/CHANGELOG.md +++ b/packages/plugins/typescript/typed-document-node/CHANGELOG.md @@ -1,5 +1,21 @@ # @graphql-codegen/typed-document-node +## 7.1.1 + +### Patch Changes + +- [#10994](https://github.com/dotansimha/graphql-code-generator/pull/10994) + [`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3) + Thanks [@eddeee888](https://github.com/eddeee888)! - Skip documents without a `document` AST + instead of throwing from `concatAST` when the plugin is called directly with one, and don't add an + empty import when `documentNodeImport` has no module. Generated output from the CLI is unchanged. + +- Updated dependencies + [[`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3), + [`be69e9d`](https://github.com/dotansimha/graphql-code-generator/commit/be69e9d1a9c234061754a1922b8b961ec80a2fcb)]: + - @graphql-codegen/plugin-helpers@7.4.0 + - @graphql-codegen/visitor-plugin-common@7.2.6 + ## 7.1.0 ### Minor Changes diff --git a/packages/plugins/typescript/typed-document-node/package.json b/packages/plugins/typescript/typed-document-node/package.json index 3557188d16f..9eff75e73b4 100644 --- a/packages/plugins/typescript/typed-document-node/package.json +++ b/packages/plugins/typescript/typed-document-node/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/typed-document-node", - "version": "7.1.0", + "version": "7.1.1", "type": "module", "description": "GraphQL Code Generator plugin for generating ready-to-use TypedDocumentNode based on GraphQL operations", "repository": { diff --git a/packages/presets/graphql-modules/CHANGELOG.md b/packages/presets/graphql-modules/CHANGELOG.md index 4a58ab0485d..45b80e707e7 100644 --- a/packages/presets/graphql-modules/CHANGELOG.md +++ b/packages/presets/graphql-modules/CHANGELOG.md @@ -1,5 +1,21 @@ # @graphql-codegen/graphql-modules-preset +## 6.1.1 + +### Patch Changes + +- [#10993](https://github.com/dotansimha/graphql-code-generator/pull/10993) + [`be69e9d`](https://github.com/dotansimha/graphql-code-generator/commit/be69e9d1a9c234061754a1922b8b961ec80a2fcb) + Thanks [@eddeee888](https://github.com/eddeee888)! - Skip sources without a `location` when + grouping sources by module, instead of throwing from `path.normalize`, and skip sources without a + `document` AST when building each module's document. Generated output from the CLI is unchanged. + +- Updated dependencies + [[`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3), + [`be69e9d`](https://github.com/dotansimha/graphql-code-generator/commit/be69e9d1a9c234061754a1922b8b961ec80a2fcb)]: + - @graphql-codegen/plugin-helpers@7.4.0 + - @graphql-codegen/visitor-plugin-common@7.2.6 + ## 6.1.0 ### Minor Changes diff --git a/packages/presets/graphql-modules/package.json b/packages/presets/graphql-modules/package.json index ddf9ff01a11..42cf5958fc6 100644 --- a/packages/presets/graphql-modules/package.json +++ b/packages/presets/graphql-modules/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/graphql-modules-preset", - "version": "6.1.0", + "version": "6.1.1", "type": "module", "description": "GraphQL Code Generator preset for modularized schema", "repository": { diff --git a/packages/utils/graphql-codegen-testing/CHANGELOG.md b/packages/utils/graphql-codegen-testing/CHANGELOG.md index a1316cdde08..85bc14e2d23 100644 --- a/packages/utils/graphql-codegen-testing/CHANGELOG.md +++ b/packages/utils/graphql-codegen-testing/CHANGELOG.md @@ -1,5 +1,20 @@ # @graphql-codegen/testing +## 5.0.5 + +### Patch Changes + +- [#10992](https://github.com/dotansimha/graphql-code-generator/pull/10992) + [`024fa34`](https://github.com/dotansimha/graphql-code-generator/commit/024fa34a88073d073c7fa10db0092ee5000dfdca) + Thanks [@eddeee888](https://github.com/eddeee888)! - Make `validateTs`/`compileTs` type-check + under `strict: true`: fall back to the compiler host's script target when the passed options have + no `target`, and only compute a diagnostic's line/column when it has a `start` position. Adds + `@types/common-tags` as a devDependency. + +- Updated dependencies + [[`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3)]: + - @graphql-codegen/plugin-helpers@7.4.0 + ## 5.0.4 ### Patch Changes diff --git a/packages/utils/graphql-codegen-testing/package.json b/packages/utils/graphql-codegen-testing/package.json index c9aac4ca4d8..f9919e40ea3 100644 --- a/packages/utils/graphql-codegen-testing/package.json +++ b/packages/utils/graphql-codegen-testing/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/testing", - "version": "5.0.4", + "version": "5.0.5", "type": "module", "description": "GraphQL Codegen Testing Utils", "repository": "git@github.com:dotansimha/graphql-code-generator.git", diff --git a/packages/utils/plugins-helpers/CHANGELOG.md b/packages/utils/plugins-helpers/CHANGELOG.md index 64d98b3f3ea..24d0ebd308f 100644 --- a/packages/utils/plugins-helpers/CHANGELOG.md +++ b/packages/utils/plugins-helpers/CHANGELOG.md @@ -1,5 +1,23 @@ # @graphql-codegen/plugin-helpers +## 7.4.0 + +### Minor Changes + +- [#10994](https://github.com/dotansimha/graphql-code-generator/pull/10994) + [`1d1153b`](https://github.com/dotansimha/graphql-code-generator/commit/1d1153b3b161fa82057d586bb5fe524e1e17efe3) + Thanks [@eddeee888](https://github.com/eddeee888)! - Type `oldVisit`'s return value instead of + returning `any`. For a `DocumentNode`, the result is now `OldVisitDocumentResult`, whose + `definitions` are `unknown[]` because leave visitors can replace each definition with any value + (usually a string), and definitions without a leave visitor stay as AST nodes. When a `Document` + leave visitor returns its own value, pass its type as `oldVisit(...)`. For other roots, + the result is `unknown` unless `TResult` is given. + + Code that used the result as `any`, for example + `const definitions: string[] = result.definitions`, now needs to filter for strings, cast + (`result.definitions as string[]`), or pass `oldVisit(...)`. Runtime behavior and generated + output are unchanged. + ## 7.3.0 ### Minor Changes diff --git a/packages/utils/plugins-helpers/package.json b/packages/utils/plugins-helpers/package.json index 59be9e85ce6..58afd099c7b 100644 --- a/packages/utils/plugins-helpers/package.json +++ b/packages/utils/plugins-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/plugin-helpers", - "version": "7.3.0", + "version": "7.4.0", "type": "module", "description": "GraphQL Code Generator common utils and types", "repository": {