Skip to content

Commit

Permalink
Merge pull request 99designs#362 from 99designs/fix-error-docs
Browse files Browse the repository at this point in the history
fix error docs
  • Loading branch information
vektah authored Oct 2, 2018
2 parents 4f14df3 + b98ad38 commit 1671360
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/content/reference/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ You change this when creating the handler:
server := handler.GraphQL(MakeExecutableSchema(resolvers),
handler.ErrorPresenter(
func(ctx context.Context, e error) *gqlerror.Error {
// any special logic you want to do here. This only
// requirement is that it can be json encoded
// any special logic you want to do here. Must specify path for correct null bubbling behaviour.
if myError, ok := e.(MyError) ; ok {
return &gqlerror.Errorf("Eeek!")
return gqlerror.ErrorPathf(graphql.GetResolverContext(ctx).Path(), "Eeek!")
}

return graphql.DefaultErrorPresenter(ctx, e)
Expand Down

0 comments on commit 1671360

Please sign in to comment.