T
TanStack15mo ago
harsh-harlequin

Refetch after invalidate doesn't respect the enabled false

In react query v5 I'm facing the same problem described here https://github.com/TanStack/query/issues/1965. After a mutation I'm calling the query invalidation function with refetch type 'all' and it is calling the queryFn even if it's disabled. it is someone else facing the same issue?
4 Replies
deep-jade
deep-jade15mo ago
GitHub
query/packages/query-core/src/queryClient.ts at 79e52029975d8a889ff...
🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query. - TanStack/query
harsh-harlequin
harsh-harlequinOP15mo ago
I'm using the version 5.45.1, and please check this video, I have a disabled query and the query it's being refetched after I ran an invalidation
harsh-harlequin
harsh-harlequinOP15mo ago
I'm doing the invalidation and the refetch in this way: queryClient.invalidateQueries({ queryKey: organizationsQueryKeys.all, refetchType: 'all' }); Maybe I'm lost, but if a query is disabled if has 0 observers and is not active, how the refetchType works if we set the value to inactive?
deep-jade
deep-jade15mo ago
Please shown a minimal reproduction

Did you find this page helpful?