urql
urql copied to clipboard
Offline exchange: separate queries on same nullable object causes infinite network requests
Describe the bug
There is an edge case which causes the offlineExchange to infinitely send network request.
This occurs when calling multiple useQuery hooks with different queries for different data on the same nullable object. Additionally the bug only occurs when the api returns null for the object but does not occur if the root data is null
This bug only occurs when using the offlineExchange.
Please see the repro source code and server source code for further context. Client: https://github.com/seanaye/urql-offline-repro Server: https://github.com/seanaye/api-repro/tree/master
Reproduction
https://stackblitz.com/github/seanaye/urql-offline-repro
Please don't leave this page open too long it spams my server lol
Urql version
Urql 3.0.3 @urql/exchange-graphcache 5.0.1
Validations
- [X] 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
- [X] Read the docs.
- [X] Follow our Code of Conduct