diff --git a/codegen/import_build.go b/codegen/import_build.go index d8f2a2def22..d634834eb27 100644 --- a/codegen/import_build.go +++ b/codegen/import_build.go @@ -5,6 +5,7 @@ import ( "go/build" "sort" "strconv" + // Import and ignore the ambient imports listed below so dependency managers // don't prune unused code for us. Both lists should be kept in sync. _ "github.com/99designs/gqlgen/graphql" diff --git a/codegen/object.go b/codegen/object.go index 84a989ce4b5..93d1952102f 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -212,21 +212,31 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ } var arr = "arr" + strconv.Itoa(depth) var index = "idx" + strconv.Itoa(depth) + var usePtr bool + if len(remainingMods) == 1 && !isPtr { + usePtr = true + } return tpl(`{{.arr}} := graphql.Array{} for {{.index}} := range {{.val}} { + {{- if not .isScalar }} + rctx := &graphql.ResolverContext{ + Index: &{{.index}}, + Result: {{ if .usePtr }}&{{end}}{{.val}}[{{.index}}], + } + ctx := graphql.WithResolverContext(ctx, rctx) + {{- end}} {{.arr}} = append({{.arr}}, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex({{.index}}) - defer rctx.Pop() {{ .next }} }()) } return {{.arr}}`, map[string]interface{}{ - "val": val, - "arr": arr, - "index": index, - "next": f.doWriteJson(val+"["+index+"]", remainingMods[1:], astType.Elem, false, depth+1), + "val": val, + "arr": arr, + "index": index, + "isScalar": f.IsScalar, + "usePtr": usePtr, + "next": f.doWriteJson(val+"["+index+"]", remainingMods[1:], astType.Elem, false, depth+1), }) case f.IsScalar: @@ -239,7 +249,11 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ if !isPtr { val = "&" + val } - return fmt.Sprintf("return ec._%s(ctx, field.Selections, %s)", f.GQLType, val) + return tpl(` + return ec._{{.type}}(ctx, field.Selections, {{.val}})`, map[string]interface{}{ + "type": f.GQLType, + "val": val, + }) } } diff --git a/codegen/templates/data.go b/codegen/templates/data.go index 31291b0235d..db2816c0234 100644 --- a/codegen/templates/data.go +++ b/codegen/templates/data.go @@ -2,7 +2,7 @@ package templates var data = map[string]string{ "args.gotpl": "\t{{- if . }}args := map[string]interface{}{} {{end}}\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\tec.Error(ctx, err)\n\t\t\t\t{{- if $arg.Stream }}\n\t\t\t\t\treturn nil\n\t\t\t\t{{- else }}\n\t\t\t\t\treturn graphql.Null\n\t\t\t\t{{- end }}\n\t\t\t}\n\t\t}\n\t\targs[{{$arg.GQLName|quote}}] = arg{{$i}}\n\t{{- 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\t{{ template \"args.gotpl\" $field.Args }}\n\t\t{{- end }}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{Field: field})\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\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\t{{ template \"args.gotpl\" $field.Args }}\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\tresTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) {\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\t{{ $field.WriteJson }}\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\t{{ template \"args.gotpl\" $field.Args }}\n\t\t{{- end }}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\t\tField: field,\n\t\t})\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\t{{ template \"args.gotpl\" $field.Args }}\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\tresTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) {\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}\n}\n\ntype Config struct {\n\tResolvers ResolverRoot\n\tDirectives DirectiveRoot\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\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\ntype executableSchema struct {\n\tresolvers ResolverRoot\n\tdirectives DirectiveRoot\n}\n\nfunc (e *executableSchema) Schema() *ast.Schema {\n\treturn parsedSchema\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}\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}\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\treturn &graphql.Response{\n\t\t\t\tData: buf,\n\t\t\t\tErrors: ec.Errors,\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, 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\t{{ template \"args.gotpl\" $directive.Args }}\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&ast.Source{Name: {{.SchemaFilename|quote}}, Input: {{.SchemaRaw|rawQuote}}},\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 bfc2f1592ff..ca4d81f4259 100644 --- a/codegen/templates/field.gotpl +++ b/codegen/templates/field.gotpl @@ -7,7 +7,9 @@ rawArgs := field.ArgumentMap(ec.Variables) {{ template "args.gotpl" $field.Args }} {{- end }} - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{Field: field}) + ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + Field: field, + }) results, err := ec.resolvers.{{ $field.ShortInvocation }} if err != nil { ec.Error(ctx, err) @@ -24,6 +26,7 @@ } } {{ else }} + // nolint: vetshadow func (ec *executionContext) _{{$object.GQLType}}_{{$field.GQLName}}(ctx context.Context, field graphql.CollectedField, {{if not $object.Root}}obj *{{$object.FullName}}{{end}}) graphql.Marshaler { {{- if $field.Args }} rawArgs := field.ArgumentMap(ec.Variables) @@ -57,6 +60,7 @@ return graphql.Null } res := resTmp.({{$field.Signature}}) + rctx.Result = res {{ $field.WriteJson }} } {{ end }} diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 0ddf302e9be..d5dd9431f73 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -121,6 +121,7 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Circle", @@ -135,9 +136,11 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } +// nolint: vetshadow func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Circle", @@ -152,6 +155,7 @@ func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -197,6 +201,7 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: vetshadow func (ec *executionContext) _Error_id(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -214,9 +219,11 @@ func (ec *executionContext) _Error_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -231,9 +238,11 @@ func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -251,9 +260,11 @@ func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, fie return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -271,6 +282,7 @@ func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -313,6 +325,7 @@ func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.Selecti return out } +// nolint: vetshadow func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field graphql.CollectedField, obj *ForcedResolver) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "ForcedResolver", @@ -327,10 +340,12 @@ func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field gra return graphql.Null } res := resTmp.(*Circle) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Circle(ctx, field.Selections, res) } @@ -364,6 +379,7 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.CollectedField, obj *InnerObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "InnerObject", @@ -381,6 +397,7 @@ func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -414,6 +431,7 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele return out } +// nolint: vetshadow func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field graphql.CollectedField, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "InvalidIdentifier", @@ -431,6 +449,7 @@ func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field gra return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -464,6 +483,7 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * return out } +// nolint: vetshadow func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedField, obj *introspection1.It) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "It", @@ -481,6 +501,7 @@ func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedF return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -514,6 +535,7 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphql.CollectedField, obj *OuterObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "OuterObject", @@ -531,6 +553,8 @@ func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphq return graphql.Null } res := resTmp.(InnerObject) + rctx.Result = res + return ec._InnerObject(ctx, field.Selections, &res) } @@ -643,6 +667,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -657,13 +682,16 @@ func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field return graphql.Null } res := resTmp.(*invalid_packagename.InvalidIdentifier) + rctx.Result = res if res == nil { return graphql.Null } + return ec._InvalidIdentifier(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_collision(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -678,13 +706,16 @@ func (ec *executionContext) _Query_collision(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(*introspection1.It) + rctx.Result = res if res == nil { return graphql.Null } + return ec._It(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -716,6 +747,7 @@ func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*bool) + rctx.Result = res if res == nil { return graphql.Null @@ -723,6 +755,7 @@ func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.C return graphql.MarshalBoolean(*res) } +// nolint: vetshadow func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -754,6 +787,7 @@ func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(*bool) + rctx.Result = res if res == nil { return graphql.Null @@ -761,6 +795,7 @@ func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql. return graphql.MarshalBoolean(*res) } +// nolint: vetshadow func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -813,6 +848,7 @@ func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graph return graphql.Null } res := resTmp.(*bool) + rctx.Result = res if res == nil { return graphql.Null @@ -820,6 +856,7 @@ func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graph return graphql.MarshalBoolean(*res) } +// nolint: vetshadow func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -834,22 +871,28 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap return graphql.Null } res := resTmp.([][]*OuterObject) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() arr2 := graphql.Array{} for idx2 := range res[idx1] { + rctx := &graphql.ResolverContext{ + Index: &idx2, + Result: res[idx1][idx2], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr2 = append(arr2, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx2) - defer rctx.Pop() if res[idx1][idx2] == nil { return graphql.Null } + return ec._OuterObject(ctx, field.Selections, res[idx1][idx2]) }()) } @@ -859,6 +902,7 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -893,9 +937,11 @@ func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -910,22 +956,27 @@ func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]*Shape) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() if res[idx1] == nil { return graphql.Null } + return ec._Shape(ctx, field.Selections, res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -940,13 +991,16 @@ func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*Error) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Error(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -964,9 +1018,11 @@ func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1236,9 +1292,11 @@ func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphq return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1265,13 +1323,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -1286,10 +1347,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -1324,6 +1387,7 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet return out } +// nolint: vetshadow func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1338,9 +1402,11 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } +// nolint: vetshadow func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1355,9 +1421,11 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } +// nolint: vetshadow func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1372,6 +1440,7 @@ func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -1417,6 +1486,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1434,9 +1504,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1451,9 +1523,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1471,18 +1545,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1500,12 +1573,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -1551,6 +1628,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1568,9 +1646,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1585,9 +1665,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1605,9 +1687,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1622,6 +1706,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1674,6 +1759,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1691,9 +1777,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1708,9 +1796,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1728,18 +1818,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1757,6 +1852,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1764,9 +1860,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1784,9 +1882,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1801,6 +1901,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1843,6 +1944,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1860,9 +1962,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1877,9 +1981,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1897,6 +2003,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1904,9 +2011,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1921,6 +2030,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1972,6 +2082,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1989,18 +2100,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2018,6 +2134,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -2025,9 +2142,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2042,13 +2161,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2063,13 +2185,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2087,12 +2212,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -2145,6 +2274,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2162,9 +2292,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2179,6 +2311,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -2186,6 +2319,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2200,9 +2334,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -2229,18 +2365,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2255,18 +2396,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2281,18 +2427,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -2319,18 +2470,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2345,18 +2501,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2371,10 +2532,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/example/chat/generated.go b/example/chat/generated.go index 8456b645081..e634ff91d7e 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -155,6 +155,7 @@ func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Chatroom", @@ -172,9 +173,11 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Chatroom", @@ -192,12 +195,16 @@ func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]Message) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Message(ctx, field.Selections, &res[idx1]) }()) } @@ -249,6 +256,7 @@ func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -266,9 +274,11 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _Message_text(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -286,9 +296,11 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -306,9 +318,11 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -326,6 +340,7 @@ func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphq return graphql.Null } res := resTmp.(time.Time) + rctx.Result = res return graphql.MarshalTime(res) } @@ -363,6 +378,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } +// nolint: vetshadow func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -412,6 +428,8 @@ func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(Message) + rctx.Result = res + return ec._Message(ctx, field.Selections, &res) } @@ -455,6 +473,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_room(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -481,13 +500,16 @@ func (ec *executionContext) _Query_room(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(*Chatroom) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Chatroom(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -514,13 +536,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -535,10 +560,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -576,7 +603,9 @@ func (ec *executionContext) _Subscription_messageAdded(ctx context.Context, fiel } } args["roomName"] = arg0 - ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{Field: field}) + ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ + Field: field, + }) results, err := ec.resolvers.Subscription().MessageAdded(ctx, args["roomName"].(string)) if err != nil { ec.Error(ctx, err) @@ -588,7 +617,9 @@ func (ec *executionContext) _Subscription_messageAdded(ctx context.Context, fiel return nil } var out graphql.OrderedMap - out.Add(field.Alias, func() graphql.Marshaler { return ec._Message(ctx, field.Selections, &res) }()) + out.Add(field.Alias, func() graphql.Marshaler { + return ec._Message(ctx, field.Selections, &res) + }()) return &out } } @@ -635,6 +666,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -652,9 +684,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -669,9 +703,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -689,18 +725,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -718,12 +753,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -769,6 +808,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -786,9 +826,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -803,9 +845,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -823,9 +867,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -840,6 +886,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -892,6 +939,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -909,9 +957,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -926,9 +976,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -946,18 +998,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -975,6 +1032,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -982,9 +1040,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1002,9 +1062,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1019,6 +1081,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1061,6 +1124,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1078,9 +1142,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1095,9 +1161,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1115,6 +1183,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1122,9 +1191,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1139,6 +1210,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1190,6 +1262,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1207,18 +1280,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1236,6 +1314,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1243,9 +1322,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1260,13 +1341,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1281,13 +1365,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1305,12 +1392,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -1363,6 +1454,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1380,9 +1472,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1397,6 +1491,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1404,6 +1499,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1418,9 +1514,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1447,18 +1545,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1473,18 +1576,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1499,18 +1607,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1537,18 +1650,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1563,18 +1681,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1589,10 +1712,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/example/config/generated.go b/example/config/generated.go index 7fea7a18d68..b8cb067bac0 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -129,6 +129,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } +// nolint: vetshadow func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -158,6 +159,8 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap return graphql.Null } res := resTmp.(Todo) + rctx.Result = res + return ec._Todo(ctx, field.Selections, &res) } @@ -204,6 +207,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -221,18 +225,23 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.([]Todo) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Todo(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -259,13 +268,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -280,10 +292,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -342,6 +356,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -359,9 +374,11 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -379,9 +396,11 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } +// nolint: vetshadow func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -399,9 +418,11 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -419,9 +440,11 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -439,6 +462,8 @@ func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(User) + rctx.Result = res + return ec._User(ctx, field.Selections, &res) } @@ -477,6 +502,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -494,9 +520,11 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -514,6 +542,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -559,6 +588,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -576,9 +606,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -593,9 +625,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -613,18 +647,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -642,12 +675,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -693,6 +730,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -710,9 +748,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -727,9 +767,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -747,9 +789,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -764,6 +808,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -816,6 +861,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -833,9 +879,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -850,9 +898,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -870,18 +920,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -899,6 +954,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -906,9 +962,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -926,9 +984,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -943,6 +1003,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -985,6 +1046,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1002,9 +1064,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1019,9 +1083,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1039,6 +1105,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1046,9 +1113,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1063,6 +1132,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1114,6 +1184,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1131,18 +1202,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1160,6 +1236,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1167,9 +1244,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1184,13 +1263,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1205,13 +1287,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1229,12 +1314,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -1287,6 +1376,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1304,9 +1394,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1321,6 +1413,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1328,6 +1421,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1342,9 +1436,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1371,18 +1467,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1397,18 +1498,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1423,18 +1529,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1461,18 +1572,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1487,18 +1603,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1513,10 +1634,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 2c7ba01013c..cc027df1569 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -127,6 +127,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -144,9 +145,11 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } +// nolint: vetshadow func (ec *executionContext) _Address_street(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -164,9 +167,11 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Address_country(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -184,6 +189,7 @@ func (ec *executionContext) _Address_country(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -235,6 +241,7 @@ func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -252,9 +259,11 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } +// nolint: vetshadow func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -272,9 +281,11 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Customer_address(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -289,13 +300,16 @@ func (ec *executionContext) _Customer_address(ctx context.Context, field graphql return graphql.Null } res := resTmp.(*Address) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Address(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -310,12 +324,16 @@ func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql. return graphql.Null } res := resTmp.([]Order) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Order(ctx, field.Selections, &res[idx1]) }()) } @@ -352,6 +370,7 @@ func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _Item_name(ctx context.Context, field graphql.CollectedField, obj *Item) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Item", @@ -369,6 +388,7 @@ func (ec *executionContext) _Item_name(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -419,6 +439,7 @@ func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: vetshadow func (ec *executionContext) _Order_id(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -436,9 +457,11 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } +// nolint: vetshadow func (ec *executionContext) _Order_date(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -456,9 +479,11 @@ func (ec *executionContext) _Order_date(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(time.Time) + rctx.Result = res return graphql.MarshalTime(res) } +// nolint: vetshadow func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -476,9 +501,11 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } +// nolint: vetshadow func (ec *executionContext) _Order_items(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -493,12 +520,16 @@ func (ec *executionContext) _Order_items(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.([]Item) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Item(ctx, field.Selections, &res[idx1]) }()) } @@ -557,6 +588,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_customers(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -571,18 +603,23 @@ func (ec *executionContext) _Query_customers(ctx context.Context, field graphql. return graphql.Null } res := resTmp.([]Customer) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Customer(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -620,18 +657,23 @@ func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql. return graphql.Null } res := resTmp.([]Customer) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Customer(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -680,18 +722,24 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. return graphql.Null } res := resTmp.([][]Customer) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() arr2 := graphql.Array{} for idx2 := range res[idx1] { + rctx := &graphql.ResolverContext{ + Index: &idx2, + Result: &res[idx1][idx2], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr2 = append(arr2, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx2) - defer rctx.Pop() + return ec._Customer(ctx, field.Selections, &res[idx1][idx2]) }()) } @@ -701,6 +749,7 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -727,13 +776,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -748,10 +800,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -797,6 +851,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -814,9 +869,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -831,9 +888,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -851,18 +910,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -880,12 +938,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -931,6 +993,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -948,9 +1011,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -965,9 +1030,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -985,9 +1052,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1002,6 +1071,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1054,6 +1124,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1071,9 +1142,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1088,9 +1161,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1108,18 +1183,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1137,6 +1217,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1144,9 +1225,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1164,9 +1247,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1181,6 +1266,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1223,6 +1309,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1240,9 +1327,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1257,9 +1346,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1277,6 +1368,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1284,9 +1376,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1301,6 +1395,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1352,6 +1447,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1369,18 +1465,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1398,6 +1499,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1405,9 +1507,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1422,13 +1526,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1443,13 +1550,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1467,12 +1577,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -1525,6 +1639,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1542,9 +1657,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1559,6 +1676,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1566,6 +1684,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1580,9 +1699,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1609,18 +1730,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1635,18 +1761,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1661,18 +1792,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1699,18 +1835,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1725,18 +1866,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1751,10 +1897,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/example/scalars/generated.go b/example/scalars/generated.go index 4ab0d65deca..c4207e32199 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -116,6 +116,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -133,9 +134,11 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(external.ObjectID) + rctx.Result = res return model.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _Address_location(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -150,6 +153,7 @@ func (ec *executionContext) _Address_location(ctx context.Context, field graphql return graphql.Null } res := resTmp.(*model.Point) + rctx.Result = res if res == nil { return graphql.Null @@ -206,6 +210,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -232,13 +237,16 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(*model.User) + rctx.Result = res if res == nil { return graphql.Null } + return ec._User(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -268,18 +276,23 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]model.User) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._User(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -306,13 +319,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -327,10 +343,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -399,6 +417,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -416,9 +435,11 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return graphql.Null } res := resTmp.(external.ObjectID) + rctx.Result = res return model.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -436,9 +457,11 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _User_created(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -453,9 +476,11 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(time.Time) + rctx.Result = res return model.MarshalTimestamp(res) } +// nolint: vetshadow func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -473,9 +498,11 @@ func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(model.Banned) + rctx.Result = res return graphql.MarshalBoolean(bool(res)) } +// nolint: vetshadow func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -493,9 +520,11 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _User_customResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -513,9 +542,11 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap return graphql.Null } res := resTmp.(model.Point) + rctx.Result = res return res } +// nolint: vetshadow func (ec *executionContext) _User_address(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -530,9 +561,12 @@ func (ec *executionContext) _User_address(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(model.Address) + rctx.Result = res + return ec._Address(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _User_tier(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -547,6 +581,7 @@ func (ec *executionContext) _User_tier(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(model.Tier) + rctx.Result = res return res } @@ -592,6 +627,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -609,9 +645,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -626,9 +664,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -646,18 +686,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -675,12 +714,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -726,6 +769,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -743,9 +787,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -760,9 +806,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -780,9 +828,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -797,6 +847,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -849,6 +900,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -866,9 +918,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -883,9 +937,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -903,18 +959,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -932,6 +993,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -939,9 +1001,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -959,9 +1023,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -976,6 +1042,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1018,6 +1085,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1035,9 +1103,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1052,9 +1122,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1072,6 +1144,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1079,9 +1152,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1096,6 +1171,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1147,6 +1223,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1164,18 +1241,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1193,6 +1275,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1200,9 +1283,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1217,13 +1302,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1238,13 +1326,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1262,12 +1353,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -1320,6 +1415,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1337,9 +1433,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1354,6 +1452,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1361,6 +1460,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1375,9 +1475,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1404,18 +1506,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1430,18 +1537,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1456,18 +1568,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1494,18 +1611,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1520,18 +1642,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1546,10 +1673,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/example/selection/generated.go b/example/selection/generated.go index 58155f057e0..ab508ececb7 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -116,6 +116,7 @@ func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -133,9 +134,11 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -153,9 +156,11 @@ func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(time.Time) + rctx.Result = res return graphql.MarshalTime(res) } +// nolint: vetshadow func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -170,18 +175,17 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -196,12 +200,10 @@ func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } @@ -247,6 +249,7 @@ func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _Post_message(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -264,9 +267,11 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -284,9 +289,11 @@ func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(time.Time) + rctx.Result = res return graphql.MarshalTime(res) } +// nolint: vetshadow func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -301,18 +308,17 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -327,12 +333,10 @@ func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } @@ -379,6 +383,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_events(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -393,18 +398,23 @@ func (ec *executionContext) _Query_events(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]Event) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Event(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -431,13 +441,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -452,10 +465,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -501,6 +516,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -518,9 +534,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -535,9 +553,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -555,18 +575,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -584,12 +603,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -635,6 +658,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -652,9 +676,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -669,9 +695,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -689,9 +717,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -706,6 +736,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -758,6 +789,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -775,9 +807,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -792,9 +826,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -812,18 +848,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -841,6 +882,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -848,9 +890,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -868,9 +912,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -885,6 +931,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -927,6 +974,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -944,9 +992,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -961,9 +1011,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -981,6 +1033,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -988,9 +1041,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1005,6 +1060,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1056,6 +1112,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1073,18 +1130,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1102,6 +1164,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1109,9 +1172,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1126,13 +1191,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1147,13 +1215,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1171,12 +1242,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -1229,6 +1304,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1246,9 +1322,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1263,6 +1341,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1270,6 +1349,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1284,9 +1364,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1313,18 +1395,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1339,18 +1426,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1365,18 +1457,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1403,18 +1500,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1429,18 +1531,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1455,10 +1562,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/example/starwars/generated.go b/example/starwars/generated.go index a9514437f3d..bd208bb5242 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -178,6 +178,7 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: vetshadow func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -195,9 +196,11 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -215,9 +218,11 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -232,18 +237,23 @@ func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]Character) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Character(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -293,9 +303,12 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field return graphql.Null } res := resTmp.(FriendsConnection) + rctx.Result = res + return ec._FriendsConnection(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -313,18 +326,17 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. return graphql.Null } res := resTmp.([]Episode) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return res[idx1] }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -339,6 +351,7 @@ func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field gr return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -390,6 +403,7 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele return out } +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -407,9 +421,11 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -424,18 +440,23 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field return graphql.Null } res := resTmp.([]FriendsEdge) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._FriendsEdge(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -450,18 +471,23 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel return graphql.Null } res := resTmp.([]Character) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Character(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -479,6 +505,8 @@ func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, fie return graphql.Null } res := resTmp.(PageInfo) + rctx.Result = res + return ec._PageInfo(ctx, field.Selections, &res) } @@ -514,6 +542,7 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsEdge", @@ -531,9 +560,11 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsEdge", @@ -548,6 +579,8 @@ func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql return graphql.Null } res := resTmp.(Character) + rctx.Result = res + return ec._Character(ctx, field.Selections, &res) } @@ -620,6 +653,7 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: vetshadow func (ec *executionContext) _Human_id(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -637,9 +671,11 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _Human_name(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -657,9 +693,11 @@ func (ec *executionContext) _Human_name(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Human_height(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -689,9 +727,11 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } +// nolint: vetshadow func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -706,9 +746,11 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } +// nolint: vetshadow func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -723,18 +765,23 @@ func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]Character) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Character(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -784,9 +831,12 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field return graphql.Null } res := resTmp.(FriendsConnection) + rctx.Result = res + return ec._FriendsConnection(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -804,18 +854,17 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. return graphql.Null } res := resTmp.([]Episode) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return res[idx1] }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Human_starships(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -830,12 +879,16 @@ func (ec *executionContext) _Human_starships(ctx context.Context, field graphql. return graphql.Null } res := resTmp.([]Starship) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Starship(ctx, field.Selections, &res[idx1]) }()) } @@ -873,6 +926,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } +// nolint: vetshadow func (ec *executionContext) _Mutation_createReview(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -909,10 +963,12 @@ func (ec *executionContext) _Mutation_createReview(ctx context.Context, field gr return graphql.Null } res := resTmp.(*Review) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Review(ctx, field.Selections, res) } @@ -956,6 +1012,7 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -973,9 +1030,11 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -993,9 +1052,11 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -1013,6 +1074,7 @@ func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1098,6 +1160,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1124,9 +1187,12 @@ func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(Character) + rctx.Result = res + return ec._Character(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1171,18 +1237,23 @@ func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]Review) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Review(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1212,18 +1283,23 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]SearchResult) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._SearchResult(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query_character(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1250,9 +1326,12 @@ func (ec *executionContext) _Query_character(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(Character) + rctx.Result = res + return ec._Character(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1279,13 +1358,16 @@ func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*Droid) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Droid(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_human(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1312,13 +1394,16 @@ func (ec *executionContext) _Query_human(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*Human) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Human(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1345,13 +1430,16 @@ func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*Starship) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Starship(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1378,13 +1466,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -1399,10 +1490,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -1440,6 +1533,7 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1457,9 +1551,11 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } +// nolint: vetshadow func (ec *executionContext) _Review_commentary(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1474,6 +1570,7 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1481,6 +1578,7 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) _Review_time(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1495,6 +1593,7 @@ func (ec *executionContext) _Review_time(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(time.Time) + rctx.Result = res return graphql.MarshalTime(res) } @@ -1548,6 +1647,7 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1565,9 +1665,11 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } +// nolint: vetshadow func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1585,9 +1687,11 @@ func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Starship_length(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1617,9 +1721,11 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } +// nolint: vetshadow func (ec *executionContext) _Starship_history(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1637,18 +1743,13 @@ func (ec *executionContext) _Starship_history(ctx context.Context, field graphql return graphql.Null } res := resTmp.([][]int) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() arr2 := graphql.Array{} for idx2 := range res[idx1] { arr2 = append(arr2, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx2) - defer rctx.Pop() return graphql.MarshalInt(res[idx1][idx2]) }()) } @@ -1700,6 +1801,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1717,9 +1819,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1734,9 +1838,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1754,18 +1860,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1783,12 +1888,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -1834,6 +1943,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1851,9 +1961,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1868,9 +1980,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1888,9 +2002,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1905,6 +2021,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1957,6 +2074,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1974,9 +2092,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1991,9 +2111,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2011,18 +2133,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2040,6 +2167,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -2047,9 +2175,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2067,9 +2197,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2084,6 +2216,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2126,6 +2259,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2143,9 +2277,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2160,9 +2296,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2180,6 +2318,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -2187,9 +2326,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2204,6 +2345,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -2255,6 +2397,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2272,18 +2415,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2301,6 +2449,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -2308,9 +2457,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2325,13 +2476,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2346,13 +2500,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2370,12 +2527,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -2428,6 +2589,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2445,9 +2607,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2462,6 +2626,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -2469,6 +2634,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2483,9 +2649,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -2512,18 +2680,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2538,18 +2711,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2564,18 +2742,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -2602,18 +2785,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2628,18 +2816,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2654,10 +2847,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/example/todo/generated.go b/example/todo/generated.go index 795abe71236..559b103e73c 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -132,6 +132,7 @@ func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSe return out } +// nolint: vetshadow func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -161,9 +162,12 @@ func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field gr return graphql.Null } res := resTmp.(Todo) + rctx.Result = res + return ec._Todo(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _MyMutation_updateTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -200,10 +204,12 @@ func (ec *executionContext) _MyMutation_updateTodo(ctx context.Context, field gr return graphql.Null } res := resTmp.(*Todo) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } @@ -268,6 +274,7 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) return out } +// nolint: vetshadow func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -294,13 +301,16 @@ func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*Todo) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _MyQuery_authenticatedTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -327,13 +337,16 @@ func (ec *executionContext) _MyQuery_authenticatedTodo(ctx context.Context, fiel return graphql.Null } res := resTmp.(*Todo) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -348,13 +361,16 @@ func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql return graphql.Null } res := resTmp.(*Todo) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -372,18 +388,23 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]Todo) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec._Todo(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -410,13 +431,16 @@ func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _MyQuery___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -431,10 +455,12 @@ func (ec *executionContext) _MyQuery___schema(ctx context.Context, field graphql return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -478,6 +504,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -495,9 +522,11 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } +// nolint: vetshadow func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -515,9 +544,11 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -535,6 +566,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -580,6 +612,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -597,9 +630,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -614,9 +649,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -634,18 +671,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -663,12 +699,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -714,6 +754,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -731,9 +772,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -748,9 +791,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -768,9 +813,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -785,6 +832,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -837,6 +885,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -854,9 +903,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -871,9 +922,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -891,18 +944,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -920,6 +978,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -927,9 +986,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -947,9 +1008,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -964,6 +1027,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1006,6 +1070,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1023,9 +1088,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1040,9 +1107,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1060,6 +1129,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1067,9 +1137,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1084,6 +1156,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1135,6 +1208,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1152,18 +1226,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1181,6 +1260,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1188,9 +1268,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1205,13 +1287,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1226,13 +1311,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1250,12 +1338,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -1308,6 +1400,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1325,9 +1418,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1342,6 +1437,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1349,6 +1445,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1363,9 +1460,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1392,18 +1491,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1418,18 +1522,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1444,18 +1553,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1482,18 +1596,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1508,18 +1627,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1534,10 +1658,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/graphql/context.go b/graphql/context.go index 66c63aaf54b..6baee83c69c 100644 --- a/graphql/context.go +++ b/graphql/context.go @@ -82,19 +82,18 @@ type ResolverContext struct { Args map[string]interface{} // The raw field Field CollectedField - - // indicies tracks the array indicies only. all field aliases come from the context stack - indicies []int + // The index of array in path. + Index *int + // The result object of resolver + Result interface{} } func (r *ResolverContext) Path() []interface{} { var path []interface{} for it := r; it != nil; it = it.Parent { - for i := len(it.indicies) - 1; i >= 0; i-- { - path = append(path, it.indicies[i]) - } - - if it.Field.Field != nil { + if it.Index != nil { + path = append(path, *it.Index) + } else if it.Field.Field != nil { path = append(path, it.Field.Alias) } } @@ -108,14 +107,6 @@ func (r *ResolverContext) Path() []interface{} { return path } -func (r *ResolverContext) PushIndex(index int) { - r.indicies = append(r.indicies, index) -} - -func (r *ResolverContext) Pop() { - r.indicies = r.indicies[0 : len(r.indicies)-1] -} - func GetResolverContext(ctx context.Context) *ResolverContext { val, _ := ctx.Value(resolver).(*ResolverContext) return val diff --git a/integration/generated.go b/integration/generated.go index 4b3b2546b19..f7802ec3f8b 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -142,6 +142,7 @@ func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) _Element_child(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -159,9 +160,12 @@ func (ec *executionContext) _Element_child(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(models.Element) + rctx.Result = res + return ec._Element(ctx, field.Selections, &res) } +// nolint: vetshadow func (ec *executionContext) _Element_error(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -179,9 +183,11 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _Element_mismatched(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -196,12 +202,10 @@ func (ec *executionContext) _Element_mismatched(ctx context.Context, field graph return graphql.Null } res := resTmp.([]bool) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalBoolean(res[idx1]) }()) } @@ -281,6 +285,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: vetshadow func (ec *executionContext) _Query_path(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -295,22 +300,27 @@ func (ec *executionContext) _Query_path(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.([]*models.Element) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() if res[idx1] == nil { return graphql.Null } + return ec._Element(ctx, field.Selections, res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) _Query_date(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -340,9 +350,11 @@ func (ec *executionContext) _Query_date(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -357,13 +369,16 @@ func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*models.Viewer) + rctx.Result = res if res == nil { return graphql.Null } + return ec._Viewer(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -381,9 +396,11 @@ func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _Query_error(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -413,9 +430,11 @@ func (ec *executionContext) _Query_error(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -442,13 +461,16 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -463,10 +485,12 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(*introspection.Schema) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -510,6 +534,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: vetshadow func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -527,9 +552,11 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) _User_likes(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -547,12 +574,10 @@ func (ec *executionContext) _User_likes(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } @@ -586,6 +611,7 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.CollectedField, obj *models.Viewer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Viewer", @@ -600,10 +626,12 @@ func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*remote_api.User) + rctx.Result = res if res == nil { return graphql.Null } + return ec._User(ctx, field.Selections, res) } @@ -649,6 +677,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -666,9 +695,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -683,9 +714,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -703,18 +736,17 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return graphql.Null } res := resTmp.([]string) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() return graphql.MarshalString(res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -732,12 +764,16 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } @@ -783,6 +819,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -800,9 +837,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -817,9 +856,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -837,9 +878,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -854,6 +897,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -906,6 +950,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -923,9 +968,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -940,9 +987,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -960,18 +1009,23 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -989,6 +1043,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -996,9 +1051,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1016,9 +1073,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1033,6 +1092,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1075,6 +1135,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1092,9 +1153,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1109,9 +1172,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1129,6 +1194,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1136,9 +1202,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1153,6 +1221,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1204,6 +1273,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1221,18 +1291,23 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1250,6 +1325,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { if !ec.HasError(rctx) { @@ -1257,9 +1333,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1274,13 +1352,16 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1295,13 +1376,16 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1319,12 +1403,16 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return graphql.Null } res := resTmp.([]introspection.Directive) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Directive(ctx, field.Selections, &res[idx1]) }()) } @@ -1377,6 +1465,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1394,9 +1483,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1411,6 +1502,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(*string) + rctx.Result = res if res == nil { return graphql.Null @@ -1418,6 +1510,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1432,9 +1525,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } +// nolint: vetshadow func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1461,18 +1556,23 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.([]introspection.Field) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Field(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1487,18 +1587,23 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1513,18 +1618,23 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return graphql.Null } res := resTmp.([]introspection.Type) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___Type(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1551,18 +1661,23 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return graphql.Null } res := resTmp.([]introspection.EnumValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1577,18 +1692,23 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return graphql.Null } res := resTmp.([]introspection.InputValue) + rctx.Result = res arr1 := graphql.Array{} for idx1 := range res { + rctx := &graphql.ResolverContext{ + Index: &idx1, + Result: &res[idx1], + } + ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) - rctx.PushIndex(idx1) - defer rctx.Pop() + return ec.___InputValue(ctx, field.Selections, &res[idx1]) }()) } return arr1 } +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1603,10 +1723,12 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(*introspection.Type) + rctx.Result = res if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) }