We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As per the spec, https://facebook.github.io/graphql/#sec-Errors , error is indicated by a field errors of non empty list in the response.
errors
so I was returning something like from my field resolver
return &graphql.Result{Errors: gqlerrors.FormatErrors(err)}
but that didn't work.
it does further validation and output the message
Locations: [{Line: 1, Column: 302}] Message: "Cannot return null for non-nullable field GroupConnection.pageInfo."
my intention is to add more details to the error in the data field.
data
so, how can I return an error from Resolve method which passes to the client?
Resolve
The text was updated successfully, but these errors were encountered:
Currently there isn't a way to return a custom error from field resolvers.
This is being considered in #44, i.e. to allow user to return an error from Resolve function) #44 (comment)
For e.g.:
helloResolve := func(p graphql.ResolveParams) (interface{}, error) { ... if err != nil { return nil, err } return "world", nil }
You're welcome to add to the discussion there to keep it going 👍🏻 (PRs are also welcomed :))
Sorry, something went wrong.
closing so we track it at #44
No branches or pull requests
As per the spec, https://facebook.github.io/graphql/#sec-Errors , error is indicated by a field
errors
of non empty list in the response.so I was returning something like from my field resolver
but that didn't work.
it does further validation and output the message
my intention is to add more details to the error in the
data
field.so, how can I return an error from
Resolve
method which passes to the client?The text was updated successfully, but these errors were encountered: