Replies: 1 comment 7 replies
-
I'm moving this to a discussion since I think you're just trying to achieve something with enabled: false + different queryFns that shouldn't really be necessary. Maybe we can help if you can outline what problem you're actually trying to solve? |
Beta Was this translation helpful? Give feedback.
7 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I found a issue regarding shard queryKeys and errors within queryFn's.
If you run one useQuery which causes an error, all other queries will also be running and even ignoring the
enabled: false
state.I don't know, how this would even work, if both queries will result without error? I think, it don't make sense at all, that queryFn are running for errors of other queryFn.
So there might be multiple issues to solve here...
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/practical-morse-s8xjcc?file=%2Fsrc%2FApp.js%3A40%2C6
Steps to reproduce
false true Error: error
false true Error: Missing queryFn: '["key"]'
Missing queryFn: '["key"]'
if you provide thisqueryFn
then it will be executed ???Expected behavior
enabled
state if multiple useQuery share the same keyHow often does this bug happen?
Every time
Screenshots or Videos
Platform
Windows
Tanstack Query adapter
react-query
TanStack Query version
5.28.14
TypeScript version
5*
Additional context
I just want to grab the shared variables
Beta Was this translation helpful? Give feedback.
All reactions