Is there a better way to manually setError on a query? #1295
-
I was messing around the query object and found a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
can you elaborate a bit what your use-case would be? Why do you manually need to set it to error? |
Beta Was this translation helpful? Give feedback.
-
It's a bit odd i know, but is a kind-of-authorization flow with the first request is given an error and the next request (this one that "resolves" the authorization) return the result of the first. So my solution was something like "hold" error state of the first request, make the second, and resolve or reject in case of a new error, the first one. I make this with another library (digging the code and use undocumented features) so was think in addressing this first before "full switch" to react-query. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
It's a bit odd i know, but is a kind-of-authorization flow with the first request is given an error and the next request (this one that "resolves" the authorization) return the result of the first. So my solution was something like "hold" error state of the first request, make the second, and resolve or reject in case of a new error, the first one. I make this with another library (digging the code and use undocumented features) so was think in addressing this first before "full switch" to react-query.