TanStackT
TanStack2y ago
11 replies
managerial-maroon

Difference between a query function returning undefined and a query function throwing an error

I had expected after v4 that returning undefined has the same behavior as throwing an error since undefined won't get added to the cache but in practice it seems like returning an error results in the query function being called far more often. What exactly is happening here?
Was this page helpful?