diff --git a/.changeset/petite-sides-change.md b/.changeset/petite-sides-change.md deleted file mode 100644 index 22a1e1579f4..00000000000 --- a/.changeset/petite-sides-change.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@graphql-codegen/visitor-plugin-common': patch -'@graphql-codegen/typescript-operations': patch ---- - -Fix conditional directive (`@skip` and `@include`) incorrectly drop fields in Result when used on -Inline Fragment / Fragment Spread diff --git a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md index 6eb4b0c2a41..f241a1e0426 100644 --- a/packages/plugins/other/visitor-plugin-common/CHANGELOG.md +++ b/packages/plugins/other/visitor-plugin-common/CHANGELOG.md @@ -1,5 +1,19 @@ # @graphql-codegen/visitor-plugin-common +## 7.2.2 + +### Patch Changes + +- [#10882](https://github.com/dotansimha/graphql-code-generator/pull/10882) + [`206a409`](https://github.com/dotansimha/graphql-code-generator/commit/206a409736f934ab9d317482b761fa0c8bbf0d77) + Thanks [@wassim-k](https://github.com/wassim-k)! - Avoid emitting an empty import statement + (`import '...';`) when an import source has no identifiers and no namespace. + +- [#10899](https://github.com/dotansimha/graphql-code-generator/pull/10899) + [`e7a1451`](https://github.com/dotansimha/graphql-code-generator/commit/e7a1451bb2ccf201c61ebc9cc83a46740b5d1be9) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix conditional directive (`@skip` and + `@include`) incorrectly drop fields in Result when used on Inline Fragment / Fragment Spread + ## 7.2.1 ### Patch Changes diff --git a/packages/plugins/other/visitor-plugin-common/package.json b/packages/plugins/other/visitor-plugin-common/package.json index 8970776f97f..6b18f255dff 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.1", + "version": "7.2.2", "type": "module", "repository": { "type": "git", diff --git a/packages/plugins/other/visitor-plugin-common/src/imports.ts b/packages/plugins/other/visitor-plugin-common/src/imports.ts index 8ac5fc27254..2d506d6f423 100644 --- a/packages/plugins/other/visitor-plugin-common/src/imports.ts +++ b/packages/plugins/other/visitor-plugin-common/src/imports.ts @@ -55,6 +55,10 @@ export function generateFragmentImportStatement( export function generateImportStatement(statement: ImportDeclaration): string { const { baseDir, importSource, outputPath, typesImport } = statement; + + if (!importSource.identifiers?.length && !importSource.namespace) { + return ''; + } const importPath = resolveImportPath(baseDir, outputPath, importSource.path); const importNames = importSource.identifiers?.length ? `{ ${Array.from(new Set(importSource.identifiers)).join(', ')} }` diff --git a/packages/plugins/typescript/operations/CHANGELOG.md b/packages/plugins/typescript/operations/CHANGELOG.md index 07b14b38e93..16cac79e86b 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.2 + +### Patch Changes + +- [#10899](https://github.com/dotansimha/graphql-code-generator/pull/10899) + [`e7a1451`](https://github.com/dotansimha/graphql-code-generator/commit/e7a1451bb2ccf201c61ebc9cc83a46740b5d1be9) + Thanks [@eddeee888](https://github.com/eddeee888)! - Fix conditional directive (`@skip` and + `@include`) incorrectly drop fields in Result when used on Inline Fragment / Fragment Spread +- Updated dependencies + [[`206a409`](https://github.com/dotansimha/graphql-code-generator/commit/206a409736f934ab9d317482b761fa0c8bbf0d77), + [`e7a1451`](https://github.com/dotansimha/graphql-code-generator/commit/e7a1451bb2ccf201c61ebc9cc83a46740b5d1be9)]: + - @graphql-codegen/visitor-plugin-common@7.2.2 + ## 6.1.1 ### Patch Changes diff --git a/packages/plugins/typescript/operations/package.json b/packages/plugins/typescript/operations/package.json index 2bcad328f66..157b48c4c4f 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.1", + "version": "6.1.2", "type": "module", "description": "GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments", "repository": {