score:1

Accepted answer

i think react-query will wrap the result in a promise anyways, so you can do:

usequery(key, () => "foo")

as well. in your example, just be aware that data can then be undefined. it might be better to disable the query in this case:

useinfinitequery(['test', a, b], fetchtest, { enabled: b !== 3 })

Related Query

More Query from same tag