Closed
Description
Describe the bug
queryClient.invalidateQueries(queryKey, { refetchInactive: true, })
also refetches disabled queries (enabled
: false)
but - #947 (comment)
looks like this issue was introduce in this commit - f5ae636
Your minimal, reproducible example
https://codesandbox.io/s/quiet-dust-hegny?file=/src/App.js
Steps to reproduce
- Create a query with
useQuery
and setenabled
option to false. - Invalidate this query with
invalidateQueries
and setrefetchInactive
to true
Expected behavior
I expected that disabled queries (enabled: false
) would not refetch when I use invalidateQueries
Platform
- OS: macOs
- Browser: Not related
react-query version
v3.34.8
TypeScript version
v4.2.2