From 8355c92c96641ab92e227f99728dab9da0ad16f1 Mon Sep 17 00:00:00 2001 From: Lucas de Moura Amaral Date: Mon, 29 Apr 2024 16:34:20 -0300 Subject: [PATCH] fix: solves operation context panic on errorPresenter --- internal/graphql/errorPresenter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/graphql/errorPresenter.go b/internal/graphql/errorPresenter.go index 8d8ff87..a715d28 100644 --- a/internal/graphql/errorPresenter.go +++ b/internal/graphql/errorPresenter.go @@ -27,10 +27,10 @@ func errorPresenter(ctx context.Context, err error) *gqlerror.Error { lvl = zerolog.ErrorLevel } - logger := log.Ctx(ctx).With().Stack().Logger() - oc := graphql.GetOperationContext(ctx) var query string - if oc != nil { + logger := log.Ctx(ctx).With().Stack().Logger() + if graphql.HasOperationContext(ctx) { + oc := graphql.GetOperationContext(ctx) query = oc.RawQuery }