Skip to content

Type narrowing when using skipToken #9578

Answered by TkDodo
xsjcTony asked this question in Q&A
Discussion options

You must be logged in to vote

you need to pass the skipToken to the queryFn, not return a skipToken from the queryFn. This will also not stop execution at runtime.

queryFn: Math.random() > 0.5 ? () => ({ foo: 'bar' }) : skipToken,

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xsjcTony
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants