Skip to content

Commit

Permalink
Merge pull request #91 from lucas1993/fix/panic-operation-context
Browse files Browse the repository at this point in the history
fix: solves operation context panic on errorPresenter
  • Loading branch information
TheRafaBonin authored Apr 29, 2024
2 parents ea2681c + 8355c92 commit c007c22
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 c007c22

Please sign in to comment.