From 8eb2675a439e98293a8d799dbd78290f6137d3c2 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Oct 2018 14:32:37 +0900 Subject: [PATCH] Revert "change field marshaler return process that make it easy to insert other processing" This reverts commit 583f98047f5d1b6604d87e7b8d6f8fd38082d459. --- codegen/object.go | 18 +- codegen/templates/data.go | 2 +- codegen/templates/field.gotpl | 7 +- codegen/testserver/generated.go | 1315 +++++++++++--------------- codegen/type.go | 4 +- example/chat/generated.go | 929 ++++++++----------- example/config/generated.go | 925 ++++++++----------- example/dataloader/generated.go | 1235 +++++++++++-------------- example/scalars/generated.go | 958 +++++++++---------- example/selection/generated.go | 973 +++++++++----------- example/starwars/generated.go | 1530 +++++++++++++------------------ example/todo/generated.go | 936 ++++++++----------- integration/generated.go | 981 +++++++++----------- 13 files changed, 4225 insertions(+), 5588 deletions(-) diff --git a/codegen/object.go b/codegen/object.go index 3e63c78205..c037344fe6 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -220,15 +220,7 @@ func (f *Field) CallArgs() string { // should be in the template, but its recursive and has a bunch of args func (f *Field) WriteJson() string { - return strings.TrimSpace( - tpl(` - func () graphql.Marshaler { - {{ .next }} - }() - `, map[string]interface{}{ - "next": f.doWriteJson("res", f.Type.Modifiers, f.ASTType, false, 1), - }), - ) + return f.doWriteJson("res", f.Type.Modifiers, f.ASTType, false, 1) } func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Type, isPtr bool, depth int) string { @@ -243,8 +235,7 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ {{- end }} return graphql.Null } - {{ .next -}} - `, map[string]interface{}{ + {{.next }}`, map[string]interface{}{ "val": val, "nonNull": astType.NonNull, "next": f.doWriteJson(val, remainingMods[1:], astType, true, depth+1), @@ -298,8 +289,7 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ {{- end}} } {{ if and .top (not .isScalar) }} wg.Wait() {{ end }} - return {{ .arr -}} - `, map[string]interface{}{ + return {{.arr}}`, map[string]interface{}{ "val": val, "arr": arr, "index": index, @@ -314,7 +304,7 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ if isPtr { val = "*" + val } - return "return " + f.Marshal(val) + return f.Marshal(val) default: if !isPtr { diff --git a/codegen/templates/data.go b/codegen/templates/data.go index 8aee36f1d3..ed8226545e 100644 --- a/codegen/templates/data.go +++ b/codegen/templates/data.go @@ -2,7 +2,7 @@ package templates var data = map[string]string{ "args.gotpl": "\targs := map[string]interface{}{}\n\t{{- range $i, $arg := . }}\n\t\tvar arg{{$i}} {{$arg.Signature }}\n\t\tif tmp, ok := rawArgs[{{$arg.GQLName|quote}}]; ok {\n\t\t\tvar err error\n\t\t\t{{$arg.Unmarshal (print \"arg\" $i) \"tmp\" }}\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\targs[{{$arg.GQLName|quote}}] = arg{{$i}}\n\t{{- end }}\n\treturn args, nil\n", - "field.gotpl": "{{ $field := . }}\n{{ $object := $field.Object }}\n\n{{- if $object.Stream }}\n\tfunc (ec *executionContext) _{{$object.GQLType}}_{{$field.GQLName}}(ctx context.Context, field graphql.CollectedField) func() graphql.Marshaler {\n\t\t{{- if $field.Args }}\n\t\t\trawArgs := field.ArgumentMap(ec.Variables)\n\t\t\targs, err := {{ $field.ArgsFunc }}(rawArgs)\n\t\t\tif err != nil {\n\t\t\t\tec.Error(ctx, err)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t{{- end }}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\t\tField: field,\n\t\t})\n\t\t// FIXME: subscriptions are missing request middleware stack https://github.com/99designs/gqlgen/issues/259\n\t\t// and Tracer stack\n\t\trctx := ctx\n\t\tresults, err := ec.resolvers.{{ $field.ShortInvocation }}\n\t\tif err != nil {\n\t\t\tec.Error(ctx, err)\n\t\t\treturn nil\n\t\t}\n\t\treturn func() graphql.Marshaler {\n\t\t\tres, ok := <-results\n\t\t\tif !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tvar out graphql.OrderedMap\n\t\t\tout.Add(field.Alias, func() graphql.Marshaler { return {{ $field.WriteJson }} }())\n\t\t\treturn &out\n\t\t}\n\t}\n{{ else }}\n\t// nolint: vetshadow\n\tfunc (ec *executionContext) _{{$object.GQLType}}_{{$field.GQLName}}(ctx context.Context, field graphql.CollectedField, {{if not $object.Root}}obj *{{$object.FullName}}{{end}}) graphql.Marshaler {\n\t\t{{- if $field.Args }}\n\t\t\trawArgs := field.ArgumentMap(ec.Variables)\n\t\t\targs, err := {{ $field.ArgsFunc }}(rawArgs)\n\t\t\tif err != nil {\n\t\t\t\tec.Error(ctx, err)\n\t\t\t\treturn graphql.Null\n\t\t\t}\n\t\t{{- end }}\n\t\trctx := &graphql.ResolverContext{\n\t\t\tObject: {{$object.GQLType|quote}},\n\t\t\tArgs: {{if $field.Args }}args{{else}}nil{{end}},\n\t\t\tField: field,\n\t\t}\n\t\tctx = graphql.WithResolverContext(ctx, rctx)\n\t\tctx = ec.Tracer.StartFieldExecution(ctx)\n\t\tresTmp := ec.FieldMiddleware(ctx, {{if $object.Root}}nil{{else}}obj{{end}}, func(rctx context.Context) (interface{}, error) {\n\t\t\tctx = rctx // use context from middleware stack in children\n\t\t\t{{- if $field.IsResolver }}\n\t\t\t\treturn ec.resolvers.{{ $field.ShortInvocation }}\n\t\t\t{{- else if $field.IsMethod }}\n\t\t\t\t{{- if $field.NoErr }}\n\t\t\t\t\treturn {{$field.GoReceiverName}}.{{$field.GoFieldName}}({{ $field.CallArgs }}), nil\n\t\t\t\t{{- else }}\n\t\t\t\t\treturn {{$field.GoReceiverName}}.{{$field.GoFieldName}}({{ $field.CallArgs }})\n\t\t\t\t{{- end }}\n\t\t\t{{- else if $field.IsVariable }}\n\t\t\t\treturn {{$field.GoReceiverName}}.{{$field.GoFieldName}}, nil\n\t\t\t{{- end }}\n\t\t})\n\t\tif resTmp == nil {\n\t\t\t{{- if $field.ASTType.NonNull }}\n\t\t\t\tif !ec.HasError(rctx) {\n\t\t\t\t\tec.Errorf(ctx, \"must not be null\")\n\t\t\t\t}\n\t\t\t{{- end }}\n\t\t\treturn graphql.Null\n\t\t}\n\t\tres := resTmp.({{$field.Signature}})\n\t\trctx.Result = res\n\t\tresMarshaler := {{ $field.WriteJson }}\n\t\tec.Tracer.EndFieldExecution(ctx)\n\t\treturn resMarshaler\n\t}\n{{ end }}\n", + "field.gotpl": "{{ $field := . }}\n{{ $object := $field.Object }}\n\n{{- if $object.Stream }}\n\tfunc (ec *executionContext) _{{$object.GQLType}}_{{$field.GQLName}}(ctx context.Context, field graphql.CollectedField) func() graphql.Marshaler {\n\t\t{{- if $field.Args }}\n\t\t\trawArgs := field.ArgumentMap(ec.Variables)\n\t\t\targs, err := {{ $field.ArgsFunc }}(rawArgs)\n\t\t\tif err != nil {\n\t\t\t\tec.Error(ctx, err)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t{{- end }}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\t\tField: field,\n\t\t})\n\t\t// FIXME: subscriptions are missing request middleware stack https://github.com/99designs/gqlgen/issues/259\n\t\t// and Tracer stack\n\t\trctx := ctx\n\t\tresults, err := ec.resolvers.{{ $field.ShortInvocation }}\n\t\tif err != nil {\n\t\t\tec.Error(ctx, err)\n\t\t\treturn nil\n\t\t}\n\t\treturn func() graphql.Marshaler {\n\t\t\tres, ok := <-results\n\t\t\tif !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tvar out graphql.OrderedMap\n\t\t\tout.Add(field.Alias, func() graphql.Marshaler { {{ $field.WriteJson }} }())\n\t\t\treturn &out\n\t\t}\n\t}\n{{ else }}\n\t// nolint: vetshadow\n\tfunc (ec *executionContext) _{{$object.GQLType}}_{{$field.GQLName}}(ctx context.Context, field graphql.CollectedField, {{if not $object.Root}}obj *{{$object.FullName}}{{end}}) graphql.Marshaler {\n\t\t{{- if $field.Args }}\n\t\t\trawArgs := field.ArgumentMap(ec.Variables)\n\t\t\targs, err := {{ $field.ArgsFunc }}(rawArgs)\n\t\t\tif err != nil {\n\t\t\t\tec.Error(ctx, err)\n\t\t\t\treturn graphql.Null\n\t\t\t}\n\t\t{{- end }}\n\t\trctx := &graphql.ResolverContext{\n\t\t\tObject: {{$object.GQLType|quote}},\n\t\t\tArgs: {{if $field.Args }}args{{else}}nil{{end}},\n\t\t\tField: field,\n\t\t}\n\t\tctx = graphql.WithResolverContext(ctx, rctx)\n\t\tctx = ec.Tracer.StartFieldExecution(ctx)\n\t\tdefer ec.Tracer.EndFieldExecution(ctx)\n\t\tresTmp := ec.FieldMiddleware(ctx, {{if $object.Root}}nil{{else}}obj{{end}}, func(rctx context.Context) (interface{}, error) {\n\t\t\tctx = rctx // use context from middleware stack in children\n\t\t\t{{- if $field.IsResolver }}\n\t\t\t\treturn ec.resolvers.{{ $field.ShortInvocation }}\n\t\t\t{{- else if $field.IsMethod }}\n\t\t\t\t{{- if $field.NoErr }}\n\t\t\t\t\treturn {{$field.GoReceiverName}}.{{$field.GoFieldName}}({{ $field.CallArgs }}), nil\n\t\t\t\t{{- else }}\n\t\t\t\t\treturn {{$field.GoReceiverName}}.{{$field.GoFieldName}}({{ $field.CallArgs }})\n\t\t\t\t{{- end }}\n\t\t\t{{- else if $field.IsVariable }}\n\t\t\t\treturn {{$field.GoReceiverName}}.{{$field.GoFieldName}}, nil\n\t\t\t{{- end }}\n\t\t})\n\t\tif resTmp == nil {\n\t\t\t{{- if $field.ASTType.NonNull }}\n\t\t\t\tif !ec.HasError(rctx) {\n\t\t\t\t\tec.Errorf(ctx, \"must not be null\")\n\t\t\t\t}\n\t\t\t{{- end }}\n\t\t\treturn graphql.Null\n\t\t}\n\t\tres := resTmp.({{$field.Signature}})\n\t\trctx.Result = res\n\t\t{{ $field.WriteJson }}\n\t}\n{{ end }}\n", "generated.gotpl": "// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.\n\npackage {{ .PackageName }}\n\nimport (\n{{- range $import := .Imports }}\n\t{{- $import.Write }}\n{{ end }}\n)\n\n// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.\nfunc NewExecutableSchema(cfg Config) graphql.ExecutableSchema {\n\treturn &executableSchema{\n\t\tresolvers: cfg.Resolvers,\n\t\tdirectives: cfg.Directives,\n\t\tcomplexity: cfg.Complexity,\n\t}\n}\n\ntype Config struct {\n\tResolvers ResolverRoot\n\tDirectives DirectiveRoot\n\tComplexity ComplexityRoot\n}\n\ntype ResolverRoot interface {\n{{- range $object := .Objects -}}\n\t{{ if $object.HasResolvers -}}\n\t\t{{$object.GQLType}}() {{$object.GQLType}}Resolver\n\t{{ end }}\n{{- end }}\n}\n\ntype DirectiveRoot struct {\n{{ range $directive := .Directives }}\n\t{{ $directive.Declaration }}\n{{ end }}\n}\n\ntype ComplexityRoot struct {\n{{ range $object := .Objects }}\n\t{{ if not $object.IsReserved -}}\n\t\t{{ $object.GQLType|toCamel }} struct {\n\t\t{{ range $field := $object.Fields -}}\n\t\t\t{{ if not $field.IsReserved -}}\n\t\t\t\t{{ $field.GQLName|toCamel }} {{ $field.ComplexitySignature }}\n\t\t\t{{ end }}\n\t\t{{- end }}\n\t\t}\n\t{{- end }}\n{{ end }}\n}\n\n{{ range $object := .Objects -}}\n\t{{ if $object.HasResolvers }}\n\t\ttype {{$object.GQLType}}Resolver interface {\n\t\t{{ range $field := $object.Fields -}}\n\t\t\t{{ $field.ShortResolverDeclaration }}\n\t\t{{ end }}\n\t\t}\n\t{{- end }}\n{{- end }}\n\n{{ range $object := .Objects -}}\n\t{{ range $field := $object.Fields -}}\n\t\t{{ if $field.Args }}\n\t\t\tfunc {{ $field.ArgsFunc }}(rawArgs map[string]interface{}) (map[string]interface{}, error) {\n\t\t\t{{ template \"args.gotpl\" $field.Args }}\n\t\t\t}\n\t\t{{ end }}\n\t{{ end }}\n{{- end }}\n\n{{ range $directive := .Directives }}\n\t{{ if $directive.Args }}\n\t\tfunc {{ $directive.ArgsFunc }}(rawArgs map[string]interface{}) (map[string]interface{}, error) {\n\t\t{{ template \"args.gotpl\" $directive.Args }}\n\t\t}\n\t{{ end }}\n{{ end }}\n\ntype executableSchema struct {\n\tresolvers ResolverRoot\n\tdirectives DirectiveRoot\n\tcomplexity ComplexityRoot\n}\n\nfunc (e *executableSchema) Schema() *ast.Schema {\n\treturn parsedSchema\n}\n\nfunc (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {\n\tswitch typeName + \".\" + field {\n\t{{ range $object := .Objects }}\n\t\t{{ if not $object.IsReserved }}\n\t\t\t{{ range $field := $object.Fields }}\n\t\t\t\t{{ if not $field.IsReserved }}\n\t\t\t\t\tcase \"{{$object.GQLType}}.{{$field.GQLName}}\":\n\t\t\t\t\t\tif e.complexity.{{$object.GQLType|toCamel}}.{{$field.GQLName|toCamel}} == nil {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{{ if $field.Args }}\n\t\t\t\t\t\t\targs, err := {{ $field.ArgsFunc }}(rawArgs)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn 0, false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t{{ end }}\n\t\t\t\t\t\treturn e.complexity.{{$object.GQLType|toCamel}}.{{$field.GQLName|toCamel}}(childComplexity{{if $field.Args}}, {{$field.ComplexityArgs}} {{end}}), true\n\t\t\t\t{{ end }}\n\t\t\t{{ end }}\n\t\t{{ end }}\n\t{{ end }}\n\t}\n\treturn 0, false\n}\n\nfunc (e *executableSchema) Query(ctx context.Context, op *ast.OperationDefinition) *graphql.Response {\n\t{{- if .QueryRoot }}\n\t\tec := executionContext{graphql.GetRequestContext(ctx), e}\n\n\t\tbuf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte {\n\t\t\tdata := ec._{{.QueryRoot.GQLType}}(ctx, op.SelectionSet)\n\t\t\tvar buf bytes.Buffer\n\t\t\tdata.MarshalGQL(&buf)\n\t\t\treturn buf.Bytes()\n\t\t})\n\n\t\treturn &graphql.Response{\n\t\t\tData: buf,\n\t\t\tErrors: ec.Errors,\n\t\t\tExtensions: ec.Extensions,\t\t}\n\t{{- else }}\n\t\treturn graphql.ErrorResponse(ctx, \"queries are not supported\")\n\t{{- end }}\n}\n\nfunc (e *executableSchema) Mutation(ctx context.Context, op *ast.OperationDefinition) *graphql.Response {\n\t{{- if .MutationRoot }}\n\t\tec := executionContext{graphql.GetRequestContext(ctx), e}\n\n\t\tbuf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte {\n\t\t\tdata := ec._{{.MutationRoot.GQLType}}(ctx, op.SelectionSet)\n\t\t\tvar buf bytes.Buffer\n\t\t\tdata.MarshalGQL(&buf)\n\t\t\treturn buf.Bytes()\n\t\t})\n\n\t\treturn &graphql.Response{\n\t\t\tData: buf,\n\t\t\tErrors: ec.Errors,\n\t\t\tExtensions: ec.Extensions,\n\t\t}\n\t{{- else }}\n\t\treturn graphql.ErrorResponse(ctx, \"mutations are not supported\")\n\t{{- end }}\n}\n\nfunc (e *executableSchema) Subscription(ctx context.Context, op *ast.OperationDefinition) func() *graphql.Response {\n\t{{- if .SubscriptionRoot }}\n\t\tec := executionContext{graphql.GetRequestContext(ctx), e}\n\n\t\tnext := ec._{{.SubscriptionRoot.GQLType}}(ctx, op.SelectionSet)\n\t\tif ec.Errors != nil {\n\t\t\treturn graphql.OneShot(&graphql.Response{Data: []byte(\"null\"), Errors: ec.Errors})\n\t\t}\n\n\t\tvar buf bytes.Buffer\n\t\treturn func() *graphql.Response {\n\t\t\tbuf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte {\n\t\t\t\tbuf.Reset()\n\t\t\t\tdata := next()\n\n\t\t\t\tif data == nil {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tdata.MarshalGQL(&buf)\n\t\t\t\treturn buf.Bytes()\n\t\t\t})\n\n\t\t\tif buf == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\treturn &graphql.Response{\n\t\t\t\tData: buf,\n\t\t\t\tErrors: ec.Errors,\n\t\t\t\tExtensions: ec.Extensions,\n\t\t\t}\n\t\t}\n\t{{- else }}\n\t\treturn graphql.OneShot(graphql.ErrorResponse(ctx, \"subscriptions are not supported\"))\n\t{{- end }}\n}\n\ntype executionContext struct {\n\t*graphql.RequestContext\n\t*executableSchema\n}\n\n{{- range $object := .Objects }}\n\t{{ template \"object.gotpl\" $object }}\n\n\t{{- range $field := $object.Fields }}\n\t\t{{ template \"field.gotpl\" $field }}\n\t{{ end }}\n{{- end}}\n\n{{- range $interface := .Interfaces }}\n\t{{ template \"interface.gotpl\" $interface }}\n{{- end }}\n\n{{- range $input := .Inputs }}\n\t{{ template \"input.gotpl\" $input }}\n{{- end }}\n\nfunc (ec *executionContext) FieldMiddleware(ctx context.Context, obj interface{}, next graphql.Resolver) (ret interface{}) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tec.Error(ctx, ec.Recover(ctx, r))\n\t\t\tret = nil\n\t\t}\n\t}()\n\t{{- if .Directives }}\n\trctx := graphql.GetResolverContext(ctx)\n\tfor _, d := range rctx.Field.Definition.Directives {\n\t\tswitch d.Name {\n\t\t{{- range $directive := .Directives }}\n\t\tcase \"{{$directive.Name}}\":\n\t\t\tif ec.directives.{{$directive.Name|ucFirst}} != nil {\n\t\t\t\t{{- if $directive.Args }}\n\t\t\t\t\trawArgs := d.ArgumentMap(ec.Variables)\n\t\t\t\t\targs, err := {{ $directive.ArgsFunc }}(rawArgs)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tec.Error(ctx, err)\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t{{- end }}\n\t\t\t\tn := next\n\t\t\t\tnext = func(ctx context.Context) (interface{}, error) {\n\t\t\t\t\treturn ec.directives.{{$directive.Name|ucFirst}}({{$directive.CallArgs}})\n\t\t\t\t}\n\t\t\t}\n\t\t{{- end }}\n\t\t}\n\t}\n\t{{- end }}\n\tres, err := ec.ResolverMiddleware(ctx, next)\n\tif err != nil {\n\t\tec.Error(ctx, err)\n\t\treturn nil\n\t}\n\treturn res\n}\n\nfunc (ec *executionContext) introspectSchema() *introspection.Schema {\n\treturn introspection.WrapSchema(parsedSchema)\n}\n\nfunc (ec *executionContext) introspectType(name string) *introspection.Type {\n\treturn introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name])\n}\n\nvar parsedSchema = gqlparser.MustLoadSchema(\n\t{{- range $filename, $schema := .SchemaRaw }}\n\t\t&ast.Source{Name: {{$filename|quote}}, Input: {{$schema|rawQuote}}},\n\t{{- end }}\n)\n", "input.gotpl": "\t{{- if .IsMarshaled }}\n\tfunc Unmarshal{{ .GQLType }}(v interface{}) ({{.FullName}}, error) {\n\t\tvar it {{.FullName}}\n\t\tvar asMap = v.(map[string]interface{})\n\t\t{{ range $field := .Fields}}\n\t\t\t{{- if $field.Default}}\n\t\t\t\tif _, present := asMap[{{$field.GQLName|quote}}] ; !present {\n\t\t\t\t\tasMap[{{$field.GQLName|quote}}] = {{ $field.Default | dump }}\n\t\t\t\t}\n\t\t\t{{- end}}\n\t\t{{- end }}\n\n\t\tfor k, v := range asMap {\n\t\t\tswitch k {\n\t\t\t{{- range $field := .Fields }}\n\t\t\tcase {{$field.GQLName|quote}}:\n\t\t\t\tvar err error\n\t\t\t\t{{ $field.Unmarshal (print \"it.\" $field.GoFieldName) \"v\" }}\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn it, err\n\t\t\t\t}\n\t\t\t{{- end }}\n\t\t\t}\n\t\t}\n\n\t\treturn it, nil\n\t}\n\t{{- end }}\n", "interface.gotpl": "{{- $interface := . }}\n\nfunc (ec *executionContext) _{{$interface.GQLType}}(ctx context.Context, sel ast.SelectionSet, obj *{{$interface.FullName}}) graphql.Marshaler {\n\tswitch obj := (*obj).(type) {\n\tcase nil:\n\t\treturn graphql.Null\n\t{{- range $implementor := $interface.Implementors }}\n\t\t{{- if $implementor.ValueReceiver }}\n\t\t\tcase {{$implementor.FullName}}:\n\t\t\t\treturn ec._{{$implementor.GQLType}}(ctx, sel, &obj)\n\t\t{{- end}}\n\t\tcase *{{$implementor.FullName}}:\n\t\t\treturn ec._{{$implementor.GQLType}}(ctx, sel, obj)\n\t{{- end }}\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unexpected type %T\", obj))\n\t}\n}\n", diff --git a/codegen/templates/field.gotpl b/codegen/templates/field.gotpl index 71e950f16c..ab2d9fa628 100644 --- a/codegen/templates/field.gotpl +++ b/codegen/templates/field.gotpl @@ -28,7 +28,7 @@ return nil } var out graphql.OrderedMap - out.Add(field.Alias, func() graphql.Marshaler { return {{ $field.WriteJson }} }()) + out.Add(field.Alias, func() graphql.Marshaler { {{ $field.WriteJson }} }()) return &out } } @@ -50,6 +50,7 @@ } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, {{if $object.Root}}nil{{else}}obj{{end}}, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children {{- if $field.IsResolver }} @@ -74,8 +75,6 @@ } res := resTmp.({{$field.Signature}}) rctx.Result = res - resMarshaler := {{ $field.WriteJson }} - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + {{ $field.WriteJson }} } {{ end }} diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 7cc81cfe88..0c4f7f80a9 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -930,6 +930,7 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Radius, nil @@ -939,11 +940,7 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } // nolint: vetshadow @@ -955,6 +952,7 @@ func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Area(), nil @@ -964,11 +962,7 @@ func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.Coll } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } var embeddedPointerImplementors = []string{"EmbeddedPointer"} @@ -1009,6 +1003,7 @@ func (ec *executionContext) _EmbeddedPointer_ID(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -1018,11 +1013,7 @@ func (ec *executionContext) _EmbeddedPointer_ID(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1034,6 +1025,7 @@ func (ec *executionContext) _EmbeddedPointer_Title(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Title, nil @@ -1043,11 +1035,7 @@ func (ec *executionContext) _EmbeddedPointer_Title(ctx context.Context, field gr } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var errorImplementors = []string{"Error"} @@ -1101,6 +1089,7 @@ func (ec *executionContext) _Error_id(ctx context.Context, field graphql.Collect } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -1113,11 +1102,7 @@ func (ec *executionContext) _Error_id(ctx context.Context, field graphql.Collect } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -1129,6 +1114,7 @@ func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ErrorOnNonRequiredField() @@ -1138,11 +1124,7 @@ func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1154,6 +1136,7 @@ func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, fie } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ErrorOnRequiredField() @@ -1166,11 +1149,7 @@ func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, fie } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1182,6 +1161,7 @@ func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.NilOnRequiredField(), nil @@ -1194,18 +1174,14 @@ func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.Null + } + return graphql.MarshalString(*res) } var forcedResolverImplementors = []string{"ForcedResolver"} @@ -1249,6 +1225,7 @@ func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.ForcedResolver().Field(rctx, obj) @@ -1258,16 +1235,12 @@ func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field gra } res := resTmp.(*Circle) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Circle(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Circle(ctx, field.Selections, res) } var innerObjectImplementors = []string{"InnerObject"} @@ -1309,6 +1282,7 @@ func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -1321,11 +1295,7 @@ func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.C } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } var invalidIdentifierImplementors = []string{"InvalidIdentifier"} @@ -1367,6 +1337,7 @@ func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -1379,11 +1350,7 @@ func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field gra } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } var itImplementors = []string{"It"} @@ -1425,6 +1392,7 @@ func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedF } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -1437,11 +1405,7 @@ func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedF } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } var outerObjectImplementors = []string{"OuterObject"} @@ -1483,6 +1447,7 @@ func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Inner, nil @@ -1495,12 +1460,8 @@ func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphq } res := resTmp.(InnerObject) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._InnerObject(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._InnerObject(ctx, field.Selections, &res) } var queryImplementors = []string{"Query"} @@ -1636,6 +1597,7 @@ func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().InvalidIdentifier(rctx) @@ -1645,16 +1607,12 @@ func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field } res := resTmp.(*invalid_packagename.InvalidIdentifier) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._InvalidIdentifier(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._InvalidIdentifier(ctx, field.Selections, res) } // nolint: vetshadow @@ -1666,6 +1624,7 @@ func (ec *executionContext) _Query_collision(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Collision(rctx) @@ -1675,16 +1634,12 @@ func (ec *executionContext) _Query_collision(ctx context.Context, field graphql. } res := resTmp.(*introspection1.It) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._It(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._It(ctx, field.Selections, res) } // nolint: vetshadow @@ -1702,6 +1657,7 @@ func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().MapInput(rctx, args["input"].(*map[string]interface{})) @@ -1711,15 +1667,11 @@ func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.C } res := resTmp.(*bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalBoolean(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalBoolean(*res) } // nolint: vetshadow @@ -1737,6 +1689,7 @@ func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Recursive(rctx, args["input"].(*RecursiveInputSlice)) @@ -1746,15 +1699,11 @@ func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql. } res := resTmp.(*bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalBoolean(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalBoolean(*res) } // nolint: vetshadow @@ -1772,6 +1721,7 @@ func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().NestedInputs(rctx, args["input"].([][]*OuterInput)) @@ -1781,15 +1731,11 @@ func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graph } res := resTmp.(*bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalBoolean(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalBoolean(*res) } // nolint: vetshadow @@ -1801,6 +1747,7 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().NestedOutputs(rctx) @@ -1810,79 +1757,75 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap } res := resTmp.([][]*OuterObject) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: res[idx1], + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { + arr1[idx1] = func() graphql.Marshaler { + + arr2 := make(graphql.Array, len(res[idx1])) + + isLen1 := len(res[idx1]) == 1 if !isLen1 { - defer wg.Done() + wg.Add(len(res[idx1])) } - arr1[idx1] = func() graphql.Marshaler { - - arr2 := make(graphql.Array, len(res[idx1])) - isLen1 := len(res[idx1]) == 1 - if !isLen1 { - wg.Add(len(res[idx1])) + for idx2 := range res[idx1] { + idx2 := idx2 + rctx := &graphql.ResolverContext{ + Index: &idx2, + Result: res[idx1][idx2], } - - for idx2 := range res[idx1] { - idx2 := idx2 - rctx := &graphql.ResolverContext{ - Index: &idx2, - Result: res[idx1][idx2], + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx2 int) { + if !isLen1 { + defer wg.Done() } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx2 int) { - if !isLen1 { - defer wg.Done() - } - arr2[idx2] = func() graphql.Marshaler { - - if res[idx1][idx2] == nil { - return graphql.Null - } + arr2[idx2] = func() graphql.Marshaler { - return ec._OuterObject(ctx, field.Selections, res[idx1][idx2]) - }() - } - if isLen1 { - f(idx2) - } else { - go f(idx2) - } + if res[idx1][idx2] == nil { + return graphql.Null + } + return ec._OuterObject(ctx, field.Selections, res[idx1][idx2]) + }() + } + if isLen1 { + f(idx2) + } else { + go f(idx2) } - return arr2 - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) - } + } + return arr2 + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1900,6 +1843,7 @@ func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Keywords(rctx, args["input"].(*Keywords)) @@ -1912,11 +1856,7 @@ func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.C } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1928,6 +1868,7 @@ func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Shapes(rctx) @@ -1937,48 +1878,44 @@ func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.Col } res := resTmp.([]*Shape) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: res[idx1], + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - if res[idx1] == nil { - return graphql.Null - } + arr1[idx1] = func() graphql.Marshaler { - return ec._Shape(ctx, field.Selections, res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) - } + if res[idx1] == nil { + return graphql.Null + } + return ec._Shape(ctx, field.Selections, res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1990,6 +1927,7 @@ func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().ErrorBubble(rctx) @@ -1999,16 +1937,12 @@ func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphq } res := resTmp.(*Error) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Error(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Error(ctx, field.Selections, res) } // nolint: vetshadow @@ -2020,6 +1954,7 @@ func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Valid(rctx) @@ -2032,11 +1967,7 @@ func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2054,6 +1985,7 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().User(rctx, args["id"].(int)) @@ -2066,12 +1998,8 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle } res := resTmp.(User) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._User(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._User(ctx, field.Selections, &res) } // nolint: vetshadow @@ -2089,6 +2017,7 @@ func (ec *executionContext) _Query_nullableArg(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().NullableArg(rctx, args["arg"].(*int)) @@ -2098,15 +2027,11 @@ func (ec *executionContext) _Query_nullableArg(ctx context.Context, field graphq } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -2124,6 +2049,7 @@ func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().KeywordArgs(rctx, args["break"].(string), args["default"].(string), args["func"].(string), args["interface"].(string), args["select"].(string), args["case"].(string), args["defer"].(string), args["go"].(string), args["map"].(string), args["struct"].(string), args["chan"].(string), args["else"].(string), args["goto"].(string), args["package"].(string), args["switch"].(string), args["const"].(string), args["fallthrough"].(string), args["if"].(string), args["range"].(string), args["type"].(string), args["continue"].(string), args["for"].(string), args["import"].(string), args["return"].(string), args["var"].(string)) @@ -2136,11 +2062,7 @@ func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphq } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -2158,6 +2080,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -2167,16 +2090,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -2188,6 +2107,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -2197,16 +2117,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var rectangleImplementors = []string{"Rectangle", "Shape"} @@ -2249,6 +2165,7 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Length, nil @@ -2258,11 +2175,7 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } // nolint: vetshadow @@ -2274,6 +2187,7 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Width, nil @@ -2283,11 +2197,7 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } // nolint: vetshadow @@ -2299,6 +2209,7 @@ func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Area(), nil @@ -2308,11 +2219,7 @@ func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.C } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } var subscriptionImplementors = []string{"Subscription"} @@ -2356,11 +2263,7 @@ func (ec *executionContext) _Subscription_updated(ctx context.Context, field gra return nil } var out graphql.OrderedMap - out.Add(field.Alias, func() graphql.Marshaler { - return func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - }()) + out.Add(field.Alias, func() graphql.Marshaler { return graphql.MarshalString(res) }()) return &out } } @@ -2383,11 +2286,7 @@ func (ec *executionContext) _Subscription_initPayload(ctx context.Context, field return nil } var out graphql.OrderedMap - out.Add(field.Alias, func() graphql.Marshaler { - return func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - }()) + out.Add(field.Alias, func() graphql.Marshaler { return graphql.MarshalString(res) }()) return &out } } @@ -2441,6 +2340,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -2453,11 +2353,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -2469,6 +2365,7 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.User().Friends(rctx, obj) @@ -2481,44 +2378,40 @@ func (ec *executionContext) _User_friends(ctx context.Context, field graphql.Col } res := resTmp.([]User) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._User(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._User(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __DirectiveImplementors = []string{"__Directive"} @@ -2572,6 +2465,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -2584,11 +2478,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2600,6 +2490,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -2609,11 +2500,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2625,6 +2512,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -2637,20 +2525,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -2662,6 +2546,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -2674,44 +2559,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -2762,6 +2643,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -2774,11 +2656,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2790,6 +2668,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -2799,11 +2678,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2815,6 +2690,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -2827,11 +2703,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -2843,6 +2715,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -2852,11 +2725,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -2917,6 +2786,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -2929,11 +2799,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2945,6 +2811,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -2954,11 +2821,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2970,6 +2833,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -2982,44 +2846,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3031,6 +2891,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -3043,19 +2904,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3067,6 +2924,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -3079,11 +2937,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -3095,6 +2949,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -3104,11 +2959,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -3159,6 +3010,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -3171,11 +3023,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3187,6 +3035,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -3196,11 +3045,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3212,6 +3057,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -3224,19 +3070,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3248,6 +3090,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -3257,15 +3100,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -3321,6 +3160,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -3333,44 +3173,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3382,6 +3218,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -3394,19 +3231,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3418,6 +3251,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -3427,16 +3261,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3448,6 +3278,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -3457,16 +3288,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3478,6 +3305,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -3490,44 +3318,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -3585,6 +3409,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -3597,11 +3422,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3613,6 +3434,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -3622,15 +3444,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -3642,6 +3460,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -3651,11 +3470,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3673,6 +3488,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -3682,44 +3498,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3731,6 +3543,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -3740,44 +3553,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3789,6 +3598,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -3798,44 +3608,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3853,6 +3659,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -3862,44 +3669,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3911,6 +3714,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -3920,44 +3724,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3969,6 +3769,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -3978,16 +3779,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) _Shape(ctx context.Context, sel ast.SelectionSet, obj *Shape) graphql.Marshaler { diff --git a/codegen/type.go b/codegen/type.go index 2e9c67dc0b..8c53fe5521 100644 --- a/codegen/type.go +++ b/codegen/type.go @@ -163,8 +163,8 @@ func (t Type) Marshal(val string) string { } if t.Marshaler != nil { - return t.Marshaler.PkgDot() + "Marshal" + t.Marshaler.GoType + "(" + val + ")" + return "return " + t.Marshaler.PkgDot() + "Marshal" + t.Marshaler.GoType + "(" + val + ")" } - return val + return "return " + val } diff --git a/example/chat/generated.go b/example/chat/generated.go index 89b0f4d01d..663681c748 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -393,6 +393,7 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -405,11 +406,7 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -421,6 +418,7 @@ func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Messages, nil @@ -433,44 +431,40 @@ func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphq } res := resTmp.([]Message) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec._Message(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Message(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var messageImplementors = []string{"Message"} @@ -527,6 +521,7 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -539,11 +534,7 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -555,6 +546,7 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Text, nil @@ -567,11 +559,7 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -583,6 +571,7 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedBy, nil @@ -595,11 +584,7 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -611,6 +596,7 @@ func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.CreatedAt, nil @@ -623,11 +609,7 @@ func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphq } res := resTmp.(time.Time) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalTime(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalTime(res) } var mutationImplementors = []string{"Mutation"} @@ -679,6 +661,7 @@ func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().Post(rctx, args["text"].(string), args["username"].(string), args["roomName"].(string)) @@ -691,12 +674,8 @@ func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.Co } res := resTmp.(Message) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Message(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Message(ctx, field.Selections, &res) } var queryImplementors = []string{"Query"} @@ -754,6 +733,7 @@ func (ec *executionContext) _Query_room(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Room(rctx, args["name"].(string)) @@ -763,16 +743,12 @@ func (ec *executionContext) _Query_room(ctx context.Context, field graphql.Colle } res := resTmp.(*Chatroom) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Chatroom(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Chatroom(ctx, field.Selections, res) } // nolint: vetshadow @@ -790,6 +766,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -799,16 +776,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -820,6 +793,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -829,16 +803,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var subscriptionImplementors = []string{"Subscription"} @@ -887,10 +857,7 @@ func (ec *executionContext) _Subscription_messageAdded(ctx context.Context, fiel } var out graphql.OrderedMap out.Add(field.Alias, func() graphql.Marshaler { - return func() graphql.Marshaler { - - return ec._Message(ctx, field.Selections, &res) - }() + return ec._Message(ctx, field.Selections, &res) }()) return &out } @@ -947,6 +914,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -959,11 +927,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -975,6 +939,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -984,11 +949,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1000,6 +961,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -1012,20 +974,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -1037,6 +995,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1049,44 +1008,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -1137,6 +1092,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1149,11 +1105,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1165,6 +1117,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1174,11 +1127,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1190,6 +1139,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1202,11 +1152,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1218,6 +1164,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1227,11 +1174,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -1292,6 +1235,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1304,11 +1248,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1320,6 +1260,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1329,11 +1270,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1345,6 +1282,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1357,44 +1295,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1406,6 +1340,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1418,19 +1353,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1442,6 +1373,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1454,11 +1386,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1470,6 +1398,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1479,11 +1408,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -1534,6 +1459,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1546,11 +1472,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1562,6 +1484,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1571,11 +1494,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1587,6 +1506,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1599,19 +1519,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1623,6 +1539,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -1632,15 +1549,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -1696,6 +1609,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -1708,44 +1622,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1757,6 +1667,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -1769,19 +1680,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1793,6 +1700,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -1802,16 +1710,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1823,6 +1727,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -1832,16 +1737,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1853,6 +1754,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -1865,44 +1767,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -1960,6 +1858,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -1972,11 +1871,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1988,6 +1883,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -1997,15 +1893,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -2017,6 +1909,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -2026,11 +1919,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2048,6 +1937,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -2057,44 +1947,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2106,6 +1992,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -2115,44 +2002,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2164,6 +2047,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -2173,44 +2057,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2228,6 +2108,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -2237,44 +2118,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2286,6 +2163,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -2295,44 +2173,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2344,6 +2218,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -2353,16 +2228,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) FieldMiddleware(ctx context.Context, obj interface{}, next graphql.Resolver) (ret interface{}) { diff --git a/example/config/generated.go b/example/config/generated.go index af17d74180..d67ae019e0 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -307,6 +307,7 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreateTodo(rctx, args["input"].(NewTodo)) @@ -319,12 +320,8 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap } res := resTmp.(Todo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Todo(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Todo(ctx, field.Selections, &res) } var queryImplementors = []string{"Query"} @@ -379,6 +376,7 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Todos(rctx) @@ -391,44 +389,40 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll } res := resTmp.([]Todo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Todo(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Todo(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -446,6 +440,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -455,16 +450,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -476,6 +467,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -485,16 +477,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var todoImplementors = []string{"Todo"} @@ -561,6 +549,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Todo().ID(rctx, obj) @@ -573,11 +562,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -589,6 +574,7 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DatabaseID, nil @@ -601,11 +587,7 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -617,6 +599,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -629,11 +612,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -645,6 +624,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Done, nil @@ -657,11 +637,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -673,6 +649,7 @@ func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.User, nil @@ -685,12 +662,8 @@ func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.Collec } res := resTmp.(User) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._User(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._User(ctx, field.Selections, &res) } var userImplementors = []string{"User"} @@ -737,6 +710,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -749,11 +723,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -765,6 +735,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.FullName(), nil @@ -777,11 +748,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __DirectiveImplementors = []string{"__Directive"} @@ -835,6 +802,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -847,11 +815,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -863,6 +827,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -872,11 +837,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -888,6 +849,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -900,20 +862,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -925,6 +883,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -937,44 +896,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -1025,6 +980,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1037,11 +993,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1053,6 +1005,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1062,11 +1015,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1078,6 +1027,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1090,11 +1040,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1106,6 +1052,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1115,11 +1062,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -1180,6 +1123,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1192,11 +1136,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1208,6 +1148,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1217,11 +1158,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1233,6 +1170,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1245,44 +1183,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1294,6 +1228,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1306,19 +1241,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1330,6 +1261,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1342,11 +1274,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1358,6 +1286,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1367,11 +1296,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -1422,6 +1347,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1434,11 +1360,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1450,6 +1372,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1459,11 +1382,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1475,6 +1394,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1487,19 +1407,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1511,6 +1427,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -1520,15 +1437,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -1584,6 +1497,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -1596,44 +1510,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1645,6 +1555,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -1657,19 +1568,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1681,6 +1588,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -1690,16 +1598,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1711,6 +1615,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -1720,16 +1625,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1741,6 +1642,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -1753,44 +1655,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -1848,6 +1746,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -1860,11 +1759,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1876,6 +1771,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -1885,15 +1781,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -1905,6 +1797,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -1914,11 +1807,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1936,6 +1825,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -1945,44 +1835,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1994,6 +1880,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -2003,44 +1890,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2052,6 +1935,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -2061,44 +1945,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2116,6 +1996,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -2125,44 +2006,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2174,6 +2051,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -2183,44 +2061,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2232,6 +2106,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -2241,16 +2116,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func UnmarshalNewTodo(v interface{}) (NewTodo, error) { diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 18f17851e6..07855ffaa9 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -402,6 +402,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -414,11 +415,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -430,6 +427,7 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Street, nil @@ -442,11 +440,7 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -458,6 +452,7 @@ func (ec *executionContext) _Address_country(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Country, nil @@ -470,11 +465,7 @@ func (ec *executionContext) _Address_country(ctx context.Context, field graphql. } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var customerImplementors = []string{"Customer"} @@ -534,6 +525,7 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -546,11 +538,7 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -562,6 +550,7 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -574,11 +563,7 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -590,6 +575,7 @@ func (ec *executionContext) _Customer_address(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Customer().Address(rctx, obj) @@ -599,16 +585,12 @@ func (ec *executionContext) _Customer_address(ctx context.Context, field graphql } res := resTmp.(*Address) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Address(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Address(ctx, field.Selections, res) } // nolint: vetshadow @@ -620,6 +602,7 @@ func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Customer().Orders(rctx, obj) @@ -629,44 +612,40 @@ func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql. } res := resTmp.([]Order) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Order(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Order(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var itemImplementors = []string{"Item"} @@ -708,6 +687,7 @@ func (ec *executionContext) _Item_name(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -720,11 +700,7 @@ func (ec *executionContext) _Item_name(ctx context.Context, field graphql.Collec } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var orderImplementors = []string{"Order"} @@ -783,6 +759,7 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -795,11 +772,7 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -811,6 +784,7 @@ func (ec *executionContext) _Order_date(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Date, nil @@ -823,11 +797,7 @@ func (ec *executionContext) _Order_date(ctx context.Context, field graphql.Colle } res := resTmp.(time.Time) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalTime(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalTime(res) } // nolint: vetshadow @@ -839,6 +809,7 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Amount, nil @@ -851,11 +822,7 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } // nolint: vetshadow @@ -867,6 +834,7 @@ func (ec *executionContext) _Order_items(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Order().Items(rctx, obj) @@ -876,44 +844,40 @@ func (ec *executionContext) _Order_items(ctx context.Context, field graphql.Coll } res := resTmp.([]Item) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Item(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Item(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var queryImplementors = []string{"Query"} @@ -977,6 +941,7 @@ func (ec *executionContext) _Query_customers(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Customers(rctx) @@ -986,44 +951,40 @@ func (ec *executionContext) _Query_customers(ctx context.Context, field graphql. } res := resTmp.([]Customer) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Customer(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Customer(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1041,6 +1002,7 @@ func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Torture1d(rctx, args["customerIds"].([]int)) @@ -1050,44 +1012,40 @@ func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql. } res := resTmp.([]Customer) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Customer(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Customer(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1105,6 +1063,7 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Torture2d(rctx, args["customerIds"].([][]int)) @@ -1114,75 +1073,71 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. } res := resTmp.([][]Customer) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: res[idx1], + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { + arr1[idx1] = func() graphql.Marshaler { + + arr2 := make(graphql.Array, len(res[idx1])) + + isLen1 := len(res[idx1]) == 1 if !isLen1 { - defer wg.Done() + wg.Add(len(res[idx1])) } - arr1[idx1] = func() graphql.Marshaler { - - arr2 := make(graphql.Array, len(res[idx1])) - isLen1 := len(res[idx1]) == 1 - if !isLen1 { - wg.Add(len(res[idx1])) + for idx2 := range res[idx1] { + idx2 := idx2 + rctx := &graphql.ResolverContext{ + Index: &idx2, + Result: &res[idx1][idx2], } - - for idx2 := range res[idx1] { - idx2 := idx2 - rctx := &graphql.ResolverContext{ - Index: &idx2, - Result: &res[idx1][idx2], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx2 int) { - if !isLen1 { - defer wg.Done() - } - arr2[idx2] = func() graphql.Marshaler { - - return ec._Customer(ctx, field.Selections, &res[idx1][idx2]) - }() - } - if isLen1 { - f(idx2) - } else { - go f(idx2) + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx2 int) { + if !isLen1 { + defer wg.Done() } + arr2[idx2] = func() graphql.Marshaler { + return ec._Customer(ctx, field.Selections, &res[idx1][idx2]) + }() + } + if isLen1 { + f(idx2) + } else { + go f(idx2) } - return arr2 - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) - } + } + return arr2 + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1200,6 +1155,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -1209,16 +1165,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1230,6 +1182,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -1239,16 +1192,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var __DirectiveImplementors = []string{"__Directive"} @@ -1302,6 +1251,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1314,11 +1264,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1330,6 +1276,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1339,11 +1286,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1355,6 +1298,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -1367,20 +1311,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -1392,6 +1332,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1404,44 +1345,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -1492,6 +1429,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1504,11 +1442,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1520,6 +1454,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1529,11 +1464,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1545,6 +1476,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1557,11 +1489,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1573,6 +1501,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1582,11 +1511,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -1647,6 +1572,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1659,11 +1585,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1675,6 +1597,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1684,11 +1607,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1700,6 +1619,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1712,44 +1632,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1761,6 +1677,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1773,19 +1690,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1797,6 +1710,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1809,11 +1723,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1825,6 +1735,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1834,11 +1745,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -1889,6 +1796,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1901,11 +1809,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1917,6 +1821,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1926,11 +1831,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1942,6 +1843,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1954,19 +1856,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1978,6 +1876,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -1987,15 +1886,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -2051,6 +1946,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -2063,44 +1959,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2112,6 +2004,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -2124,19 +2017,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -2148,6 +2037,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -2157,16 +2047,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -2178,6 +2064,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -2187,16 +2074,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -2208,6 +2091,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -2220,44 +2104,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -2315,6 +2195,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -2327,11 +2208,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2343,6 +2220,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -2352,15 +2230,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -2372,6 +2246,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -2381,11 +2256,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2403,6 +2274,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -2412,44 +2284,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2461,6 +2329,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -2470,44 +2339,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2519,6 +2384,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -2528,44 +2394,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2583,6 +2445,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -2592,44 +2455,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2641,6 +2500,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -2650,44 +2510,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2699,6 +2555,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -2708,16 +2565,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) FieldMiddleware(ctx context.Context, obj interface{}, next graphql.Resolver) (ret interface{}) { diff --git a/example/scalars/generated.go b/example/scalars/generated.go index bb7738e39d..d59c766f5f 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -333,6 +333,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -345,11 +346,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle } res := resTmp.(external.ObjectID) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return model.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return model.MarshalID(res) } // nolint: vetshadow @@ -361,6 +358,7 @@ func (ec *executionContext) _Address_location(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Location, nil @@ -370,15 +368,11 @@ func (ec *executionContext) _Address_location(ctx context.Context, field graphql } res := resTmp.(*model.Point) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return *res - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return *res } var queryImplementors = []string{"Query"} @@ -445,6 +439,7 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().User(rctx, args["id"].(external.ObjectID)) @@ -454,16 +449,12 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle } res := resTmp.(*model.User) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._User(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._User(ctx, field.Selections, res) } // nolint: vetshadow @@ -481,6 +472,7 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Search(rctx, args["input"].(*model.SearchArgs)) @@ -493,44 +485,40 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col } res := resTmp.([]model.User) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._User(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._User(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -548,6 +536,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -557,16 +546,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -578,6 +563,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -587,16 +573,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var userImplementors = []string{"User"} @@ -673,6 +655,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -685,11 +668,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } res := resTmp.(external.ObjectID) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return model.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return model.MarshalID(res) } // nolint: vetshadow @@ -701,6 +680,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -713,11 +693,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -729,6 +705,7 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Created, nil @@ -738,11 +715,7 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col } res := resTmp.(time.Time) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return model.MarshalTimestamp(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return model.MarshalTimestamp(res) } // nolint: vetshadow @@ -754,6 +727,7 @@ func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsBanned, nil @@ -766,11 +740,7 @@ func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.Co } res := resTmp.(model.Banned) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(bool(res)) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(bool(res)) } // nolint: vetshadow @@ -782,6 +752,7 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.User().PrimitiveResolver(rctx, obj) @@ -794,11 +765,7 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -810,6 +777,7 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.User().CustomResolver(rctx, obj) @@ -822,11 +790,7 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap } res := resTmp.(model.Point) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return res - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return res } // nolint: vetshadow @@ -838,6 +802,7 @@ func (ec *executionContext) _User_address(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Address, nil @@ -847,12 +812,8 @@ func (ec *executionContext) _User_address(ctx context.Context, field graphql.Col } res := resTmp.(model.Address) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Address(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Address(ctx, field.Selections, &res) } // nolint: vetshadow @@ -864,6 +825,7 @@ func (ec *executionContext) _User_tier(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Tier, nil @@ -873,11 +835,7 @@ func (ec *executionContext) _User_tier(ctx context.Context, field graphql.Collec } res := resTmp.(model.Tier) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return res - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return res } var __DirectiveImplementors = []string{"__Directive"} @@ -931,6 +889,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -943,11 +902,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -959,6 +914,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -968,11 +924,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -984,6 +936,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -996,20 +949,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -1021,6 +970,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1033,44 +983,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -1121,6 +1067,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1133,11 +1080,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1149,6 +1092,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1158,11 +1102,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1174,6 +1114,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1186,11 +1127,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1202,6 +1139,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1211,11 +1149,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -1276,6 +1210,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1288,11 +1223,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1304,6 +1235,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1313,11 +1245,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1329,6 +1257,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1341,44 +1270,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1390,6 +1315,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1402,19 +1328,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1426,6 +1348,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1438,11 +1361,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1454,6 +1373,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1463,11 +1383,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -1518,6 +1434,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1530,11 +1447,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1546,6 +1459,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1555,11 +1469,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1571,6 +1481,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1583,19 +1494,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1607,6 +1514,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -1616,15 +1524,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -1680,6 +1584,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -1692,44 +1597,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1741,6 +1642,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -1753,19 +1655,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1777,6 +1675,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -1786,16 +1685,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1807,6 +1702,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -1816,16 +1712,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1837,6 +1729,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -1849,44 +1742,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -1944,6 +1833,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -1956,11 +1846,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1972,6 +1858,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -1981,15 +1868,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -2001,6 +1884,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -2010,11 +1894,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2032,6 +1912,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -2041,44 +1922,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2090,6 +1967,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -2099,44 +1977,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2148,6 +2022,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -2157,44 +2032,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2212,6 +2083,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -2221,44 +2093,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2270,6 +2138,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -2279,44 +2148,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2328,6 +2193,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -2337,16 +2203,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func UnmarshalSearchArgs(v interface{}) (model.SearchArgs, error) { diff --git a/example/selection/generated.go b/example/selection/generated.go index 94eca6a622..705437f68d 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -264,6 +264,7 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Reaction, nil @@ -276,11 +277,7 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -292,6 +289,7 @@ func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Sent, nil @@ -304,11 +302,7 @@ func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.Collec } res := resTmp.(time.Time) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalTime(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalTime(res) } // nolint: vetshadow @@ -320,6 +314,7 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Selection, nil @@ -329,20 +324,16 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -354,6 +345,7 @@ func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Collected, nil @@ -363,20 +355,16 @@ func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.C } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } var postImplementors = []string{"Post", "Event"} @@ -427,6 +415,7 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Message, nil @@ -439,11 +428,7 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -455,6 +440,7 @@ func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Sent, nil @@ -467,11 +453,7 @@ func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.Collec } res := resTmp.(time.Time) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalTime(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalTime(res) } // nolint: vetshadow @@ -483,6 +465,7 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Selection, nil @@ -492,20 +475,16 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -517,6 +496,7 @@ func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Collected, nil @@ -526,20 +506,16 @@ func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.C } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } var queryImplementors = []string{"Query"} @@ -591,6 +567,7 @@ func (ec *executionContext) _Query_events(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Events(rctx) @@ -600,44 +577,40 @@ func (ec *executionContext) _Query_events(ctx context.Context, field graphql.Col } res := resTmp.([]Event) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec._Event(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Event(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -655,6 +628,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -664,16 +638,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -685,6 +655,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -694,16 +665,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var __DirectiveImplementors = []string{"__Directive"} @@ -757,6 +724,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -769,11 +737,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -785,6 +749,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -794,11 +759,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -810,6 +771,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -822,20 +784,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -847,6 +805,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -859,44 +818,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -947,6 +902,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -959,11 +915,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -975,6 +927,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -984,11 +937,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1000,6 +949,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1012,11 +962,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1028,6 +974,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1037,11 +984,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -1102,6 +1045,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1114,11 +1058,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1130,6 +1070,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1139,11 +1080,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1155,6 +1092,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1167,44 +1105,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1216,6 +1150,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1228,19 +1163,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1252,6 +1183,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1264,11 +1196,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1280,6 +1208,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1289,11 +1218,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -1344,6 +1269,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1356,11 +1282,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1372,6 +1294,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1381,11 +1304,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1397,6 +1316,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1409,19 +1329,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1433,6 +1349,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -1442,15 +1359,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -1506,6 +1419,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -1518,44 +1432,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1567,6 +1477,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -1579,19 +1490,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1603,6 +1510,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -1612,16 +1520,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1633,6 +1537,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -1642,16 +1547,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1663,6 +1564,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -1675,44 +1577,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -1770,6 +1668,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -1782,11 +1681,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1798,6 +1693,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -1807,15 +1703,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -1827,6 +1719,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -1836,11 +1729,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1858,6 +1747,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -1867,44 +1757,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1916,6 +1802,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -1925,44 +1812,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1974,6 +1857,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -1983,44 +1867,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2038,6 +1918,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -2047,44 +1928,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2096,6 +1973,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -2105,44 +1983,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2154,6 +2028,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -2163,16 +2038,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, obj *Event) graphql.Marshaler { diff --git a/example/starwars/generated.go b/example/starwars/generated.go index e2bb6a8c18..eaf8f37392 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -888,6 +888,7 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -900,11 +901,7 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -916,6 +913,7 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -928,11 +926,7 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -944,6 +938,7 @@ func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Droid().Friends(rctx, obj) @@ -953,44 +948,40 @@ func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.Co } res := resTmp.([]Character) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Character(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Character(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1008,6 +999,7 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Droid().FriendsConnection(rctx, obj, args["first"].(*int), args["after"].(*string)) @@ -1020,12 +1012,8 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field } res := resTmp.(FriendsConnection) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._FriendsConnection(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._FriendsConnection(ctx, field.Selections, &res) } // nolint: vetshadow @@ -1037,6 +1025,7 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.AppearsIn, nil @@ -1049,20 +1038,16 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. } res := resTmp.([]Episode) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return res[idx1] - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return res[idx1] + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -1074,6 +1059,7 @@ func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PrimaryFunction, nil @@ -1083,11 +1069,7 @@ func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field gr } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var friendsConnectionImplementors = []string{"FriendsConnection"} @@ -1147,6 +1129,7 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.TotalCount(), nil @@ -1159,11 +1142,7 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -1175,6 +1154,7 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.FriendsConnection().Edges(rctx, obj) @@ -1184,44 +1164,40 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field } res := resTmp.([]FriendsEdge) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._FriendsEdge(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._FriendsEdge(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1233,6 +1209,7 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.FriendsConnection().Friends(rctx, obj) @@ -1242,44 +1219,40 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel } res := resTmp.([]Character) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Character(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Character(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1291,6 +1264,7 @@ func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, fie } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PageInfo(), nil @@ -1303,12 +1277,8 @@ func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, fie } res := resTmp.(PageInfo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._PageInfo(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._PageInfo(ctx, field.Selections, &res) } var friendsEdgeImplementors = []string{"FriendsEdge"} @@ -1352,6 +1322,7 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Cursor, nil @@ -1364,11 +1335,7 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -1380,6 +1347,7 @@ func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -1389,12 +1357,8 @@ func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql } res := resTmp.(Character) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Character(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Character(ctx, field.Selections, &res) } var humanImplementors = []string{"Human", "Character"} @@ -1475,6 +1439,7 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -1487,11 +1452,7 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -1503,6 +1464,7 @@ func (ec *executionContext) _Human_name(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1515,11 +1477,7 @@ func (ec *executionContext) _Human_name(ctx context.Context, field graphql.Colle } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1537,6 +1495,7 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Height(args["unit"].(LengthUnit)), nil @@ -1549,11 +1508,7 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } // nolint: vetshadow @@ -1565,6 +1520,7 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Mass, nil @@ -1574,11 +1530,7 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } // nolint: vetshadow @@ -1590,6 +1542,7 @@ func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Human().Friends(rctx, obj) @@ -1599,44 +1552,40 @@ func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.Co } res := resTmp.([]Character) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Character(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Character(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1654,6 +1603,7 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Human().FriendsConnection(rctx, obj, args["first"].(*int), args["after"].(*string)) @@ -1666,12 +1616,8 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field } res := resTmp.(FriendsConnection) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._FriendsConnection(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._FriendsConnection(ctx, field.Selections, &res) } // nolint: vetshadow @@ -1683,6 +1629,7 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.AppearsIn, nil @@ -1695,20 +1642,16 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. } res := resTmp.([]Episode) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return res[idx1] - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return res[idx1] + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -1720,6 +1663,7 @@ func (ec *executionContext) _Human_starships(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Human().Starships(rctx, obj) @@ -1729,44 +1673,40 @@ func (ec *executionContext) _Human_starships(ctx context.Context, field graphql. } res := resTmp.([]Starship) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Starship(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Starship(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var mutationImplementors = []string{"Mutation"} @@ -1815,6 +1755,7 @@ func (ec *executionContext) _Mutation_createReview(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Mutation().CreateReview(rctx, args["episode"].(Episode), args["review"].(Review)) @@ -1824,16 +1765,12 @@ func (ec *executionContext) _Mutation_createReview(ctx context.Context, field gr } res := resTmp.(*Review) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Review(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Review(ctx, field.Selections, res) } var pageInfoImplementors = []string{"PageInfo"} @@ -1885,6 +1822,7 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.StartCursor, nil @@ -1897,11 +1835,7 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -1913,6 +1847,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EndCursor, nil @@ -1925,11 +1860,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -1941,6 +1872,7 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.HasNextPage, nil @@ -1953,11 +1885,7 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } var queryImplementors = []string{"Query"} @@ -2057,6 +1985,7 @@ func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Hero(rctx, args["episode"].(*Episode)) @@ -2066,12 +1995,8 @@ func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.Colle } res := resTmp.(Character) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Character(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Character(ctx, field.Selections, &res) } // nolint: vetshadow @@ -2089,6 +2014,7 @@ func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Reviews(rctx, args["episode"].(Episode), args["since"].(*time.Time)) @@ -2101,44 +2027,40 @@ func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.Co } res := resTmp.([]Review) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Review(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Review(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2156,6 +2078,7 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Search(rctx, args["text"].(string)) @@ -2168,44 +2091,40 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col } res := resTmp.([]SearchResult) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._SearchResult(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._SearchResult(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2223,6 +2142,7 @@ func (ec *executionContext) _Query_character(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Character(rctx, args["id"].(string)) @@ -2232,12 +2152,8 @@ func (ec *executionContext) _Query_character(ctx context.Context, field graphql. } res := resTmp.(Character) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Character(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Character(ctx, field.Selections, &res) } // nolint: vetshadow @@ -2255,6 +2171,7 @@ func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Droid(rctx, args["id"].(string)) @@ -2264,16 +2181,12 @@ func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.Coll } res := resTmp.(*Droid) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Droid(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Droid(ctx, field.Selections, res) } // nolint: vetshadow @@ -2291,6 +2204,7 @@ func (ec *executionContext) _Query_human(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Human(rctx, args["id"].(string)) @@ -2300,16 +2214,12 @@ func (ec *executionContext) _Query_human(ctx context.Context, field graphql.Coll } res := resTmp.(*Human) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Human(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Human(ctx, field.Selections, res) } // nolint: vetshadow @@ -2327,6 +2237,7 @@ func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Starship(rctx, args["id"].(string)) @@ -2336,16 +2247,12 @@ func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.C } res := resTmp.(*Starship) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Starship(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Starship(ctx, field.Selections, res) } // nolint: vetshadow @@ -2363,6 +2270,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -2372,16 +2280,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -2393,6 +2297,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -2402,16 +2307,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var reviewImplementors = []string{"Review"} @@ -2457,6 +2358,7 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Stars, nil @@ -2469,11 +2371,7 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -2485,6 +2383,7 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Commentary, nil @@ -2494,15 +2393,11 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -2514,6 +2409,7 @@ func (ec *executionContext) _Review_time(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Time, nil @@ -2523,11 +2419,7 @@ func (ec *executionContext) _Review_time(ctx context.Context, field graphql.Coll } res := resTmp.(time.Time) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalTime(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalTime(res) } var starshipImplementors = []string{"Starship"} @@ -2589,6 +2481,7 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -2601,11 +2494,7 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalID(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalID(res) } // nolint: vetshadow @@ -2617,6 +2506,7 @@ func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -2629,11 +2519,7 @@ func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.Co } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2651,6 +2537,7 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Starship().Length(rctx, obj, args["unit"].(*LengthUnit)) @@ -2663,11 +2550,7 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. } res := resTmp.(float64) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalFloat(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalFloat(res) } // nolint: vetshadow @@ -2679,6 +2562,7 @@ func (ec *executionContext) _Starship_history(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.History, nil @@ -2691,29 +2575,25 @@ func (ec *executionContext) _Starship_history(ctx context.Context, field graphql } res := resTmp.([][]int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { - arr2 := make(graphql.Array, len(res[idx1])) + arr2 := make(graphql.Array, len(res[idx1])) - for idx2 := range res[idx1] { - arr2[idx2] = func() graphql.Marshaler { - return graphql.MarshalInt(res[idx1][idx2]) - }() - } + for idx2 := range res[idx1] { + arr2[idx2] = func() graphql.Marshaler { + return graphql.MarshalInt(res[idx1][idx2]) + }() + } - return arr2 - }() - } + return arr2 + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } var __DirectiveImplementors = []string{"__Directive"} @@ -2767,6 +2647,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -2779,11 +2660,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2795,6 +2672,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -2804,11 +2682,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2820,6 +2694,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -2832,20 +2707,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -2857,6 +2728,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -2869,44 +2741,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -2957,6 +2825,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -2969,11 +2838,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2985,6 +2850,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -2994,11 +2860,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3010,6 +2872,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -3022,11 +2885,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -3038,6 +2897,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -3047,11 +2907,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -3112,6 +2968,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -3124,11 +2981,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3140,6 +2993,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -3149,11 +3003,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3165,6 +3015,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -3177,44 +3028,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3226,6 +3073,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -3238,19 +3086,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3262,6 +3106,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -3274,11 +3119,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -3290,6 +3131,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -3299,11 +3141,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -3354,6 +3192,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -3366,11 +3205,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3382,6 +3217,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -3391,11 +3227,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3407,6 +3239,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -3419,19 +3252,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3443,6 +3272,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -3452,15 +3282,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -3516,6 +3342,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -3528,44 +3355,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3577,6 +3400,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -3589,19 +3413,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3613,6 +3433,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -3622,16 +3443,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3643,6 +3460,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -3652,16 +3470,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -3673,6 +3487,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -3685,44 +3500,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -3780,6 +3591,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -3792,11 +3604,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3808,6 +3616,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -3817,15 +3626,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -3837,6 +3642,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -3846,11 +3652,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -3868,6 +3670,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -3877,44 +3680,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3926,6 +3725,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -3935,44 +3735,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -3984,6 +3780,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -3993,44 +3790,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -4048,6 +3841,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -4057,44 +3851,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -4106,6 +3896,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -4115,44 +3906,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -4164,6 +3951,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -4173,16 +3961,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) _Character(ctx context.Context, sel ast.SelectionSet, obj *Character) graphql.Marshaler { diff --git a/example/todo/generated.go b/example/todo/generated.go index 9f86f72e94..13489688ab 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -362,6 +362,7 @@ func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.MyMutation().CreateTodo(rctx, args["todo"].(TodoInput)) @@ -374,12 +375,8 @@ func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field gr } res := resTmp.(Todo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Todo(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Todo(ctx, field.Selections, &res) } // nolint: vetshadow @@ -397,6 +394,7 @@ func (ec *executionContext) _MyMutation_updateTodo(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.MyMutation().UpdateTodo(rctx, args["id"].(int), args["changes"].(map[string]interface{})) @@ -406,16 +404,12 @@ func (ec *executionContext) _MyMutation_updateTodo(ctx context.Context, field gr } res := resTmp.(*Todo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Todo(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Todo(ctx, field.Selections, res) } var myQueryImplementors = []string{"MyQuery"} @@ -488,6 +482,7 @@ func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.MyQuery().Todo(rctx, args["id"].(int)) @@ -497,16 +492,12 @@ func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.Col } res := resTmp.(*Todo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Todo(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Todo(ctx, field.Selections, res) } // nolint: vetshadow @@ -518,6 +509,7 @@ func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.MyQuery().LastTodo(rctx) @@ -527,16 +519,12 @@ func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql } res := resTmp.(*Todo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Todo(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Todo(ctx, field.Selections, res) } // nolint: vetshadow @@ -548,6 +536,7 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.MyQuery().Todos(rctx) @@ -560,44 +549,40 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co } res := resTmp.([]Todo) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec._Todo(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec._Todo(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -615,6 +600,7 @@ func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -624,16 +610,12 @@ func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -645,6 +627,7 @@ func (ec *executionContext) _MyQuery___schema(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -654,16 +637,12 @@ func (ec *executionContext) _MyQuery___schema(ctx context.Context, field graphql } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var todoImplementors = []string{"Todo"} @@ -715,6 +694,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -727,11 +707,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte } res := resTmp.(int) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalInt(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalInt(res) } // nolint: vetshadow @@ -743,6 +719,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Text, nil @@ -755,11 +732,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -771,6 +744,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Done, nil @@ -783,11 +757,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } var __DirectiveImplementors = []string{"__Directive"} @@ -841,6 +811,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -853,11 +824,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -869,6 +836,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -878,11 +846,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -894,6 +858,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -906,20 +871,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -931,6 +892,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -943,44 +905,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -1031,6 +989,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1043,11 +1002,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1059,6 +1014,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1068,11 +1024,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1084,6 +1036,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1096,11 +1049,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1112,6 +1061,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1121,11 +1071,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -1186,6 +1132,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1198,11 +1145,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1214,6 +1157,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1223,11 +1167,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1239,6 +1179,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1251,44 +1192,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1300,6 +1237,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1312,19 +1250,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1336,6 +1270,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1348,11 +1283,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1364,6 +1295,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1373,11 +1305,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -1428,6 +1356,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1440,11 +1369,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1456,6 +1381,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1465,11 +1391,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1481,6 +1403,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1493,19 +1416,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1517,6 +1436,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -1526,15 +1446,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -1590,6 +1506,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -1602,44 +1519,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1651,6 +1564,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -1663,19 +1577,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1687,6 +1597,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -1696,16 +1607,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1717,6 +1624,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -1726,16 +1634,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1747,6 +1651,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -1759,44 +1664,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -1854,6 +1755,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -1866,11 +1768,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1882,6 +1780,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -1891,15 +1790,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -1911,6 +1806,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -1920,11 +1816,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1942,6 +1834,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -1951,44 +1844,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2000,6 +1889,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -2009,44 +1899,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2058,6 +1944,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -2067,44 +1954,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2122,6 +2005,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -2131,44 +2015,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2180,6 +2060,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -2189,44 +2070,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2238,6 +2115,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -2247,16 +2125,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func UnmarshalTodoInput(v interface{}) (TodoInput, error) { diff --git a/integration/generated.go b/integration/generated.go index e8da5ca07b..042cc7e493 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -374,6 +374,7 @@ func (ec *executionContext) _Element_child(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Element().Child(rctx, obj) @@ -386,12 +387,8 @@ func (ec *executionContext) _Element_child(ctx context.Context, field graphql.Co } res := resTmp.(models.Element) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return ec._Element(ctx, field.Selections, &res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Element(ctx, field.Selections, &res) } // nolint: vetshadow @@ -403,6 +400,7 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Element().Error(rctx, obj) @@ -415,11 +413,7 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -431,6 +425,7 @@ func (ec *executionContext) _Element_mismatched(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Element().Mismatched(rctx, obj) @@ -440,20 +435,16 @@ func (ec *executionContext) _Element_mismatched(ctx context.Context, field graph } res := resTmp.([]bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalBoolean(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalBoolean(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } var queryImplementors = []string{"Query"} @@ -538,6 +529,7 @@ func (ec *executionContext) _Query_path(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Path(rctx) @@ -547,48 +539,44 @@ func (ec *executionContext) _Query_path(ctx context.Context, field graphql.Colle } res := resTmp.([]*models.Element) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: res[idx1], + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { - - if res[idx1] == nil { - return graphql.Null - } + arr1[idx1] = func() graphql.Marshaler { - return ec._Element(ctx, field.Selections, res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) - } + if res[idx1] == nil { + return graphql.Null + } + return ec._Element(ctx, field.Selections, res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -606,6 +594,7 @@ func (ec *executionContext) _Query_date(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Date(rctx, args["filter"].(models.DateFilter)) @@ -618,11 +607,7 @@ func (ec *executionContext) _Query_date(ctx context.Context, field graphql.Colle } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -634,6 +619,7 @@ func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Viewer(rctx) @@ -643,16 +629,12 @@ func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.Col } res := resTmp.(*models.Viewer) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._Viewer(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._Viewer(ctx, field.Selections, res) } // nolint: vetshadow @@ -664,6 +646,7 @@ func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().JSONEncoding(rctx) @@ -676,11 +659,7 @@ func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -698,6 +677,7 @@ func (ec *executionContext) _Query_error(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.Query().Error(rctx, args["type"].(*models.ErrorType)) @@ -710,11 +690,7 @@ func (ec *executionContext) _Query_error(ctx context.Context, field graphql.Coll } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -732,6 +708,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectType(args["name"].(string)), nil @@ -741,16 +718,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -762,6 +735,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.introspectSchema(), nil @@ -771,16 +745,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } res := resTmp.(*introspection.Schema) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Schema(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Schema(ctx, field.Selections, res) } var userImplementors = []string{"User"} @@ -832,6 +802,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -844,11 +815,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -860,6 +827,7 @@ func (ec *executionContext) _User_likes(ctx context.Context, field graphql.Colle } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return ec.resolvers.User().Likes(rctx, obj) @@ -872,20 +840,16 @@ func (ec *executionContext) _User_likes(ctx context.Context, field graphql.Colle } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } var viewerImplementors = []string{"Viewer"} @@ -924,6 +888,7 @@ func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.User, nil @@ -933,16 +898,12 @@ func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.Coll } res := resTmp.(*remote_api.User) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec._User(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec._User(ctx, field.Selections, res) } var __DirectiveImplementors = []string{"__Directive"} @@ -996,6 +957,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1008,11 +970,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1024,6 +982,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1033,11 +992,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1049,6 +1004,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -1061,20 +1017,16 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } res := resTmp.([]string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) + arr1 := make(graphql.Array, len(res)) - for idx1 := range res { - arr1[idx1] = func() graphql.Marshaler { - return graphql.MarshalString(res[idx1]) - }() - } + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return arr1 } // nolint: vetshadow @@ -1086,6 +1038,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1098,44 +1051,40 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __EnumValueImplementors = []string{"__EnumValue"} @@ -1186,6 +1135,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1198,11 +1148,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1214,6 +1160,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1223,11 +1170,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1239,6 +1182,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1251,11 +1195,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1267,6 +1207,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1276,11 +1217,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __FieldImplementors = []string{"__Field"} @@ -1341,6 +1278,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1353,11 +1291,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1369,6 +1303,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1378,11 +1313,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1394,6 +1325,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -1406,44 +1338,40 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1455,6 +1383,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1467,19 +1396,15 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1491,6 +1416,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated, nil @@ -1503,11 +1429,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } res := resTmp.(bool) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalBoolean(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalBoolean(res) } // nolint: vetshadow @@ -1519,6 +1441,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason, nil @@ -1528,11 +1451,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } var __InputValueImplementors = []string{"__InputValue"} @@ -1583,6 +1502,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -1595,11 +1515,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1611,6 +1527,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description, nil @@ -1620,11 +1537,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -1636,6 +1549,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -1648,19 +1562,15 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1672,6 +1582,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -1681,15 +1592,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } var __SchemaImplementors = []string{"__Schema"} @@ -1745,6 +1652,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -1757,44 +1665,40 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -1806,6 +1710,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -1818,19 +1723,15 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - if !ec.HasError(rctx) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + if res == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1842,6 +1743,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -1851,16 +1753,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1872,6 +1770,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -1881,16 +1780,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } // nolint: vetshadow @@ -1902,6 +1797,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -1914,44 +1810,40 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } res := resTmp.([]introspection.Directive) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Directive(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } var __TypeImplementors = []string{"__Type"} @@ -2009,6 +1901,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -2021,11 +1914,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2037,6 +1926,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -2046,15 +1936,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } res := resTmp.(*string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } - return graphql.MarshalString(*res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if res == nil { + return graphql.Null + } + return graphql.MarshalString(*res) } // nolint: vetshadow @@ -2066,6 +1952,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -2075,11 +1962,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } res := resTmp.(string) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - return graphql.MarshalString(res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return graphql.MarshalString(res) } // nolint: vetshadow @@ -2097,6 +1980,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Fields(args["includeDeprecated"].(bool)), nil @@ -2106,44 +1990,40 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } res := resTmp.([]introspection.Field) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Field(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2155,6 +2035,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -2164,44 +2045,40 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2213,6 +2090,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -2222,44 +2100,40 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } res := resTmp.([]introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___Type(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2277,6 +2151,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.EnumValues(args["includeDeprecated"].(bool)), nil @@ -2286,44 +2161,40 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } res := resTmp.([]introspection.EnumValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2335,6 +2206,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -2344,44 +2216,40 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } res := resTmp.([]introspection.InputValue) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - - arr1 := make(graphql.Array, len(res)) - var wg sync.WaitGroup - isLen1 := len(res) == 1 - if !isLen1 { - wg.Add(len(res)) - } + arr1 := make(graphql.Array, len(res)) + var wg sync.WaitGroup - for idx1 := range res { - idx1 := idx1 - rctx := &graphql.ResolverContext{ - Index: &idx1, - Result: &res[idx1], - } - ctx := graphql.WithResolverContext(ctx, rctx) - f := func(idx1 int) { - if !isLen1 { - defer wg.Done() - } - arr1[idx1] = func() graphql.Marshaler { + isLen1 := len(res) == 1 + if !isLen1 { + wg.Add(len(res)) + } - return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }() - } - if isLen1 { - f(idx1) - } else { - go f(idx1) + for idx1 := range res { + idx1 := idx1 + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) + f := func(idx1 int) { + if !isLen1 { + defer wg.Done() } + arr1[idx1] = func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) + }() } - wg.Wait() - return arr1 - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + if isLen1 { + f(idx1) + } else { + go f(idx1) + } + + } + wg.Wait() + return arr1 } // nolint: vetshadow @@ -2393,6 +2261,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } ctx = graphql.WithResolverContext(ctx, rctx) ctx = ec.Tracer.StartFieldExecution(ctx) + defer ec.Tracer.EndFieldExecution(ctx) resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -2402,16 +2271,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } res := resTmp.(*introspection.Type) rctx.Result = res - resMarshaler := func() graphql.Marshaler { - if res == nil { - return graphql.Null - } + if res == nil { + return graphql.Null + } - return ec.___Type(ctx, field.Selections, res) - }() - ec.Tracer.EndFieldExecution(ctx) - return resMarshaler + return ec.___Type(ctx, field.Selections, res) } func UnmarshalDateFilter(v interface{}) (models.DateFilter, error) {