-
Notifications
You must be signed in to change notification settings - Fork 310
Description
Screenshot
Description
Version is 6.1.0
.
Also tried 7.1.2
but that one would always throw an internal error and then return null
. Here's an image of the internal error:
I want to handle the errors
property from the response without having to wrap everything in a try-catch and detecting whether the error is from graphql-request
or not (to see if I can convert it back into an object with the errors
property and stop the error propagation). Sadly, setting errorPolicy
to either 'ignore'
or 'all'
does not seem to prevent the error from being thrown.
Am I misunderstanding the use case for errorPolicy
?
Also what is the rawRequest
method which is referenced in the docs for errorPolicy: 'all'
but not described anywhere? I did try it but it did not seem to change anything
Reproduction Steps/Repo Link
- create an instance of
GraphQLClient
with eithererrorPolicy: 'ignore'
orerrorPolicy: 'all'
(I also have have theAuthorization
header set via theheaders
option) - make a request that would return a
200
status with theerrors
property in the response body
Expected: the response is returned and it contains the expected errors
property
Actual: an error is thrown, like in the first image from above, which has a property named response
which is an object with the expected errors
property