You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
urql v3 differs from v2 when using requestPolicy: cache-and-networkas documented:
The cache-and-network policy is particularly useful, since it allows us to display data instantly if it has been cached, but also refreshes data in our cache in the background. This means though that fetching will be false for cached results although an API request may still be ongoing in the background.
In the repro, urql v2 correctly performs a request every time Todos is displayed after toggling, whereas urql v3 doesn't.
Turns out this was a simple oversight in the interaction between react-urql and the Client.
I also want to take this opportunity to "advertise" that while we never anywhere call this out explicitly that setting a default policy of cache-and-network has a couple of drawbacks, mainly however, that it will lead to excessive network requests, obviously.
That's why instead, we'd recommend to only switch to it depending on the TTL with the requestPolicyExchange: https://formidable.com/open-source/urql/docs/api/request-policy-exchange/
Describe the bug
urql v3 differs from v2 when using
requestPolicy: cache-and-network
as documented:In the repro, urql v2 correctly performs a request every time Todos is displayed after toggling, whereas urql v3 doesn't.
Reproduction
https://codesandbox.io/s/async-flower-cspnze?file=/src/index.js
Urql version
urql v3.0.0
Validations
The text was updated successfully, but these errors were encountered: