@jgan42 @CaptainStiggz You may want to switch back to fetchPolicy: "cache-first"
after the initial request, since network-only
will always go to the network, hence the extra network requests. To to that, use nextFetchPolicy
:
#8514
Labels
@jgan42 @CaptainStiggz You may want to switch back to
fetchPolicy: "cache-first"
after the initial request, sincenetwork-only
will always go to the network, hence the extra network requests. To to that, usenextFetchPolicy
:Originally posted by @benjamn in #7307 (comment)
I've used this throughout my product which is close to completion. I've realised now though that if a subsequent query fails then it uses the cache result.
In short how does one use apollo js to execute queries without ever involving the cache? Live data components must be one of the most common use cases of a graphql client surely. I'm a little surprised at how difficult this seems to be to achieve in apollo. Would be delighted to be told I've not understand something though and it is in fact easy.
***UPDATE ***
I've tried "no-cache" for both policies and it causes two network queries where the second is a duplicate of the very first query. So I'm stuck.
Is client.query the better way forward may be?
The text was updated successfully, but these errors were encountered: