Skip to content

Commit

Permalink
Merge pull request #419 from 99designs/fix-capture-ctx
Browse files Browse the repository at this point in the history
fix unexpected ctx variable capture on Tracing
  • Loading branch information
vektah authored Nov 12, 2018
2 parents 4bda3bc + 027803d commit 981fd10
Show file tree
Hide file tree
Showing 14 changed files with 825 additions and 644 deletions.
2 changes: 1 addition & 1 deletion codegen/templates/data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen/templates/field.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
// nolint: vetshadow
func (ec *executionContext) _{{$object.GQLType}}_{{$field.GQLName}}(ctx context.Context, field graphql.CollectedField, {{if not $object.Root}}obj *{{$object.FullName}}{{end}}) graphql.Marshaler {
ctx = ec.Tracer.StartFieldExecution(ctx, field)
defer ec.Tracer.EndFieldExecution(ctx)
defer func () { ec.Tracer.EndFieldExecution(ctx) }()
{{- if $field.Args }}
rawArgs := field.ArgumentMap(ec.Variables)
args, err := {{ $field.ArgsFunc }}(rawArgs)
Expand Down
Loading

0 comments on commit 981fd10

Please sign in to comment.