From b98ad38327b5e37daabcabb50530f18ae60314e3 Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Tue, 2 Oct 2018 13:23:06 +1000 Subject: [PATCH] fix error docs --- docs/content/reference/errors.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/content/reference/errors.md b/docs/content/reference/errors.md index 00169834e79..a3cb55a238e 100644 --- a/docs/content/reference/errors.md +++ b/docs/content/reference/errors.md @@ -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)