urql: (graphcache) Query is not updated after cache update
Describe the bug
Since graphcache v5.0.2 seems that queries with requestPolicy: "network-only" are no longer updated as before.
Example
Query:
notes {
id
status # e.g. TODO
}
Mutation:
completeNote(id: 1, status: COMPLETED) {
id
status
}
After mutation, I see that cache is updated with status: COMPLETED, but query is not updated (to trigger React component rerender).
In graphcache v5.0.1 queries are updated even with requestPolicy: "network-only".
Reproduction
Urql version
@urql/exchange-graphcache v5.0.2 (5.0.1 works fine) urql v.3.0.3
Validations
- I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
- Read the docs.
- Follow our Code of Conduct
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (2 by maintainers)
Damn, @Nickersoft you’re right - I spent decent amount of time trying reproduce this on codesandbox, but failed 😕.
In the app I’m working on, the data models are more complex of course, but couldn’t find a reason why it fails there, but not on codesandbox.