You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by ktriviso February 7, 2025
Hi, my React app is using both useQuery and useInfiniteQuery. When using react-query-devtools, I can see the cache is being set and cleared with no issues for queries that used useQuery to fetch the data. But any data fetched using useInfiniteQuery is not setting the cache and I am not able to use invalidateQueries to clear it either. We were previously using a SUPER old version of React query (not Tanstack) and this pattern was working.
I have tried various different solutions with no luck. Below is the exact scenario I am trying to solve for and my current implementation.
Scenario:
Query list of orders. In a modal, delete an order and invalidate the query so that it refreshes and the list of orders does not contain the deleted order. Important to note, the modal does not have access to the useInfiniteQuery refetch method.
Current code:
List page - using this solution, I can see the cache is set in react-query-devtools but it's inactive
Discussed in #8616
Originally posted by ktriviso February 7, 2025
Hi, my React app is using both useQuery and useInfiniteQuery. When using react-query-devtools, I can see the cache is being set and cleared with no issues for queries that used useQuery to fetch the data. But any data fetched using useInfiniteQuery is not setting the cache and I am not able to use invalidateQueries to clear it either. We were previously using a SUPER old version of React query (not Tanstack) and this pattern was working.
I have tried various different solutions with no luck. Below is the exact scenario I am trying to solve for and my current implementation.
Scenario:
Query list of orders. In a modal, delete an order and invalidate the query so that it refreshes and the list of orders does not contain the deleted order. Important to note, the modal does not have access to the useInfiniteQuery refetch method.
Current code:
List page - using this solution, I can see the cache is set in react-query-devtools but it's inactive
Delete modal
The text was updated successfully, but these errors were encountered: