Skip to content

[typescript-rtk-query][typescript-react-query] Handle TypedDocumentString type wireup to avoid manual typing#1506

Merged
eddeee888 merged 5 commits into
mainfrom
override-types-rtk
Jun 13, 2026
Merged

[typescript-rtk-query][typescript-react-query] Handle TypedDocumentString type wireup to avoid manual typing#1506
eddeee888 merged 5 commits into
mainfrom
override-types-rtk

Conversation

@eddeee888

@eddeee888 eddeee888 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Description

Continuation of #1496 and #1497
After releasing, I realised the type may not work because the integration requires string | DocumentNode instead of TypedDocumentNode

This PR:

  • for typescript-rtk-query: fixes it by typecasting the document as string whilst keeping the original TypedDocumentNode as-is, for correct typing at declaration.
  • for typescript-react-query: wire up TypedDocumentNode instead of string into generated functions

Related #1410 (comment)

Type of change

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

@changeset-bot

changeset-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8b7d9c3

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

This PR includes changesets to release 2 packages
Name Type
@graphql-codegen/typescript-react-query Patch
@graphql-codegen/typescript-rtk-query 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

Repository owner deleted a comment from github-actions Bot Jun 10, 2026
@github-actions

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/typescript-react-query 7.0.3-alpha-20260610135825-8b7d9c3d55b62f61d82d191f2ace7f9d8c700a60 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-rtk-query 4.0.3-alpha-20260610135825-8b7d9c3d55b62f61d82d191f2ace7f9d8c700a60 npm ↗︎ unpkg ↗︎

@eddeee888 eddeee888 changed the title [typescript-rtk-query] Force as string in api wireup to avoid manual typing [typescript-rtk-query][typescript-react-query] Handle TypedDocumentString type wireup to avoid manual typing Jun 10, 2026
@eddeee888 eddeee888 merged commit bebe34b into main Jun 13, 2026
15 checks passed
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