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

useFragment throws an error when a fragment has the @include directive #11924

Open
dragozin opened this issue Jul 4, 2024 · 2 comments · Fixed by #11926
Open

useFragment throws an error when a fragment has the @include directive #11924

dragozin opened this issue Jul 4, 2024 · 2 comments · Fixed by #11926
Labels

Comments

@dragozin
Copy link
Contributor

dragozin commented Jul 4, 2024

Issue Description

If I use a fragment with the @include directive useFragment react hook throws an error Invalid variable referenced in @include directive.

Link to Reproduction

https://codesandbox.io/p/sandbox/apollo-client-bug-5xym9k

Reproduction Steps

No response

@apollo/client version

3.10.8

@phryneas
Copy link
Member

phryneas commented Jul 4, 2024

Thank you for the report - I've opened a PR with (hopefully) a fix.
Could you please give this build a try and report back if it solves your problem?

npm i @apollo/[email protected]

@dragozin
Copy link
Contributor Author

dragozin commented Jul 5, 2024

Could you please give this build a try and report back if it solves your problem?

Hello! Thank you for the quick fix! Yes, it helps!

@phryneas phryneas linked a pull request Jul 5, 2024 that will close this issue
alessbell added a commit that referenced this issue Jul 10, 2024
* `watchFragment`: forward additional options to `diffOptions`
fixes #11924

* chore: bump .size-limits.json

* chore: bump .size-limits.json

* Clean up Prettier, Size-limit, and Api-Extractor

---------

Co-authored-by: Alessia Bellisario <[email protected]>
Co-authored-by: alessbell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants