T
TanStack2y ago
other-emerald

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
compatible-crimson
compatible-crimson2y 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
other-emerald
other-emeraldOP2y 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
other-emerald
other-emeraldOP2y 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?
compatible-crimson
compatible-crimson2y ago
Please shown a minimal reproduction

Did you find this page helpful?