Skip to content

Manual cache invalidation? #998

Answered by kitten
kasrak asked this question in Q&A
Sep 23, 2020 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Hiya 👋

Typically for invalidation we’d recommend a cache.invalidate call in a custom updater: https://formidable.com/open-source/urql/docs/graphcache/custom-updates/#cacheinvalidate

Updaters can be used to update a list without a network round trip as this page shows, but you can also use cache.inspectFields to get more information on some listing fields and invalidate them, which will cause a refetch automatically of queries that contain invalidated entities and fields.

So for instance if you invalidate Query.jobs(...) from a Mutation.addJob(...) update, then Graphcache recognises that your query will had some of the data it depends on changed, and will issue a refetch automatically. Sin…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by JoviDeCroock
Comment options

You must be logged in to vote
4 replies
@JoviDeCroock
Comment options

@nil1511
Comment options

@JoviDeCroock
Comment options

@nil1511
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants