Refetch all the queries on mutation
I am wondering how should I make this work
I wanna basically refetch all these queries after my mutation completes (for all)
5 Replies
fascinating-indigoOP•3y ago
the only option I am seeing is refetching indiviually after success of each mutation
wise-white•3y ago
Hi. For such a usecase you should invalidate queries using the queryClient invalidateQueries method.
fascinating-indigoOP•3y ago
Mhm but wouldnt that invalidate all the queries?
wise-white•3y ago
All the queries matching the queryKey you pass to invalidateQueries
fascinating-indigoOP•3y ago
yea I guess that's the only option