Skip to content
Discussion options

You must be logged in to vote

queries that are in error state will not be persisted per default, because errors are not serializable. If you get a background refetch error, your query will be in the following state:

status: 'error'
error: YourErrorHere
data: YourStaleDataHere

if we were to persist that, error would probably become null because it can't be serialized to JSON. Then, if you restore again, you state would be:

status: 'error'
error: null
data: YourStaleDataHere

However, status:error is defined as "A Query with an error", so you should be able to access error.message - but this will error at runtime in this scenario.

So, long story short, per default, you can't. You can overwrite our default persistence b…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mitioshi
Comment options

@TkDodo
Comment options

Answer selected by mitioshi
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