Trying to understand the 'Magic' #988
-
Using Svelte. I've setup a query to return 'all items' (accepts no variables) and a mutation to 'add item'. When I add an item, the query to return all items automagically runs and the data is updated! While this is very cool, I can't reason how and why this is happening! How does urql decide which queries to re-run and when? Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There's a little explainer here actually ✨ https://formidable.com/open-source/urql/docs/basics/document-caching/ The default logic reruns queries if your mutation touches any of the same types that the query has seen before. |
Beta Was this translation helpful? Give feedback.
There's a little explainer here actually ✨ https://formidable.com/open-source/urql/docs/basics/document-caching/
The default logic reruns queries if your mutation touches any of the same types that the query has seen before.