Replies: 1 comment 1 reply
-
query/packages/query-core/src/queryClient.ts Lines 598 to 603 in edec4a6
If I understand this correctly, we could achieve this by simplifying the condition?
? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've read #7057 and it still seems to me that
skipToken
should be able to overrideenabled: true
. The reply doesn't really explain why that behavior is either not possible or undesirable.We have the same use case that @averageokguy had: One file defines the queries using
queryOptions
. In this file, we useskipToken
to determine when a query can possibly run:In our components, we may have additional restrictions on when we want the query to run. For example, maybe we have a "Show more by this author" that shows more of this author's posts. I'd like to handle it by using
enabled
:My intention here is that the query cannot run if
queryFn
resolves toskipToken
. It would only run if bothqueryFn
is a function andenabled
is true/undefined.I think throwing on
refetch
is reasonable if thequeryFn
isskipToken
, but it seems like{ queryFn: skipToken, enabled: true }
should be allowed and handled as a disabled query.Beta Was this translation helpful? Give feedback.
All reactions