apollographql / apollo-client

:rocket:  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
https://apollographql.com/client
MIT License
19.32k stars 2.65k forks source link

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

Closed dragozin closed 1 month ago

dragozin commented 2 months ago

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 commented 2 months ago

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/client@0.0.0-pr-11926-20240704151615
dragozin commented 2 months ago

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!

github-actions[bot] commented 1 month ago

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

github-actions[bot] commented 2 weeks ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.