Successfully added
React
by Patrik
How to Invalidate an Infinite Query?
Question: For me, if I invalidate the query, only the last page gets refetched and rendered. I want to fetch all of the pages
Solution: queryCache.clear()
does the trick for me
Additional resources:
- How to clear the entire cache storage? · TanStack/query · Discussion #3280 (github.com)
- javascript - React query: invalidate multiple queries but wait until they all finished on mutation success - Stack Overflow
- React Query useInfiniteQuery invalidate individual items · TanStack/query · Discussion #1866 (github.com)
Referenced in:
Comments