Closed broyde closed 6 months ago
Hey @broyde 👋
Thanks for the report! Initially the @nonreactive
directive was meant for use with queries, not fragments, but we talked about this more as a team and think this change makes sense. We re-read through our docs and realized that its a bit ambiguous on the original intention so we plan to make a temporary docs update until we can get this functionality in place.
We are releasing 3.10 this week and will try and target this change for one of the 3.10.x patch releases.
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.
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.
Issue Description
@nonreactive
field, write some data into the cache.useFragment
.@nonreactive
field.Expected behavior:
useFragment
does not react to such changes. Actual behavior:useFragment
triggers update in the same way as it does without@nonreactive
directive. Test example: https://github.com/broyde/apollo-use-fragment-nonreactive/blob/main/test.jsFYI: I've noticed the same behavior of
useQuery
, but only in test environment (see test: https://github.com/broyde/apollo-query-nonreactive/blob/main/test.js). In real browseruseQuery
does not react to such changes, butuseFragment
does.Link to Reproduction
https://github.com/broyde/apollo-use-fragment-nonreactive
Reproduction Steps
No response
@apollo/client
version3.9.11