diff --git a/.changeset/strict-client-preset.md b/.changeset/strict-client-preset.md deleted file mode 100644 index 71eaaad8c71..00000000000 --- a/.changeset/strict-client-preset.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@graphql-codegen/client-preset': patch ---- - -Fix type errors under `strict: true`. The preset now throws a clear error when `schemaAst` is missing from the preset options, and the babel plugin throws when a file has no filename. Both cases used to crash later with a less clear error. Generated output is unchanged. diff --git a/.changeset/strict-typescript-operations.md b/.changeset/strict-typescript-operations.md deleted file mode 100644 index 1b78b833b67..00000000000 --- a/.changeset/strict-typescript-operations.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@graphql-codegen/typescript-operations': patch -'@graphql-codegen/visitor-plugin-common': patch -'@graphql-codegen/plugin-helpers': patch ---- - -Fix type errors in `typescript-operations` under `strict: true` by widening the shared types it calls into: - -- `@graphql-codegen/plugin-helpers`: `Types.ComplexPluginOutput`'s `prepend` and `append` now accept `null` items. Core already skipped them. -- `@graphql-codegen/visitor-plugin-common`: `DeclarationBlock.withComment` accepts `undefined`, `parseEnumValues`'s `mapOrStr` is optional (it already defaulted to `{}`), `ImportSource.namespace` accepts `null`, and `optimizeOperations`'s `includeFragments` is optional. -- `@graphql-codegen/typescript-operations`: skips document files without a `document`, and no longer throws when called without the plugin info argument. - -Generated output is unchanged. diff --git a/.changeset/strict-typescript.md b/.changeset/strict-typescript.md deleted file mode 100644 index 5d787503b1e..00000000000 --- a/.changeset/strict-typescript.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@graphql-codegen/typescript': patch -'@graphql-codegen/visitor-plugin-common': patch ---- - -Fix type errors in `typescript` under `strict: true` by typing the shared visitor methods it overrides: - -- `@graphql-codegen/visitor-plugin-common`: adds `NormalizedDeclarationKindConfig` (every declaration kind set), used by `normalizeDeclarationKind`, `DEFAULT_DECLARATION_KINDS` and `ParsedTypesConfig.declarationKind`. `BaseTypesVisitor`'s `NamedType`, `ListType`, `FieldDefinition`, `InputValueDefinition` and `UnionTypeDefinition` have typed visitor params (`key` and `parent` are required, since the visitor always passes them), and `ObjectTypeDefinition`, `EnumTypeDefinition` and `DirectiveDefinition` may return `null`. -- `@graphql-codegen/typescript`: skips document files without a `document` when collecting introspection types, types the `TsVisitor` visitor params, and `TsVisitor.EnumTypeDefinition` may return `null` like the introspection visitor's override. - -Generated output is unchanged. diff --git a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md index d3be702d22c..4f8b43ea523 100644 --- a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md +++ b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md @@ -1,5 +1,44 @@ # @graphql-codegen/visitor-plugin-common +## 7.2.8 + +### Patch Changes + +- [#11009](https://github.com/dotansimha/graphql-code-generator/pull/11009) + [`1f7566f`](https://github.com/dotansimha/graphql-code-generator/commit/1f7566f0bead301b21d4f7da49a4bc6924d07ef3) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix type errors in `typescript-operations` + under `strict: true` by widening the shared types it calls into: + - `@graphql-codegen/plugin-helpers`: `Types.ComplexPluginOutput`'s `prepend` and `append` now + accept `null` items. Core already skipped them. + - `@graphql-codegen/visitor-plugin-common`: `DeclarationBlock.withComment` accepts `undefined`, + `parseEnumValues`'s `mapOrStr` is optional (it already defaulted to `{}`), + `ImportSource.namespace` accepts `null`, and `optimizeOperations`'s `includeFragments` is + optional. + - `@graphql-codegen/typescript-operations`: skips document files without a `document`, and no + longer throws when called without the plugin info argument. + + Generated output is unchanged. + +- [#11014](https://github.com/dotansimha/graphql-code-generator/pull/11014) + [`7a376ef`](https://github.com/dotansimha/graphql-code-generator/commit/7a376effc2dcb7ac8decaf53c2c18eb0e28e71e6) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix type errors in `typescript` under + `strict: true` by typing the shared visitor methods it overrides: + - `@graphql-codegen/visitor-plugin-common`: adds `NormalizedDeclarationKindConfig` (every + declaration kind set), used by `normalizeDeclarationKind`, `DEFAULT_DECLARATION_KINDS` and + `ParsedTypesConfig.declarationKind`. `BaseTypesVisitor`'s `NamedType`, `ListType`, + `FieldDefinition`, `InputValueDefinition` and `UnionTypeDefinition` have typed visitor params + (`key` and `parent` are required, since the visitor always passes them), and + `ObjectTypeDefinition`, `EnumTypeDefinition` and `DirectiveDefinition` may return `null`. + - `@graphql-codegen/typescript`: skips document files without a `document` when collecting + introspection types, types the `TsVisitor` visitor params, and `TsVisitor.EnumTypeDefinition` + may return `null` like the introspection visitor's override. + + Generated output is unchanged. + +- Updated dependencies + [[`1f7566f`](https://github.com/dotansimha/graphql-code-generator/commit/1f7566f0bead301b21d4f7da49a4bc6924d07ef3)]: + - @graphql-codegen/plugin-helpers@7.4.1 + ## 7.2.7 ### Patch Changes diff --git a/packages/plugins/other/visitor-plugin-common/package.json b/packages/plugins/other/visitor-plugin-common/package.json index 5d961c4bd31..cfa09b24f41 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.7", + "version": "7.2.8", "type": "module", "repository": { "type": "git", diff --git a/packages/plugins/typescript/operations/CHANGELOG.md b/packages/plugins/typescript/operations/CHANGELOG.md index c96104c32b7..d97a6529c82 100644 --- a/packages/plugins/typescript/operations/CHANGELOG.md +++ b/packages/plugins/typescript/operations/CHANGELOG.md @@ -1,5 +1,30 @@ # @graphql-codegen/typescript-operations +## 6.1.10 + +### Patch Changes + +- [#11009](https://github.com/dotansimha/graphql-code-generator/pull/11009) + [`1f7566f`](https://github.com/dotansimha/graphql-code-generator/commit/1f7566f0bead301b21d4f7da49a4bc6924d07ef3) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix type errors in `typescript-operations` + under `strict: true` by widening the shared types it calls into: + - `@graphql-codegen/plugin-helpers`: `Types.ComplexPluginOutput`'s `prepend` and `append` now + accept `null` items. Core already skipped them. + - `@graphql-codegen/visitor-plugin-common`: `DeclarationBlock.withComment` accepts `undefined`, + `parseEnumValues`'s `mapOrStr` is optional (it already defaulted to `{}`), + `ImportSource.namespace` accepts `null`, and `optimizeOperations`'s `includeFragments` is + optional. + - `@graphql-codegen/typescript-operations`: skips document files without a `document`, and no + longer throws when called without the plugin info argument. + + Generated output is unchanged. + +- Updated dependencies + [[`1f7566f`](https://github.com/dotansimha/graphql-code-generator/commit/1f7566f0bead301b21d4f7da49a4bc6924d07ef3), + [`7a376ef`](https://github.com/dotansimha/graphql-code-generator/commit/7a376effc2dcb7ac8decaf53c2c18eb0e28e71e6)]: + - @graphql-codegen/visitor-plugin-common@7.2.8 + - @graphql-codegen/plugin-helpers@7.4.1 + ## 6.1.9 ### Patch Changes diff --git a/packages/plugins/typescript/operations/package.json b/packages/plugins/typescript/operations/package.json index 8aa09e2d877..5643c9cccbf 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.9", + "version": "6.1.10", "type": "module", "description": "GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments", "repository": { diff --git a/packages/plugins/typescript/typescript/CHANGELOG.md b/packages/plugins/typescript/typescript/CHANGELOG.md index c045f1abd3e..4af7ba12fec 100644 --- a/packages/plugins/typescript/typescript/CHANGELOG.md +++ b/packages/plugins/typescript/typescript/CHANGELOG.md @@ -1,5 +1,31 @@ # @graphql-codegen/typescript +## 6.1.1 + +### Patch Changes + +- [#11014](https://github.com/dotansimha/graphql-code-generator/pull/11014) + [`7a376ef`](https://github.com/dotansimha/graphql-code-generator/commit/7a376effc2dcb7ac8decaf53c2c18eb0e28e71e6) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix type errors in `typescript` under + `strict: true` by typing the shared visitor methods it overrides: + - `@graphql-codegen/visitor-plugin-common`: adds `NormalizedDeclarationKindConfig` (every + declaration kind set), used by `normalizeDeclarationKind`, `DEFAULT_DECLARATION_KINDS` and + `ParsedTypesConfig.declarationKind`. `BaseTypesVisitor`'s `NamedType`, `ListType`, + `FieldDefinition`, `InputValueDefinition` and `UnionTypeDefinition` have typed visitor params + (`key` and `parent` are required, since the visitor always passes them), and + `ObjectTypeDefinition`, `EnumTypeDefinition` and `DirectiveDefinition` may return `null`. + - `@graphql-codegen/typescript`: skips document files without a `document` when collecting + introspection types, types the `TsVisitor` visitor params, and `TsVisitor.EnumTypeDefinition` + may return `null` like the introspection visitor's override. + + Generated output is unchanged. + +- Updated dependencies + [[`1f7566f`](https://github.com/dotansimha/graphql-code-generator/commit/1f7566f0bead301b21d4f7da49a4bc6924d07ef3), + [`7a376ef`](https://github.com/dotansimha/graphql-code-generator/commit/7a376effc2dcb7ac8decaf53c2c18eb0e28e71e6)]: + - @graphql-codegen/visitor-plugin-common@7.2.8 + - @graphql-codegen/plugin-helpers@7.4.1 + ## 6.1.0 ### Minor Changes diff --git a/packages/plugins/typescript/typescript/package.json b/packages/plugins/typescript/typescript/package.json index e825031f210..0e0a95c6be6 100644 --- a/packages/plugins/typescript/typescript/package.json +++ b/packages/plugins/typescript/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/typescript", - "version": "6.1.0", + "version": "6.1.1", "type": "module", "description": "GraphQL Code Generator plugin for generating TypeScript types", "repository": { diff --git a/packages/presets/client/CHANGELOG.md b/packages/presets/client/CHANGELOG.md index b71cc2b3213..e1f86efb568 100644 --- a/packages/presets/client/CHANGELOG.md +++ b/packages/presets/client/CHANGELOG.md @@ -1,5 +1,24 @@ # @graphql-codegen/client-preset +## 6.2.1 + +### Patch Changes + +- [#10995](https://github.com/dotansimha/graphql-code-generator/pull/10995) + [`e972b6d`](https://github.com/dotansimha/graphql-code-generator/commit/e972b6d2a2a388748887d87c54fbb66617fc8f44) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix type errors under `strict: true`. The + preset now throws a clear error when `schemaAst` is missing from the preset options, and the babel + plugin throws when a file has no filename. Both cases used to crash later with a less clear error. + Generated output is unchanged. + +- Updated dependencies + [[`1f7566f`](https://github.com/dotansimha/graphql-code-generator/commit/1f7566f0bead301b21d4f7da49a4bc6924d07ef3), + [`7a376ef`](https://github.com/dotansimha/graphql-code-generator/commit/7a376effc2dcb7ac8decaf53c2c18eb0e28e71e6)]: + - @graphql-codegen/typescript-operations@6.1.10 + - @graphql-codegen/visitor-plugin-common@7.2.8 + - @graphql-codegen/plugin-helpers@7.4.1 + - @graphql-codegen/typescript@6.1.1 + ## 6.2.0 ### Minor Changes diff --git a/packages/presets/client/package.json b/packages/presets/client/package.json index 3905598d64e..dc0614af985 100644 --- a/packages/presets/client/package.json +++ b/packages/presets/client/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-codegen/client-preset", - "version": "6.2.0", + "version": "6.2.1", "type": "module", "description": "GraphQL Code Generator preset for client.", "repository": { diff --git a/packages/utils/plugins-helpers/CHANGELOG.md b/packages/utils/plugins-helpers/CHANGELOG.md index 24d0ebd308f..95fc7b47767 100644 --- a/packages/utils/plugins-helpers/CHANGELOG.md +++ b/packages/utils/plugins-helpers/CHANGELOG.md @@ -1,5 +1,24 @@ # @graphql-codegen/plugin-helpers +## 7.4.1 + +### Patch Changes + +- [#11009](https://github.com/dotansimha/graphql-code-generator/pull/11009) + [`1f7566f`](https://github.com/dotansimha/graphql-code-generator/commit/1f7566f0bead301b21d4f7da49a4bc6924d07ef3) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix type errors in `typescript-operations` + under `strict: true` by widening the shared types it calls into: + - `@graphql-codegen/plugin-helpers`: `Types.ComplexPluginOutput`'s `prepend` and `append` now + accept `null` items. Core already skipped them. + - `@graphql-codegen/visitor-plugin-common`: `DeclarationBlock.withComment` accepts `undefined`, + `parseEnumValues`'s `mapOrStr` is optional (it already defaulted to `{}`), + `ImportSource.namespace` accepts `null`, and `optimizeOperations`'s `includeFragments` is + optional. + - `@graphql-codegen/typescript-operations`: skips document files without a `document`, and no + longer throws when called without the plugin info argument. + + Generated output is unchanged. + ## 7.4.0 ### Minor Changes diff --git a/packages/utils/plugins-helpers/package.json b/packages/utils/plugins-helpers/package.json index 58afd099c7b..eed6df0751f 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.4.0", + "version": "7.4.1", "type": "module", "description": "GraphQL Code Generator common utils and types", "repository": {