0

I'm using the React Query framework. Would it be possible to have useQuery return the content of the cache for a resource that was previously fetched but now came back with a 4** or 5** http status?

The idea would be to avoid showing no data or errors when the network (or server) is flaky for a moment.

1 Answer 1

1

Definitely, that should work out of the box. If you once got successful data for a query and then get another error, status should be error and both the error and data fields should be filled (data with the stale data from the previous fetch)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.