Alternative to "skipToken" #11370
|
I'm following query.gg and the docs and I'm a bit confused regarding Are there ay reasons to not do this instead?: Similar to Follow up question: is |
Replies: 1 comment 1 reply
You can do that, but closing over
throwing is safe, we’ll transform that to a failed promise internally. the use-case that so that you then can call However, this pattern (a permanently disabled observer) is discouraged. There are usually better ways to achieve what you want, like Lazy Queries. |
You can do that, but closing over
enabledmeans it should technically go into the queryKey, at least that’s what the lint rules will tell you. But this will also throw if you callrefetch()whileenabledisfalse, same asskipToken, so it doesn’t achieve anything really.throwing is safe, we’ll transform that to a failed promise internally.
the use-case that
enabledcovers thatskipTokendoes not is a permanently disabled query:so that you then can call
refetch()to t…