How to refetch data in useInfiniteQuery() - react query?
I have a list of items and I'm using
current behavior:
using
it replaces the prev data with the re-fetched data on the current page.
using
it replaces the prev data with current page data without the updated data
Actually, it sends a request for the next page "that doesn't exist"
So how can i re-fetch the data and keep the previous data?
useInfiniteQuery for pagination stuff, So I have a case where I can edit Item info and then re-fetch the list again to get the updated list of items, current behavior:
using
queryClient.refetchQueriesit replaces the prev data with the re-fetched data on the current page.
await queryClient.refetchQueries(['getUsualOrders'], {
stale: true,
});using
refetch.it replaces the prev data with current page data without the updated data
Actually, it sends a request for the next page "that doesn't exist"
So how can i re-fetch the data and keep the previous data?