Replies: 2 comments 6 replies
-
disabled queries can only refetch in two ways:
That is per design. Why is your query disabled? |
Beta Was this translation helpful? Give feedback.
6 replies
-
I spent a lot of time and my infiniteQuery wasn't being invalidated and or refetched via queryClient. But, in the end, reading this, I could to understand if the query is enabled: false, it's impossible achieve this, except following the steps mentioned above. Thanks for the explanation, @TkDodo . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am having some infinite query list and i am trying to delete one item from that list , after that i am calling invalidate query still it is not calling.
fetching list:
const { data, isLoading, isError, hasNextPage, fetchNextPage } =
useInfiniteQuery("posts", fetchPosts, {
refetchOnMount: false,
refetchOnWindowFocus: false,
enabled:false,
getNextPageParam: (lastPage, pages) => {
if (lastPage.nextPage < lastPage.totalPages) return lastPage.nextPage;
return undefined;
},
});
delete item:
const mutation = useMutation(deleteItem, {
onSuccess: () => {
queryClient.invalidateQueries('posts')
},
})
not refreshing list
Beta Was this translation helpful? Give feedback.
All reactions