How to setup automatic invalidation after mutation
I want to setup a remix like automatic invalidation.
I saw this post from TkDodo: https://tkdodo.eu/blog/automatic-query-invalidation-after-mutations#the-global-cache-callbacks
But I am having trouble understanding how is solution is possible.
We cannot use
Do I need to create a second one above juste to configure correctly the MutationCache ?
Thx.
I saw this post from TkDodo: https://tkdodo.eu/blog/automatic-query-invalidation-after-mutations#the-global-cache-callbacks
But I am having trouble understanding how is solution is possible.
We cannot use
queryClient inside its own declaration.Do I need to create a second one above juste to configure correctly the MutationCache ?
Thx.
Even though there is nothing built into React Query, it doesn't need a lot of code to implement automatic query invalidation in user-land thanks to the global cache callbacks.
