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
With graphQL it's possible the response could be partially successful. With the way the client is currently configured, it's parsing the errors property and returning an error with the first error in the array if it's not empty.
Would you be open to a PR that instead passes the entire response? This would allow the caller to decide how it wants to handle the returned errors. We're also currently losing additional error context if more than one error is present.
The text was updated successfully, but these errors were encountered:
I think the default behaviour should be to pull out the first error as it does today (it's simpler and what most people need), but I'm not against adding the complete response as an option.
I think the API should be something like this:
err := client.Run(ctx, req, &resp)
if err != nil {
resp, ok := graphql.Response(err)
if ok {
// TODO: use the complete resp here
}
}
With graphQL it's possible the response could be partially successful. With the way the client is currently configured, it's parsing the errors property and returning an error with the first error in the array if it's not empty.
Would you be open to a PR that instead passes the entire response? This would allow the caller to decide how it wants to handle the returned errors. We're also currently losing additional error context if more than one error is present.
The text was updated successfully, but these errors were encountered: