Skip to content
Discussion options

You must be logged in to vote

invalidateQueries will make sure that every feed that matches the passed key is either refetched immediately (if used on the screen), or marked as stale so that it will be refetched when it is used the next time. So if you invalidate all list, and then go back to list1, that one will be refetched. If you go to list2, that will be refetched.

You can also manually update all feeds in the onSuccess callback if one of the feeds fetches with queryClient.setQueriesData, but I don't think it's necessary.

If you're looking for something more automatic, you basically want something like a normalized cache, where you also need a schema, which is something that react-query does not require, thus it …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pretoricum2
Comment options

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