Skip to content

Commit

Permalink
fix: solves operation context panic on errorPresenter
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas1993 committed Apr 29, 2024
1 parent ea2681c commit 8355c92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/graphql/errorPresenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 8355c92

Please sign in to comment.