Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixes Unknown Fragment issues due to GraphQL Tag type mismatch in web #10357

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changesets/young-spiders-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- PR title (#PR number) by @PR author

fix: Fixes Unknown Fragment issues due to GraphQL Tag type mismatch in web (#10357) by @dthyresson

Users reported in #10322 an incompatibility with fragments and when using gql from global web. The TS errors were caused by the global web gql type not being compatible with the standard graphql-tag type.
5 changes: 4 additions & 1 deletion packages/web/src/global.web-auto-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ declare global {
// typed just by importing gql from `graphql-tag`. But for Trusted Documents
// the type should be imported from `web/src/graphql/gql` in the user's
// project. The type here is generic enough to cover both cases.
const gql: (source: string | TemplateStringsArray) => DocumentNode
const gql: (
source: string | TemplateStringsArray | readonly string[],
...args: any[]
) => DocumentNode

// Having this as a type instead of a const allows us to augment/override it
// in other packages
Expand Down
Loading