Skip to content

Add import util for typed-document-string helper#10865

Merged
eddeee888 merged 2 commits into
masterfrom
enrich-typed-document-string
Jun 1, 2026
Merged

Add import util for typed-document-string helper#10865
eddeee888 merged 2 commits into
masterfrom
enrich-typed-document-string

Conversation

@eddeee888

@eddeee888 eddeee888 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Continuation of #10863

After trying the alpha version locally, I realised client plugins would need to generate an import statement to this effect:

this._generateImport(
  {
    moduleName: '@graphql-typed-document-node/core',
    propName: 'DocumentTypeDecoration',
  },
  'DocumentTypeDecoration',
  true,
)

So this PR improves the utility:

  • Makes typedDocumentString an object
  • Adds typedDocumentString.template to replace typedDocumentStringTemplate
  • Adds typedDocumentString.import to help creating import statements

@changeset-bot

changeset-bot Bot commented Jun 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 44e7436

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 2 packages
Name Type
@graphql-codegen/typed-document-node Patch
@graphql-codegen/visitor-plugin-common Minor

Click here to learn what changesets are, and how to add one.

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

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-codegen/visitor-plugin-common 7.1.0-alpha-20260601150944-44e7436d06cd549e9e499f9f644f17de11d74663 npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 7.0.3-alpha-20260601150944-44e7436d06cd549e9e499f9f644f17de11d74663 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

💻 Website Preview

The latest changes are available as preview in: https://pr-10865.graphql-code-generator.pages.dev

@eddeee888 eddeee888 merged commit 99ce1a9 into master Jun 1, 2026
18 checks passed
@eddeee888 eddeee888 deleted the enrich-typed-document-string branch June 1, 2026 15:17
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