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
It seems to me that the default response handler for fetchBaseQuery is "json". As far as I can tell, this is equivalent to parsing the response as text, and then doing JSON.parse on the text after checking its' length. This is not really documented properly anywhere to my knowledge, I figured it out by scanning through the source code.
My original assumption was that the default response handler was async (res) => await res.json()
When implementing a wrapper response handler it's a bit cumbersome and hard to figure out that what I need to actually reimplement to mirror the behavior is this:
It seems to me that the default response handler for
fetchBaseQuery
is"json"
. As far as I can tell, this is equivalent to parsing the response as text, and then doingJSON.parse
on the text after checking its' length. This is not really documented properly anywhere to my knowledge, I figured it out by scanning through the source code.My original assumption was that the default response handler was
async (res) => await res.json()
When implementing a wrapper response handler it's a bit cumbersome and hard to figure out that what I need to actually reimplement to mirror the behavior is this:
I suggest exporting the above function as a
defaultResponseHandler
, so that wrappers can be easily created as such:The text was updated successfully, but these errors were encountered: