Exposes the error as graphql.Error and returns error details in case they are present in the error response.
The user should assert the error type:
err := cli.Run(...)
if errs, ok := err.(graphql.Errors); ok {
// Range over errs
}
// or with go 1.13
var errs graphql.Errors
if errors.As(err, errs) {
// Range over errs
}
Included:
message: As before
locations: Locations in the query that caused errors
paths: Response paths that returned errors
extensions: Optional extensions set by the server. The spec specified it's a map but nothing more.
https://github.com/machinebox/graphql/pull/37 - This PR also prints multiple returned errors (slightly different format) and also allows inspecting the errors for additional values (locations, path, extensions)
Exposes the error as
graphql.Error
and returns error details in case they are present in the error response.The user should assert the error type:
Included:
message
: As beforelocations
: Locations in the query that caused errorspaths
: Response paths that returned errorsextensions
: Optional extensions set by the server. The spec specified it's a map but nothing more.The format matches the June 2018 spec for errors: https://graphql.github.io/graphql-spec/June2018/#sec-Errors
This PR is very similar to some previous ones:
map[string]interface{}
instead of method) + includes locations and path