You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call refetch and if the API returns an error, both data and error don’t update. error is null, and data holds the values from the last successful fetch. Although, the promise returned from refetch rejects with the error. Is that the intended behavior? If so, how do I get data to clear when the api returns an error?
Intended outcome:
I would expect data to be null and error to contain the error.
Actual outcome: data and error contain the values from the previous fetch.
How to reproduce the issue:
Try a query like the above, API should return a successful result on the first run, and should return an error on the second run. Second run should be triggered by refetch
Hi @viduli-prime 👋🏻 thanks for your patience! This appears to be similar to #8833 so next time we take a fresh look at refetch we'll keep this issue in mind. Again, we really appreciate your patience!
I have a query like this,
When I call
refetch
and if the API returns an error, bothdata
anderror
don’t update.error
is null, anddata
holds the values from the last successful fetch. Although, the promise returned fromrefetch
rejects with the error. Is that the intended behavior? If so, how do I get data to clear when the api returns an error?Intended outcome:
I would expect
data
to benull
anderror
to contain the error.Actual outcome:
data
anderror
contain the values from the previous fetch.How to reproduce the issue:
Try a query like the above, API should return a successful result on the first run, and should return an error on the second run. Second run should be triggered by
refetch
Versions
The text was updated successfully, but these errors were encountered: