Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

how to verify if the response comes from the cache or from the network? #74

Open
yidongw opened this issue Sep 25, 2023 · 1 comment
Open

Comments

@yidongw
Copy link

yidongw commented Sep 25, 2023

after creating the ApolloClient with the cache from apollo-cache-policies, I don't know how to verify if the cache ttl is actually working.

Can anyone share how to verify it?

@danReynolds
Copy link
Collaborator

Yea so you can check the networkStatus field returned in your code returned by the client fetch alongside the data response. Talks about it here: https://www.apollographql.com/docs/react/data/queries/#inspecting-loading-states

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants