Skip to content

fix: visitor-plugin-common: generateImportStatement emits invalid import * from '...'#10882

Open
wassim-k wants to merge 1 commit into
dotansimha:masterfrom
wassim-k:fix/empty-import-statement
Open

fix: visitor-plugin-common: generateImportStatement emits invalid import * from '...'#10882
wassim-k wants to merge 1 commit into
dotansimha:masterfrom
wassim-k:fix/empty-import-statement

Conversation

@wassim-k

Copy link
Copy Markdown
Contributor

Description

When an import has no named identifiers, generateImportStatement falls back to *, producing import * from '...' — a namespace import with no binding (invalid TS). Hit when a document-only fragment import (kind: 'document') is rendered in type mode, e.g. typescript-operations + inlineFragmentTypes: 'combine' | 'mask'.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Run tests in the codebase and ran it against a large codebase with the near-operation-file preset mentioned below.

Test Environment:

  • OS: Windows
  • @graphql-codegen/visitor-plugin-common:
  • NodeJS: v24.18.0

Further comments

This issue is blocking graphql-code-generator-community/pull/1530

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 71f7c76

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/visitor-plugin-common Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant