Skip to content

Error handling with fakeBaseQuery (RTK Query streaming updates) #4993

Answered by markerikson
morzel85 asked this question in Q&A
Discussion options

You must be logged in to vote

The short answer is that RTK Query is meant to track the status of a promise and cache its result. The lifecycle methods let you kick off additional side effect logic, but essentially anything you do in there is then outside the scope of RTK Query's cache entry.

So, while RTKQ gives you space to write additional logic, any status you would want to track regarding some external connection would need to be handled separately yourself.

Beyond that, we don't currently have a way to force a cache entry to have an errored status.

(for the OP's specific mention of updateCachedData, I'm not sure how that factors in here as far as errors.)

Replies: 2 comments 3 replies

This comment was marked as spam.

@EskiMojo14
Comment options

Comment options

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

Answer selected by morzel85
@morzel85
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants