From 072363c777fa35f726d5c6f0626720dab296bc3b Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 21 Aug 2018 16:44:30 +0900 Subject: [PATCH 1/5] add ParentObject field to ResolverContext --- codegen/templates/data.go | 2 +- codegen/templates/field.gotpl | 1 + codegen/testserver/generated.go | 294 ++++++++++++---------- example/chat/generated.go | 266 +++++++++++--------- example/config/generated.go | 273 +++++++++++--------- example/dataloader/generated.go | 308 +++++++++++++---------- example/scalars/generated.go | 294 ++++++++++++---------- example/selection/generated.go | 280 ++++++++++++--------- example/starwars/generated.go | 434 ++++++++++++++++++-------------- example/todo/generated.go | 245 ++++++++++-------- graphql/context.go | 2 + integration/generated.go | 266 +++++++++++--------- 12 files changed, 1524 insertions(+), 1141 deletions(-) diff --git a/codegen/templates/data.go b/codegen/templates/data.go index eb9f2e1beb..71b8d69501 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\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{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\t{{if not $object.Root}}ParentObject: obj,{{end}}\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\treturn graphql.Null\n\t\t}\n\t\tres := resTmp.({{$field.Signature}})\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 d46c87add3..938acfad08 100644 --- a/codegen/templates/field.gotpl +++ b/codegen/templates/field.gotpl @@ -33,6 +33,7 @@ Object: {{$object.GQLType|quote}}, Args: {{if $field.Args }}args{{else}}nil{{end}}, Field: field, + {{if not $object.Root}}ParentObject: obj,{{end}} } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 293bba0719..0cba21a8b5 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -117,9 +117,10 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Circle", - Args: nil, - Field: field, + Object: "Circle", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -134,9 +135,10 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Circle", - Args: nil, - Field: field, + Object: "Circle", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -179,9 +181,10 @@ func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.Selecti func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field graphql.CollectedField, obj *ForcedResolver) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "ForcedResolver", - Args: nil, - Field: field, + Object: "ForcedResolver", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -222,9 +225,10 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.CollectedField, obj *InnerObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "InnerObject", - Args: nil, - Field: field, + Object: "InnerObject", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -262,9 +266,10 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field graphql.CollectedField, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "InvalidIdentifier", - Args: nil, - Field: field, + Object: "InvalidIdentifier", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -302,9 +307,10 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedField, obj *introspection1.It) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "It", - Args: nil, - Field: field, + Object: "It", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -342,9 +348,10 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphql.CollectedField, obj *OuterObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "OuterObject", - Args: nil, - Field: field, + Object: "OuterObject", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1064,9 +1071,10 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Rectangle", - Args: nil, - Field: field, + Object: "Rectangle", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1081,9 +1089,10 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Rectangle", - Args: nil, - Field: field, + Object: "Rectangle", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1098,9 +1107,10 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Rectangle", - Args: nil, - Field: field, + Object: "Rectangle", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1144,9 +1154,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1161,9 +1172,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1178,9 +1190,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1204,9 +1217,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1259,9 +1273,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1276,9 +1291,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1293,9 +1309,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1310,9 +1327,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1360,9 +1378,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1377,9 +1396,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1394,9 +1414,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1420,9 +1441,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1440,9 +1462,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1457,9 +1480,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1503,9 +1527,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1520,9 +1545,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1537,9 +1563,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1557,9 +1584,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1608,9 +1636,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1634,9 +1663,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1654,9 +1684,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1674,9 +1705,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1694,9 +1726,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1759,9 +1792,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1776,9 +1810,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1796,9 +1831,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1825,9 +1861,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1851,9 +1888,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1877,9 +1915,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1915,9 +1954,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1941,9 +1981,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1967,9 +2008,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/chat/generated.go b/example/chat/generated.go index 3b396fab92..22d5b9c417 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -147,9 +147,10 @@ func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Chatroom", - Args: nil, - Field: field, + Object: "Chatroom", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -164,9 +165,10 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Chatroom", - Args: nil, - Field: field, + Object: "Chatroom", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -219,9 +221,10 @@ func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, + Object: "Message", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -236,9 +239,10 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle func (ec *executionContext) _Message_text(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, + Object: "Message", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -253,9 +257,10 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, + Object: "Message", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -270,9 +275,10 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, + Object: "Message", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -563,9 +569,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -580,9 +587,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -597,9 +605,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -623,9 +632,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -678,9 +688,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -695,9 +706,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -712,9 +724,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -729,9 +742,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -779,9 +793,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -796,9 +811,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -813,9 +829,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -839,9 +856,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -859,9 +877,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -876,9 +895,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -922,9 +942,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -939,9 +960,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -956,9 +978,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -976,9 +999,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1027,9 +1051,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1053,9 +1078,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1073,9 +1099,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1093,9 +1120,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1113,9 +1141,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1178,9 +1207,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1195,9 +1225,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1215,9 +1246,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1244,9 +1276,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1270,9 +1303,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1296,9 +1330,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1334,9 +1369,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1360,9 +1396,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1386,9 +1423,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/config/generated.go b/example/config/generated.go index cb2e75e8b6..149780c89b 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -303,9 +303,10 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -320,9 +321,10 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -337,9 +339,10 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -354,9 +357,10 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -371,9 +375,10 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -413,9 +418,10 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -430,9 +436,10 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -476,9 +483,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -493,9 +501,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -510,9 +519,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -536,9 +546,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -591,9 +602,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -608,9 +620,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -625,9 +638,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -642,9 +656,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -692,9 +707,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -709,9 +725,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -726,9 +743,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -752,9 +770,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -772,9 +791,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -789,9 +809,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -835,9 +856,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -852,9 +874,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -869,9 +892,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -889,9 +913,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -940,9 +965,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -966,9 +992,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -986,9 +1013,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1006,9 +1034,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1026,9 +1055,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1091,9 +1121,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1108,9 +1139,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1128,9 +1160,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1157,9 +1190,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1183,9 +1217,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1209,9 +1244,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1247,9 +1283,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1273,9 +1310,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1299,9 +1337,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 5c5c7e33d3..c99e3cb828 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -116,9 +116,10 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, + Object: "Address", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -133,9 +134,10 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle func (ec *executionContext) _Address_street(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, + Object: "Address", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -150,9 +152,10 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C func (ec *executionContext) _Address_country(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, + Object: "Address", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -205,9 +208,10 @@ func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, + Object: "Customer", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -222,9 +226,10 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, + Object: "Customer", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -239,9 +244,10 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co func (ec *executionContext) _Customer_address(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, + Object: "Customer", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -259,9 +265,10 @@ func (ec *executionContext) _Customer_address(ctx context.Context, field graphql func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, + Object: "Customer", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -308,9 +315,10 @@ func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Item_name(ctx context.Context, field graphql.CollectedField, obj *Item) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Item", - Args: nil, - Field: field, + Object: "Item", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -359,9 +367,10 @@ func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, ob func (ec *executionContext) _Order_id(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, + Object: "Order", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -376,9 +385,10 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect func (ec *executionContext) _Order_date(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, + Object: "Order", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -393,9 +403,10 @@ func (ec *executionContext) _Order_date(ctx context.Context, field graphql.Colle func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, + Object: "Order", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -410,9 +421,10 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col func (ec *executionContext) _Order_items(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, + Object: "Order", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -709,9 +721,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -726,9 +739,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -743,9 +757,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -769,9 +784,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -824,9 +840,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -841,9 +858,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -858,9 +876,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -875,9 +894,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -925,9 +945,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -942,9 +963,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -959,9 +981,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -985,9 +1008,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1005,9 +1029,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1022,9 +1047,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1068,9 +1094,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1085,9 +1112,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1102,9 +1130,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1122,9 +1151,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1173,9 +1203,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1199,9 +1230,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1219,9 +1251,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1239,9 +1272,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1259,9 +1293,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1324,9 +1359,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1341,9 +1377,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1361,9 +1398,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1390,9 +1428,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1416,9 +1455,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1442,9 +1482,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1480,9 +1521,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1506,9 +1548,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1532,9 +1575,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/scalars/generated.go b/example/scalars/generated.go index dd75719736..f12a2c64be 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -111,9 +111,10 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, + Object: "Address", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -128,9 +129,10 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle func (ec *executionContext) _Address_location(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, + Object: "Address", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -358,9 +360,10 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -375,9 +378,10 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -392,9 +396,10 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec func (ec *executionContext) _User_created(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -409,9 +414,10 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -426,9 +432,10 @@ func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.Co func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -443,9 +450,10 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g func (ec *executionContext) _User_customResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -460,9 +468,10 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap func (ec *executionContext) _User_address(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -477,9 +486,10 @@ func (ec *executionContext) _User_address(ctx context.Context, field graphql.Col func (ec *executionContext) _User_tier(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -523,9 +533,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -540,9 +551,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -557,9 +569,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -583,9 +596,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -638,9 +652,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -655,9 +670,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -672,9 +688,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -689,9 +706,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -739,9 +757,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -756,9 +775,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -773,9 +793,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -799,9 +820,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -819,9 +841,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -836,9 +859,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -882,9 +906,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -899,9 +924,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -916,9 +942,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -936,9 +963,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -987,9 +1015,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1013,9 +1042,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1033,9 +1063,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1053,9 +1084,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1073,9 +1105,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1138,9 +1171,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1155,9 +1189,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1175,9 +1210,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1204,9 +1240,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1230,9 +1267,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1256,9 +1294,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1294,9 +1333,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1320,9 +1360,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1346,9 +1387,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/selection/generated.go b/example/selection/generated.go index e8d19b1c53..3f807fea72 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -108,9 +108,10 @@ func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, + Object: "Like", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -125,9 +126,10 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, + Object: "Like", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -142,9 +144,10 @@ func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.Collec func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, + Object: "Like", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -168,9 +171,10 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, + Object: "Like", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -223,9 +227,10 @@ func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Post_message(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, + Object: "Post", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -240,9 +245,10 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, + Object: "Post", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -257,9 +263,10 @@ func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.Collec func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, + Object: "Post", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -283,9 +290,10 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, + Object: "Post", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -452,9 +460,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -469,9 +478,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -486,9 +496,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -512,9 +523,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -567,9 +579,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -584,9 +597,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -601,9 +615,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -618,9 +633,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -668,9 +684,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -685,9 +702,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -702,9 +720,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -728,9 +747,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -748,9 +768,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -765,9 +786,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -811,9 +833,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -828,9 +851,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -845,9 +869,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -865,9 +890,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -916,9 +942,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -942,9 +969,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -962,9 +990,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -982,9 +1011,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1002,9 +1032,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1067,9 +1098,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1084,9 +1116,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1104,9 +1137,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1133,9 +1167,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1159,9 +1194,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1185,9 +1221,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1223,9 +1260,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1249,9 +1287,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1275,9 +1314,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/starwars/generated.go b/example/starwars/generated.go index e0b971931a..ec6838a0f6 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -164,9 +164,10 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, + Object: "Droid", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -181,9 +182,10 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, + Object: "Droid", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -198,9 +200,10 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, + Object: "Droid", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -256,9 +259,10 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field } args["after"] = arg1 rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: args, - Field: field, + Object: "Droid", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -273,9 +277,10 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, + Object: "Droid", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -299,9 +304,10 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, + Object: "Droid", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -354,9 +360,10 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, + Object: "FriendsConnection", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -371,9 +378,10 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, + Object: "FriendsConnection", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -397,9 +405,10 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, + Object: "FriendsConnection", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -423,9 +432,10 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, + Object: "FriendsConnection", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -465,9 +475,10 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsEdge", - Args: nil, - Field: field, + Object: "FriendsEdge", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -482,9 +493,10 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsEdge", - Args: nil, - Field: field, + Object: "FriendsEdge", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -549,9 +561,10 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob func (ec *executionContext) _Human_id(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, + Object: "Human", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -566,9 +579,10 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect func (ec *executionContext) _Human_name(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, + Object: "Human", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -595,9 +609,10 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col } args["unit"] = arg0 rctx := &graphql.ResolverContext{ - Object: "Human", - Args: args, - Field: field, + Object: "Human", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -612,9 +627,10 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, + Object: "Human", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -629,9 +645,10 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, + Object: "Human", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -687,9 +704,10 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field } args["after"] = arg1 rctx := &graphql.ResolverContext{ - Object: "Human", - Args: args, - Field: field, + Object: "Human", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -704,9 +722,10 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, + Object: "Human", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -730,9 +749,10 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. func (ec *executionContext) _Human_starships(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, + Object: "Human", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -852,9 +872,10 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, - Field: field, + Object: "PageInfo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -869,9 +890,10 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, - Field: field, + Object: "PageInfo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -886,9 +908,10 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, - Field: field, + Object: "PageInfo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1299,9 +1322,10 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Review", - Args: nil, - Field: field, + Object: "Review", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1316,9 +1340,10 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col func (ec *executionContext) _Review_commentary(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Review", - Args: nil, - Field: field, + Object: "Review", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1336,9 +1361,10 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq func (ec *executionContext) _Review_time(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Review", - Args: nil, - Field: field, + Object: "Review", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1387,9 +1413,10 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: nil, - Field: field, + Object: "Starship", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1404,9 +1431,10 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: nil, - Field: field, + Object: "Starship", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1433,9 +1461,10 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. } args["unit"] = arg0 rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: args, - Field: field, + Object: "Starship", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1450,9 +1479,10 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. func (ec *executionContext) _Starship_history(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: nil, - Field: field, + Object: "Starship", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1514,9 +1544,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1531,9 +1562,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1548,9 +1580,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1574,9 +1607,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1629,9 +1663,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1646,9 +1681,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1663,9 +1699,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1680,9 +1717,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1730,9 +1768,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1747,9 +1786,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1764,9 +1804,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1790,9 +1831,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1810,9 +1852,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1827,9 +1870,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1873,9 +1917,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1890,9 +1935,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1907,9 +1953,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1927,9 +1974,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1978,9 +2026,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2004,9 +2053,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2024,9 +2074,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2044,9 +2095,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2064,9 +2116,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2129,9 +2182,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2146,9 +2200,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2166,9 +2221,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2195,9 +2251,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2221,9 +2278,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2247,9 +2305,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2285,9 +2344,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2311,9 +2371,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2337,9 +2398,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/todo/generated.go b/example/todo/generated.go index 69f28e9a52..7e3c509972 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -441,9 +441,10 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -458,9 +459,10 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -475,9 +477,10 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, + Object: "Todo", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -521,9 +524,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -538,9 +542,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -555,9 +560,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -581,9 +587,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -636,9 +643,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -653,9 +661,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -670,9 +679,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -687,9 +697,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -737,9 +748,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -754,9 +766,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -771,9 +784,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -797,9 +811,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -817,9 +832,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -834,9 +850,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -880,9 +897,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -897,9 +915,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -914,9 +933,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -934,9 +954,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -985,9 +1006,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1011,9 +1033,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1031,9 +1054,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1051,9 +1075,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1071,9 +1096,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1136,9 +1162,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1153,9 +1180,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1173,9 +1201,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1202,9 +1231,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1228,9 +1258,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1254,9 +1285,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1292,9 +1324,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1318,9 +1351,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1344,9 +1378,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/graphql/context.go b/graphql/context.go index 63c01c8679..0e17b42d5d 100644 --- a/graphql/context.go +++ b/graphql/context.go @@ -82,6 +82,8 @@ type ResolverContext struct { Args map[string]interface{} // The raw field Field CollectedField + // The parent object of the field + ParentObject interface{} // indicies tracks the array indicies only. all field aliases come from the context stack indicies []int diff --git a/integration/generated.go b/integration/generated.go index ecd15597e0..1cb1e907ec 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -133,9 +133,10 @@ func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Element_child(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Element", - Args: nil, - Field: field, + Object: "Element", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -150,9 +151,10 @@ func (ec *executionContext) _Element_child(ctx context.Context, field graphql.Co func (ec *executionContext) _Element_error(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Element", - Args: nil, - Field: field, + Object: "Element", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -167,9 +169,10 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co func (ec *executionContext) _Element_mismatched(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Element", - Args: nil, - Field: field, + Object: "Element", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -459,9 +462,10 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -476,9 +480,10 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec func (ec *executionContext) _User_likes(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, + Object: "User", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -525,9 +530,10 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.CollectedField, obj *models.Viewer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Viewer", - Args: nil, - Field: field, + Object: "Viewer", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -574,9 +580,10 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -591,9 +598,10 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -608,9 +616,10 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -634,9 +643,10 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, + Object: "__Directive", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -689,9 +699,10 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -706,9 +717,10 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -723,9 +735,10 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -740,9 +753,10 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, + Object: "__EnumValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -790,9 +804,10 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -807,9 +822,10 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -824,9 +840,10 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -850,9 +867,10 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -870,9 +888,10 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -887,9 +906,10 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, + Object: "__Field", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -933,9 +953,10 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -950,9 +971,10 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -967,9 +989,10 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -987,9 +1010,10 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, + Object: "__InputValue", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1038,9 +1062,10 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1064,9 +1089,10 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1084,9 +1110,10 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1104,9 +1131,10 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1124,9 +1152,10 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, + Object: "__Schema", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1189,9 +1218,10 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1206,9 +1236,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1226,9 +1257,10 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1255,9 +1287,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1281,9 +1314,10 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1307,9 +1341,10 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1345,9 +1380,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, + Object: "__Type", + Args: args, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1371,9 +1407,10 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1397,9 +1434,10 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, + Object: "__Type", + Args: nil, + Field: field, + ParentObject: obj, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { From 09e4bf8c481a8fbdc2ed34bad80051ded1a2023e Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 22 Aug 2018 16:03:35 +0900 Subject: [PATCH 2/5] add Result field instead of ParentObject field --- codegen/object.go | 8 +- codegen/templates/data.go | 4 +- codegen/templates/field.gotpl | 1 - codegen/templates/object.gotpl | 2 + codegen/testserver/generated.go | 454 +++++++++++------------ example/chat/generated.go | 370 +++++++++---------- example/config/generated.go | 377 +++++++++---------- example/dataloader/generated.go | 456 +++++++++++------------ example/scalars/generated.go | 398 ++++++++++---------- example/selection/generated.go | 416 ++++++++++----------- example/starwars/generated.go | 628 +++++++++++++++----------------- example/todo/generated.go | 347 +++++++++--------- graphql/context.go | 19 +- integration/generated.go | 388 ++++++++++---------- 14 files changed, 1831 insertions(+), 2037 deletions(-) diff --git a/codegen/object.go b/codegen/object.go index 84a989ce4b..b064c7cb1e 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -215,12 +215,12 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ return tpl(`{{.arr}} := graphql.Array{} for {{.index}} := range {{.val}} { - {{.arr}} = append({{.arr}}, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + {{.arr}} = append({{.arr}}, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex({{.index}}) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) {{ .next }} - }()) + }(ctx)) } return {{.arr}}`, map[string]interface{}{ "val": val, diff --git a/codegen/templates/data.go b/codegen/templates/data.go index 20c6a60fe4..6ec13d88c2 100644 --- a/codegen/templates/data.go +++ b/codegen/templates/data.go @@ -2,12 +2,12 @@ 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\t{{if not $object.Root}}ParentObject: obj,{{end}}\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{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", "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", "models.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{{ range $model := .Models }}\n\t{{- if .IsInterface }}\n\t\ttype {{.GoType}} interface {}\n\t{{- else }}\n\t\ttype {{.GoType}} struct {\n\t\t\t{{- range $field := .Fields }}\n\t\t\t\t{{- if $field.GoFieldName }}\n\t\t\t\t\t{{ $field.GoFieldName }} {{$field.Signature}} `json:\"{{$field.GQLName}}\"`\n\t\t\t\t{{- else }}\n\t\t\t\t\t{{ $field.GoFKName }} {{$field.GoFKType}}\n\t\t\t\t{{- end }}\n\t\t\t{{- end }}\n\t\t}\n\t{{- end }}\n{{- end}}\n\n{{ range $enum := .Enums }}\n\ttype {{.GoType}} string\n\tconst (\n\t{{ range $value := .Values -}}\n\t\t{{with .Description}} {{.|prefixLines \"// \"}} {{end}}\n\t\t{{$enum.GoType}}{{ .Name|toCamel }} {{$enum.GoType}} = {{.Name|quote}}\n\t{{- end }}\n\t)\n\n\tfunc (e {{.GoType}}) IsValid() bool {\n\t\tswitch e {\n\t\tcase {{ range $index, $element := .Values}}{{if $index}},{{end}}{{ $enum.GoType }}{{ $element.Name|toCamel }}{{end}}:\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tfunc (e {{.GoType}}) String() string {\n\t\treturn string(e)\n\t}\n\n\tfunc (e *{{.GoType}}) UnmarshalGQL(v interface{}) error {\n\t\tstr, ok := v.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"enums must be strings\")\n\t\t}\n\n\t\t*e = {{.GoType}}(str)\n\t\tif !e.IsValid() {\n\t\t\treturn fmt.Errorf(\"%s is not a valid {{.GQLType}}\", str)\n\t\t}\n\t\treturn nil\n\t}\n\n\tfunc (e {{.GoType}}) MarshalGQL(w io.Writer) {\n\t\tfmt.Fprint(w, strconv.Quote(e.String()))\n\t}\n\n{{- end }}\n", - "object.gotpl": "{{ $object := . }}\n\nvar {{ $object.GQLType|lcFirst}}Implementors = {{$object.Implementors}}\n\n// nolint: gocyclo, errcheck, gas, goconst\n{{- if .Stream }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\tObject: {{$object.GQLType|quote}},\n\t})\n\tif len(fields) != 1 {\n\t\tec.Errorf(ctx, \"must subscribe to exactly one stream\")\n\t\treturn nil\n\t}\n\n\tswitch fields[0].Name {\n\t{{- range $field := $object.Fields }}\n\tcase \"{{$field.GQLName}}\":\n\t\treturn ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, fields[0])\n\t{{- end }}\n\tdefault:\n\t\tpanic(\"unknown field \" + strconv.Quote(fields[0].Name))\n\t}\n}\n{{- else }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet{{if not $object.Root}}, obj *{{$object.FullName}} {{end}}) graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\t{{if $object.Root}}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\t\tObject: {{$object.GQLType|quote}},\n\t\t})\n\t{{end}}\n\n\t{{if $object.IsConcurrent}} var wg sync.WaitGroup {{end}}\n\tout := graphql.NewOrderedMap(len(fields))\n\tinvalid := false\n\tfor i, field := range fields {\n\t\tout.Keys[i] = field.Alias\n\n\t\tswitch field.Name {\n\t\tcase \"__typename\":\n\t\t\tout.Values[i] = graphql.MarshalString({{$object.GQLType|quote}})\n\t\t{{- range $field := $object.Fields }}\n\t\tcase \"{{$field.GQLName}}\":\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\twg.Add(1)\n\t\t\t\tgo func(i int, field graphql.CollectedField) {\n\t\t\t{{- end }}\n\t\t\t\tout.Values[i] = ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, field{{if not $object.Root}}, obj{{end}})\n\t\t\t\t{{- if $field.ASTType.NonNull }}\n\t\t\t\t\tif out.Values[i] == graphql.Null {\n\t\t\t\t\t\tinvalid = true\n\t\t\t\t\t}\n\t\t\t\t{{- end }}\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\t\twg.Done()\n\t\t\t\t}(i, field)\n\t\t\t{{- end }}\n\t\t{{- end }}\n\t\tdefault:\n\t\t\tpanic(\"unknown field \" + strconv.Quote(field.Name))\n\t\t}\n\t}\n\t{{if $object.IsConcurrent}} wg.Wait() {{end}}\n\tif invalid { return graphql.Null }\n\treturn out\n}\n{{- end }}\n", + "object.gotpl": "{{ $object := . }}\n\nvar {{ $object.GQLType|lcFirst}}Implementors = {{$object.Implementors}}\n\n// nolint: gocyclo, errcheck, gas, goconst\n{{- if .Stream }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\tObject: {{$object.GQLType|quote}},\n\t})\n\tif len(fields) != 1 {\n\t\tec.Errorf(ctx, \"must subscribe to exactly one stream\")\n\t\treturn nil\n\t}\n\n\tswitch fields[0].Name {\n\t{{- range $field := $object.Fields }}\n\tcase \"{{$field.GQLName}}\":\n\t\treturn ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, fields[0])\n\t{{- end }}\n\tdefault:\n\t\tpanic(\"unknown field \" + strconv.Quote(fields[0].Name))\n\t}\n}\n{{- else }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet{{if not $object.Root}}, obj *{{$object.FullName}} {{end}}) graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\t{{if $object.Root}}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\t\tObject: {{$object.GQLType|quote}},\n\t\t})\n\t{{else}}\n\t\tgraphql.GetResolverContext(ctx).Result = obj\n\t{{end}}\n\n\t{{if $object.IsConcurrent}} var wg sync.WaitGroup {{end}}\n\tout := graphql.NewOrderedMap(len(fields))\n\tinvalid := false\n\tfor i, field := range fields {\n\t\tout.Keys[i] = field.Alias\n\n\t\tswitch field.Name {\n\t\tcase \"__typename\":\n\t\t\tout.Values[i] = graphql.MarshalString({{$object.GQLType|quote}})\n\t\t{{- range $field := $object.Fields }}\n\t\tcase \"{{$field.GQLName}}\":\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\twg.Add(1)\n\t\t\t\tgo func(i int, field graphql.CollectedField) {\n\t\t\t{{- end }}\n\t\t\t\tout.Values[i] = ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, field{{if not $object.Root}}, obj{{end}})\n\t\t\t\t{{- if $field.ASTType.NonNull }}\n\t\t\t\t\tif out.Values[i] == graphql.Null {\n\t\t\t\t\t\tinvalid = true\n\t\t\t\t\t}\n\t\t\t\t{{- end }}\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\t\twg.Done()\n\t\t\t\t}(i, field)\n\t\t\t{{- end }}\n\t\t{{- end }}\n\t\tdefault:\n\t\t\tpanic(\"unknown field \" + strconv.Quote(field.Name))\n\t\t}\n\t}\n\t{{if $object.IsConcurrent}} wg.Wait() {{end}}\n\tif invalid { return graphql.Null }\n\treturn out\n}\n{{- end }}\n", "resolver.gotpl": "//go:generate gorunpkg github.com/99designs/gqlgen\n\npackage {{ .PackageName }}\n\nimport (\n{{- range $import := .Imports }}\n\t{{- $import.Write }}\n{{ end }}\n)\n\ntype {{.ResolverType}} struct {}\n\n{{ range $object := .Objects -}}\n\t{{- if $object.HasResolvers -}}\n\t\tfunc (r *{{$.ResolverType}}) {{$object.GQLType}}() {{ $object.ResolverInterface.FullName }} {\n\t\t\treturn &{{lcFirst $object.GQLType}}Resolver{r}\n\t\t}\n\t{{ end -}}\n{{ end }}\n\n{{ range $object := .Objects -}}\n\t{{- if $object.HasResolvers -}}\n\t\ttype {{lcFirst $object.GQLType}}Resolver struct { *Resolver }\n\n\t\t{{ range $field := $object.Fields -}}\n\t\t\t{{- if $field.IsResolver -}}\n\t\t\tfunc (r *{{lcFirst $object.GQLType}}Resolver) {{ $field.ShortResolverDeclaration }} {\n\t\t\t\tpanic(\"not implemented\")\n\t\t\t}\n\t\t\t{{ end -}}\n\t\t{{ end -}}\n\t{{ end -}}\n{{ end }}\n", "server.gotpl": "package main\n\nimport (\n{{- range $import := .Imports }}\n\t{{- $import.Write }}\n{{ end }}\n)\n\nconst defaultPort = \"8080\"\n\nfunc main() {\n\tport := os.Getenv(\"PORT\")\n\tif port == \"\" {\n\t\tport = defaultPort\n\t}\n\n\thttp.Handle(\"/\", handler.Playground(\"GraphQL playground\", \"/query\"))\n\thttp.Handle(\"/query\", handler.GraphQL({{.ExecPackageName}}.NewExecutableSchema({{.ExecPackageName}}.Config{Resolvers: &{{.ResolverPackageName}}.Resolver{}})))\n\n\tlog.Printf(\"connect to http://localhost:%s/ for GraphQL playground\", port)\n\tlog.Fatal(http.ListenAndServe(\":\" + port, nil))\n}\n", } diff --git a/codegen/templates/field.gotpl b/codegen/templates/field.gotpl index a9176ff614..bfc2f1592f 100644 --- a/codegen/templates/field.gotpl +++ b/codegen/templates/field.gotpl @@ -33,7 +33,6 @@ Object: {{$object.GQLType|quote}}, Args: {{if $field.Args }}args{{else}}nil{{end}}, Field: field, - {{if not $object.Root}}ParentObject: obj,{{end}} } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/codegen/templates/object.gotpl b/codegen/templates/object.gotpl index e98cbe1ee5..810dad1536 100644 --- a/codegen/templates/object.gotpl +++ b/codegen/templates/object.gotpl @@ -30,6 +30,8 @@ func (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.Se ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: {{$object.GQLType|quote}}, }) + {{else}} + graphql.GetResolverContext(ctx).Result = obj {{end}} {{if $object.IsConcurrent}} var wg sync.WaitGroup {{end}} diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 9561b5f9f8..6a7dfe5bff 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -98,6 +98,8 @@ var circleImplementors = []string{"Circle", "Shape"} func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, obj *Circle) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, circleImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -123,10 +125,9 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Circle", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Circle", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -141,10 +142,9 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Circle", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Circle", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -163,6 +163,8 @@ var errorImplementors = []string{"Error"} func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, obj *Error) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, errorImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -201,10 +203,9 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob func (ec *executionContext) _Error_id(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Error", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Error", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -222,10 +223,9 @@ func (ec *executionContext) _Error_id(ctx context.Context, field graphql.Collect func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Error", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Error", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -240,10 +240,9 @@ func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Error", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Error", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -261,10 +260,9 @@ func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, fie func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Error", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Error", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -293,6 +291,8 @@ var forcedResolverImplementors = []string{"ForcedResolver"} func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.SelectionSet, obj *ForcedResolver) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, forcedResolverImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -321,10 +321,9 @@ func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.Selecti func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field graphql.CollectedField, obj *ForcedResolver) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "ForcedResolver", - Args: nil, - Field: field, - ParentObject: obj, + Object: "ForcedResolver", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -347,6 +346,8 @@ var innerObjectImplementors = []string{"InnerObject"} func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionSet, obj *InnerObject) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, innerObjectImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -373,10 +374,9 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.CollectedField, obj *InnerObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "InnerObject", - Args: nil, - Field: field, - ParentObject: obj, + Object: "InnerObject", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -398,6 +398,8 @@ var invalidIdentifierImplementors = []string{"InvalidIdentifier"} func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.SelectionSet, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, invalidIdentifierImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -424,10 +426,9 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field graphql.CollectedField, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "InvalidIdentifier", - Args: nil, - Field: field, - ParentObject: obj, + Object: "InvalidIdentifier", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -449,6 +450,8 @@ var itImplementors = []string{"It"} func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj *introspection1.It) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, itImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -475,10 +478,9 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedField, obj *introspection1.It) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "It", - Args: nil, - Field: field, - ParentObject: obj, + Object: "It", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -500,6 +502,8 @@ var outerObjectImplementors = []string{"OuterObject"} func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionSet, obj *OuterObject) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, outerObjectImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -526,10 +530,9 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphql.CollectedField, obj *OuterObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "OuterObject", - Args: nil, - Field: field, - ParentObject: obj, + Object: "OuterObject", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -847,25 +850,25 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap res := resTmp.([][]*OuterObject) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) arr2 := graphql.Array{} for idx2 := range res[idx1] { - arr2 = append(arr2, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx2) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) if res[idx1][idx2] == nil { return graphql.Null } return ec._OuterObject(ctx, field.Selections, res[idx1][idx2]) - }()) + }(ctx)) } return arr2 - }()) + }(ctx)) } return arr1 } @@ -923,16 +926,16 @@ func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.Col res := resTmp.([]*Shape) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) if res[idx1] == nil { return graphql.Null } return ec._Shape(ctx, field.Selections, res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1310,6 +1313,8 @@ var rectangleImplementors = []string{"Rectangle", "Shape"} func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet, obj *Rectangle) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, rectangleImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1337,10 +1342,9 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Rectangle", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Rectangle", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1355,10 +1359,9 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Rectangle", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Rectangle", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1373,10 +1376,9 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Rectangle", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Rectangle", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1395,6 +1397,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1433,10 +1437,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1454,10 +1457,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1472,10 +1474,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1490,22 +1491,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1520,12 +1520,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1536,6 +1536,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1571,10 +1573,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1592,10 +1593,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1610,10 +1610,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1631,10 +1630,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1653,6 +1651,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1698,10 +1698,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1719,10 +1718,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1737,10 +1735,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1755,22 +1752,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1795,10 +1791,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1816,10 +1811,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1838,6 +1832,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1873,10 +1869,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1894,10 +1889,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1912,10 +1906,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1940,10 +1933,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1966,6 +1958,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2006,10 +2000,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2024,22 +2017,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2064,10 +2056,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2086,10 +2077,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2108,10 +2098,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2126,12 +2115,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -2142,6 +2131,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2184,10 +2175,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2205,10 +2195,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2227,10 +2216,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2257,10 +2245,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2272,22 +2259,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2299,22 +2285,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2326,12 +2311,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -2350,10 +2335,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2365,22 +2349,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2392,22 +2375,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/chat/generated.go b/example/chat/generated.go index da628e3e74..e674b402fc 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -126,6 +126,8 @@ var chatroomImplementors = []string{"Chatroom"} func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, obj *Chatroom) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, chatroomImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -157,10 +159,9 @@ func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Chatroom", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Chatroom", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -178,10 +179,9 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Chatroom", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Chatroom", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -196,12 +196,12 @@ func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphq res := resTmp.([]Message) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Message(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -212,6 +212,8 @@ var messageImplementors = []string{"Message"} func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *Message) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, messageImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -253,10 +255,9 @@ func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Message", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -274,10 +275,9 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle func (ec *executionContext) _Message_text(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Message", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -295,10 +295,9 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Message", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -316,10 +315,9 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Message", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Message", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -605,6 +603,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -643,10 +643,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -664,10 +663,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -682,10 +680,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -700,22 +697,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -730,12 +726,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -746,6 +742,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -781,10 +779,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -802,10 +799,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -820,10 +816,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -841,10 +836,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -863,6 +857,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -908,10 +904,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -929,10 +924,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -947,10 +941,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -965,22 +958,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1005,10 +997,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1026,10 +1017,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1048,6 +1038,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1083,10 +1075,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1104,10 +1095,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1122,10 +1112,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1150,10 +1139,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1176,6 +1164,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1216,10 +1206,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1234,22 +1223,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1274,10 +1262,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1296,10 +1283,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1318,10 +1304,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1336,12 +1321,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1352,6 +1337,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1394,10 +1381,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1415,10 +1401,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1437,10 +1422,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1467,10 +1451,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1482,22 +1465,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1509,22 +1491,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1536,12 +1517,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1560,10 +1541,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1575,22 +1555,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1602,22 +1581,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/config/generated.go b/example/config/generated.go index cbaf10a318..d46311d725 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -223,12 +223,12 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll res := resTmp.([]Todo) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Todo(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -293,6 +293,8 @@ var todoImplementors = []string{"Todo"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, todoImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -344,10 +346,9 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -365,10 +366,9 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -386,10 +386,9 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -407,10 +406,9 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -428,10 +426,9 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -453,6 +450,8 @@ var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *User) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, userImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -484,10 +483,9 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -505,10 +503,9 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -530,6 +527,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -568,10 +567,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -589,10 +587,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -607,10 +604,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -625,22 +621,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -655,12 +650,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -671,6 +666,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -706,10 +703,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -727,10 +723,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -745,10 +740,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -766,10 +760,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -788,6 +781,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -833,10 +828,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -854,10 +848,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -872,10 +865,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -890,22 +882,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -930,10 +921,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -951,10 +941,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -973,6 +962,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1008,10 +999,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1029,10 +1019,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1047,10 +1036,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1075,10 +1063,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1101,6 +1088,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1141,10 +1130,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1159,22 +1147,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1199,10 +1186,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1221,10 +1207,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1243,10 +1228,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1261,12 +1245,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1277,6 +1261,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1319,10 +1305,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1340,10 +1325,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1362,10 +1346,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1392,10 +1375,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1407,22 +1389,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1434,22 +1415,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1461,12 +1441,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1485,10 +1465,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1500,22 +1479,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1527,22 +1505,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 209d7ba456..c3d73ac483 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -93,6 +93,8 @@ var addressImplementors = []string{"Address"} func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, obj *Address) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, addressImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -129,10 +131,9 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Address", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -150,10 +151,9 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle func (ec *executionContext) _Address_street(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Address", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -171,10 +171,9 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C func (ec *executionContext) _Address_country(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Address", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -196,6 +195,8 @@ var customerImplementors = []string{"Customer"} func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, obj *Customer) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, customerImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -240,10 +241,9 @@ func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Customer", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -261,10 +261,9 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Customer", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -282,10 +281,9 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co func (ec *executionContext) _Customer_address(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Customer", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -304,10 +302,9 @@ func (ec *executionContext) _Customer_address(ctx context.Context, field graphql func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Customer", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Customer", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -319,12 +316,12 @@ func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql. res := resTmp.([]Order) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Order(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -335,6 +332,8 @@ var itemImplementors = []string{"Item"} func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj *Item) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, itemImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -361,10 +360,9 @@ func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Item_name(ctx context.Context, field graphql.CollectedField, obj *Item) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Item", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Item", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -386,6 +384,8 @@ var orderImplementors = []string{"Order"} func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, obj *Order) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, orderImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -429,10 +429,9 @@ func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, ob func (ec *executionContext) _Order_id(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Order", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -450,10 +449,9 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect func (ec *executionContext) _Order_date(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Order", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -471,10 +469,9 @@ func (ec *executionContext) _Order_date(ctx context.Context, field graphql.Colle func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Order", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -492,10 +489,9 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col func (ec *executionContext) _Order_items(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Order", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Order", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -507,12 +503,12 @@ func (ec *executionContext) _Order_items(ctx context.Context, field graphql.Coll res := resTmp.([]Item) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Item(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -585,12 +581,12 @@ func (ec *executionContext) _Query_customers(ctx context.Context, field graphql. res := resTmp.([]Customer) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Customer(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -634,12 +630,12 @@ func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql. res := resTmp.([]Customer) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Customer(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -694,21 +690,21 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. res := resTmp.([][]Customer) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) arr2 := graphql.Array{} for idx2 := range res[idx1] { - arr2 = append(arr2, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx2) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Customer(ctx, field.Selections, &res[idx1][idx2]) - }()) + }(ctx)) } return arr2 - }()) + }(ctx)) } return arr1 } @@ -773,6 +769,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -811,10 +809,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -832,10 +829,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -850,10 +846,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -868,22 +863,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -898,12 +892,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -914,6 +908,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -949,10 +945,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -970,10 +965,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -988,10 +982,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1009,10 +1002,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1031,6 +1023,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1076,10 +1070,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1097,10 +1090,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1115,10 +1107,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1133,22 +1124,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1173,10 +1163,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1194,10 +1183,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1216,6 +1204,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1251,10 +1241,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1272,10 +1261,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1290,10 +1278,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1318,10 +1305,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1344,6 +1330,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1384,10 +1372,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1402,22 +1389,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1442,10 +1428,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1464,10 +1449,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1486,10 +1470,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1504,12 +1487,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1520,6 +1503,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1562,10 +1547,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1583,10 +1567,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1605,10 +1588,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1635,10 +1617,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1650,22 +1631,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1677,22 +1657,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1704,12 +1683,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1728,10 +1707,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1743,22 +1721,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1770,22 +1747,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/scalars/generated.go b/example/scalars/generated.go index 22d59ef349..a02028db18 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -90,6 +90,8 @@ var addressImplementors = []string{"Address"} func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, obj *model.Address) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, addressImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -118,10 +120,9 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Address", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -139,10 +140,9 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle func (ec *executionContext) _Address_location(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Address", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Address", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -272,12 +272,12 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col res := resTmp.([]model.User) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._User(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -342,6 +342,8 @@ var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, userImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -403,10 +405,9 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -424,10 +425,9 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -445,10 +445,9 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec func (ec *executionContext) _User_created(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -463,10 +462,9 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -484,10 +482,9 @@ func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.Co func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -505,10 +502,9 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g func (ec *executionContext) _User_customResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -526,10 +522,9 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap func (ec *executionContext) _User_address(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -544,10 +539,9 @@ func (ec *executionContext) _User_address(ctx context.Context, field graphql.Col func (ec *executionContext) _User_tier(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -566,6 +560,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -604,10 +600,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -625,10 +620,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -643,10 +637,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -661,22 +654,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -691,12 +683,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -707,6 +699,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -742,10 +736,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -763,10 +756,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -781,10 +773,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -802,10 +793,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -824,6 +814,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -869,10 +861,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -890,10 +881,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -908,10 +898,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -926,22 +915,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -966,10 +954,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -987,10 +974,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1009,6 +995,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1044,10 +1032,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1065,10 +1052,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1083,10 +1069,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1111,10 +1096,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1137,6 +1121,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1177,10 +1163,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1195,22 +1180,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1235,10 +1219,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1257,10 +1240,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1279,10 +1261,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1297,12 +1278,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1313,6 +1294,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1355,10 +1338,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1376,10 +1358,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1398,10 +1379,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1428,10 +1408,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1443,22 +1422,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1470,22 +1448,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1497,12 +1474,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1521,10 +1498,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1536,22 +1512,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1563,22 +1538,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/selection/generated.go b/example/selection/generated.go index a6290ab203..78b84af745 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -83,6 +83,8 @@ var likeImplementors = []string{"Like", "Event"} func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj *Like) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, likeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -118,10 +120,9 @@ func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Like", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -139,10 +140,9 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Like", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -160,10 +160,9 @@ func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.Collec func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Like", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -175,22 +174,21 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Like", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Like", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -202,12 +200,12 @@ func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -218,6 +216,8 @@ var postImplementors = []string{"Post", "Event"} func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj *Post) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, postImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -253,10 +253,9 @@ func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Post_message(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Post", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -274,10 +273,9 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Post", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -295,10 +293,9 @@ func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.Collec func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Post", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -310,22 +307,21 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Post", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Post", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -337,12 +333,12 @@ func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -403,12 +399,12 @@ func (ec *executionContext) _Query_events(ctx context.Context, field graphql.Col res := resTmp.([]Event) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Event(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -473,6 +469,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -511,10 +509,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -532,10 +529,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -550,10 +546,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -568,22 +563,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -598,12 +592,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -614,6 +608,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -649,10 +645,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -670,10 +665,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -688,10 +682,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -709,10 +702,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -731,6 +723,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -776,10 +770,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -797,10 +790,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -815,10 +807,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -833,22 +824,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -873,10 +863,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -894,10 +883,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -916,6 +904,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -951,10 +941,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -972,10 +961,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -990,10 +978,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1018,10 +1005,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1044,6 +1030,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1084,10 +1072,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1102,22 +1089,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1142,10 +1128,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1164,10 +1149,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1186,10 +1170,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1204,12 +1187,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1220,6 +1203,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1262,10 +1247,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1283,10 +1267,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1305,10 +1288,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1335,10 +1317,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1350,22 +1331,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1377,22 +1357,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1404,12 +1383,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1428,10 +1407,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1443,22 +1421,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1470,22 +1447,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/starwars/generated.go b/example/starwars/generated.go index 47a562f1ee..a318ba0b48 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -126,6 +126,8 @@ var droidImplementors = []string{"Droid", "Character"} func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, obj *Droid) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, droidImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -180,10 +182,9 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Droid", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -201,10 +202,9 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Droid", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -222,10 +222,9 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Droid", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -237,12 +236,12 @@ func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.Co res := resTmp.([]Character) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Character(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -281,10 +280,9 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field } args["after"] = arg1 rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: args, - Field: field, - ParentObject: obj, + Object: "Droid", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -302,10 +300,9 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Droid", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -320,22 +317,21 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. res := resTmp.([]Episode) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return res[idx1] - }()) + }(ctx)) } return arr1 } func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Droid", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Droid", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -354,6 +350,8 @@ var friendsConnectionImplementors = []string{"FriendsConnection"} func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.SelectionSet, obj *FriendsConnection) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, friendsConnectionImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -398,10 +396,9 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, - ParentObject: obj, + Object: "FriendsConnection", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -419,10 +416,9 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, - ParentObject: obj, + Object: "FriendsConnection", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -434,22 +430,21 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field res := resTmp.([]FriendsEdge) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._FriendsEdge(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, - ParentObject: obj, + Object: "FriendsConnection", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -461,22 +456,21 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel res := resTmp.([]Character) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Character(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsConnection", - Args: nil, - Field: field, - ParentObject: obj, + Object: "FriendsConnection", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -498,6 +492,8 @@ var friendsEdgeImplementors = []string{"FriendsEdge"} func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionSet, obj *FriendsEdge) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, friendsEdgeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -526,10 +522,9 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsEdge", - Args: nil, - Field: field, - ParentObject: obj, + Object: "FriendsEdge", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -547,10 +542,9 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "FriendsEdge", - Args: nil, - Field: field, - ParentObject: obj, + Object: "FriendsEdge", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -569,6 +563,8 @@ var humanImplementors = []string{"Human", "Character"} func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, obj *Human) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, humanImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -634,10 +630,9 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob func (ec *executionContext) _Human_id(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Human", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -655,10 +650,9 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect func (ec *executionContext) _Human_name(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Human", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -688,10 +682,9 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col } args["unit"] = arg0 rctx := &graphql.ResolverContext{ - Object: "Human", - Args: args, - Field: field, - ParentObject: obj, + Object: "Human", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -709,10 +702,9 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Human", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -727,10 +719,9 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Human", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -742,12 +733,12 @@ func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.Co res := resTmp.([]Character) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Character(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -786,10 +777,9 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field } args["after"] = arg1 rctx := &graphql.ResolverContext{ - Object: "Human", - Args: args, - Field: field, - ParentObject: obj, + Object: "Human", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -807,10 +797,9 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Human", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -825,22 +814,21 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. res := resTmp.([]Episode) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return res[idx1] - }()) + }(ctx)) } return arr1 } func (ec *executionContext) _Human_starships(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Human", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Human", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -852,12 +840,12 @@ func (ec *executionContext) _Human_starships(ctx context.Context, field graphql. res := resTmp.([]Starship) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Starship(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -942,6 +930,8 @@ var pageInfoImplementors = []string{"PageInfo"} func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *PageInfo) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, pageInfoImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -978,10 +968,9 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "PageInfo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -999,10 +988,9 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "PageInfo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1020,10 +1008,9 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "PageInfo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "PageInfo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1196,12 +1183,12 @@ func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.Co res := resTmp.([]Review) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Review(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1237,12 +1224,12 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col res := resTmp.([]SearchResult) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._SearchResult(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1435,6 +1422,8 @@ var reviewImplementors = []string{"Review"} func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, obj *Review) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, reviewImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1465,10 +1454,9 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Review", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Review", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1486,10 +1474,9 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col func (ec *executionContext) _Review_commentary(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Review", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Review", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1508,10 +1495,9 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq func (ec *executionContext) _Review_time(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Review", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Review", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1530,6 +1516,8 @@ var starshipImplementors = []string{"Starship"} func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, obj *Starship) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, starshipImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -1576,10 +1564,9 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Starship", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1597,10 +1584,9 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Starship", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1630,10 +1616,9 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. } args["unit"] = arg0 rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: args, - Field: field, - ParentObject: obj, + Object: "Starship", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1651,10 +1636,9 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. func (ec *executionContext) _Starship_history(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Starship", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Starship", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1669,21 +1653,21 @@ func (ec *executionContext) _Starship_history(ctx context.Context, field graphql res := resTmp.([][]int) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) arr2 := graphql.Array{} for idx2 := range res[idx1] { - arr2 = append(arr2, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx2) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalInt(res[idx1][idx2]) - }()) + }(ctx)) } return arr2 - }()) + }(ctx)) } return arr1 } @@ -1694,6 +1678,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1732,10 +1718,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1753,10 +1738,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1771,10 +1755,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1789,22 +1772,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1819,12 +1801,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1835,6 +1817,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1870,10 +1854,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1891,10 +1874,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1909,10 +1891,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1930,10 +1911,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1952,6 +1932,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1997,10 +1979,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2018,10 +1999,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2036,10 +2016,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2054,22 +2033,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2094,10 +2072,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2115,10 +2092,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2137,6 +2113,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2172,10 +2150,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2193,10 +2170,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2211,10 +2187,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2239,10 +2214,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2265,6 +2239,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2305,10 +2281,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2323,22 +2298,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2363,10 +2337,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2385,10 +2358,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2407,10 +2379,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2425,12 +2396,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -2441,6 +2412,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2483,10 +2456,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2504,10 +2476,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2526,10 +2497,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2556,10 +2526,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2571,22 +2540,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2598,22 +2566,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2625,12 +2592,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -2649,10 +2616,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2664,22 +2630,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -2691,22 +2656,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/example/todo/generated.go b/example/todo/generated.go index 9b0c2e7495..872f479c24 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -374,12 +374,12 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co res := resTmp.([]Todo) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec._Todo(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -444,6 +444,8 @@ var todoImplementors = []string{"Todo"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, todoImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -480,10 +482,9 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -501,10 +502,9 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -522,10 +522,9 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Todo", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Todo", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -547,6 +546,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -585,10 +586,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -606,10 +606,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -624,10 +623,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -642,22 +640,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -672,12 +669,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -688,6 +685,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -723,10 +722,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -744,10 +742,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -762,10 +759,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -783,10 +779,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -805,6 +800,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -850,10 +847,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -871,10 +867,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -889,10 +884,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -907,22 +901,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -947,10 +940,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -968,10 +960,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -990,6 +981,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1025,10 +1018,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1046,10 +1038,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1064,10 +1055,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1092,10 +1082,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1118,6 +1107,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1158,10 +1149,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1176,22 +1166,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1216,10 +1205,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1238,10 +1226,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1260,10 +1247,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1278,12 +1264,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1294,6 +1280,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1336,10 +1324,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1357,10 +1344,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1379,10 +1365,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1409,10 +1394,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1424,22 +1408,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1451,22 +1434,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1478,12 +1460,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1502,10 +1484,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1517,22 +1498,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1544,22 +1524,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { diff --git a/graphql/context.go b/graphql/context.go index 376c37584f..3bd0cb8e22 100644 --- a/graphql/context.go +++ b/graphql/context.go @@ -82,13 +82,24 @@ type ResolverContext struct { Args map[string]interface{} // The raw field Field CollectedField - // The parent object of the field - ParentObject interface{} + // The result object of resolver + Result interface{} // indicies tracks the array indicies only. all field aliases come from the context stack indicies []int } +func (r *ResolverContext) Copy() *ResolverContext { + return &ResolverContext{ + Parent: r.Parent, + Object: r.Object, + Args: r.Args, + Field: r.Field, + Result: r.Result, + indicies: append(make([]int, 0, len(r.indicies)+1), r.indicies...), + } +} + func (r *ResolverContext) Path() []interface{} { var path []interface{} for it := r; it != nil; it = it.Parent { @@ -114,10 +125,6 @@ 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 f547a10329..6663d827aa 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -97,6 +97,8 @@ var elementImplementors = []string{"Element"} func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, obj *models.Element) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, elementImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -143,10 +145,9 @@ func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) _Element_child(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Element", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Element", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -164,10 +165,9 @@ func (ec *executionContext) _Element_child(ctx context.Context, field graphql.Co func (ec *executionContext) _Element_error(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Element", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Element", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -185,10 +185,9 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co func (ec *executionContext) _Element_mismatched(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Element", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Element", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -200,12 +199,12 @@ func (ec *executionContext) _Element_mismatched(ctx context.Context, field graph res := resTmp.([]bool) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalBoolean(res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -299,16 +298,16 @@ func (ec *executionContext) _Query_path(ctx context.Context, field graphql.Colle res := resTmp.([]*models.Element) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) if res[idx1] == nil { return graphql.Null } return ec._Element(ctx, field.Selections, res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -478,6 +477,8 @@ var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *remote_api.User) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, userImplementors) + graphql.GetResolverContext(ctx).Result = obj + var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -514,10 +515,9 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -535,10 +535,9 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec func (ec *executionContext) _User_likes(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "User", - Args: nil, - Field: field, - ParentObject: obj, + Object: "User", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -553,12 +552,12 @@ func (ec *executionContext) _User_likes(ctx context.Context, field graphql.Colle res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -569,6 +568,8 @@ var viewerImplementors = []string{"Viewer"} func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *models.Viewer) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, viewerImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -592,10 +593,9 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.CollectedField, obj *models.Viewer) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "Viewer", - Args: nil, - Field: field, - ParentObject: obj, + Object: "Viewer", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -618,6 +618,8 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -656,10 +658,9 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -677,10 +678,9 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -695,10 +695,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -713,22 +712,21 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Directive", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Directive", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -743,12 +741,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -759,6 +757,8 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -794,10 +794,9 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -815,10 +814,9 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -833,10 +831,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -854,10 +851,9 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__EnumValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__EnumValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -876,6 +872,8 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -921,10 +919,9 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -942,10 +939,9 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -960,10 +956,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -978,22 +973,21 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1018,10 +1012,9 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1039,10 +1032,9 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Field", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Field", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1061,6 +1053,8 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1096,10 +1090,9 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1117,10 +1110,9 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1135,10 +1127,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1163,10 +1154,9 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__InputValue", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__InputValue", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1189,6 +1179,8 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1229,10 +1221,9 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1247,22 +1238,21 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1287,10 +1277,9 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1309,10 +1298,9 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1331,10 +1319,9 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Schema", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Schema", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1349,12 +1336,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1365,6 +1352,8 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) + graphql.GetResolverContext(ctx).Result = obj + out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1407,10 +1396,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1428,10 +1416,9 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1450,10 +1437,9 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1480,10 +1466,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1495,22 +1480,21 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1522,22 +1506,21 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1549,12 +1532,12 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } @@ -1573,10 +1556,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } args["includeDeprecated"] = arg0 rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: args, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: args, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1588,22 +1570,21 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { @@ -1615,22 +1596,21 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func() graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx) + arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { + rctx := graphql.GetResolverContext(ctx).Copy() rctx.PushIndex(idx1) - defer rctx.Pop() + ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }()) + }(ctx)) } return arr1 } func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ - Object: "__Type", - Args: nil, - Field: field, - ParentObject: obj, + Object: "__Type", + Args: nil, + Field: field, } ctx = graphql.WithResolverContext(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, func(ctx context.Context) (interface{}, error) { From e57464fef03faff2664fa249de8f9c0e821ed910 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 22 Aug 2018 18:47:23 +0900 Subject: [PATCH 3/5] refactor ResolverContext#indicies and suppress lint error --- codegen/object.go | 5 +- codegen/templates/data.go | 2 +- codegen/templates/field.gotpl | 5 +- codegen/testserver/generated.go | 124 +++++++++++++++++----- example/chat/generated.go | 101 +++++++++++++----- example/config/generated.go | 98 ++++++++++++++---- example/dataloader/generated.go | 129 +++++++++++++++++------ example/scalars/generated.go | 101 ++++++++++++++---- example/selection/generated.go | 118 +++++++++++++++------ example/starwars/generated.go | 177 ++++++++++++++++++++++++-------- example/todo/generated.go | 98 ++++++++++++++---- graphql/context.go | 28 +---- integration/generated.go | 110 +++++++++++++++----- 13 files changed, 824 insertions(+), 272 deletions(-) diff --git a/codegen/object.go b/codegen/object.go index b064c7cb1e..bb2bea8167 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -216,8 +216,9 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ return tpl(`{{.arr}} := graphql.Array{} for {{.index}} := range {{.val}} { {{.arr}} = append({{.arr}}, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex({{.index}}) + rctx := &graphql.ResolverContext{ + Index: &{{.index}}, + } ctx = graphql.WithResolverContext(ctx, rctx) {{ .next }} }(ctx)) diff --git a/codegen/templates/data.go b/codegen/templates/data.go index 6ec13d88c2..ebb1a2f57e 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: megacheck, ineffassign\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", "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 bfc2f1592f..1137273bd6 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: megacheck, ineffassign 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) diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 6a7dfe5bff..8f3a9fef38 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -123,6 +123,7 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Circle", @@ -140,6 +141,7 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co return graphql.MarshalFloat(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Circle", @@ -201,6 +203,7 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Error_id(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -221,6 +224,7 @@ func (ec *executionContext) _Error_id(ctx context.Context, field graphql.Collect return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -238,6 +242,7 @@ func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -258,6 +263,7 @@ func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, fie return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -319,6 +325,7 @@ func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.Selecti return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field graphql.CollectedField, obj *ForcedResolver) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "ForcedResolver", @@ -372,6 +379,7 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.CollectedField, obj *InnerObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "InnerObject", @@ -424,6 +432,7 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field graphql.CollectedField, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "InvalidIdentifier", @@ -476,6 +485,7 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedField, obj *introspection1.It) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "It", @@ -528,6 +538,7 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphql.CollectedField, obj *OuterObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "OuterObject", @@ -657,6 +668,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -678,6 +690,7 @@ func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field return ec._InvalidIdentifier(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_collision(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -699,6 +712,7 @@ func (ec *executionContext) _Query_collision(ctx context.Context, field graphql. return ec._It(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -737,6 +751,7 @@ func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.C return graphql.MarshalBoolean(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -775,6 +790,7 @@ func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql. return graphql.MarshalBoolean(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -834,6 +850,7 @@ func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graph return graphql.MarshalBoolean(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -851,14 +868,16 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) arr2 := graphql.Array{} for idx2 := range res[idx1] { arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx2) + rctx := &graphql.ResolverContext{ + Index: &idx2, + } ctx = graphql.WithResolverContext(ctx, rctx) if res[idx1][idx2] == nil { @@ -873,6 +892,7 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -910,6 +930,7 @@ func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.C return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -927,8 +948,9 @@ func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) if res[idx1] == nil { @@ -940,6 +962,7 @@ func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -961,6 +984,7 @@ func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphq return ec._Error(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -981,6 +1005,7 @@ func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1253,6 +1278,7 @@ func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphq return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1286,6 +1312,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -1340,6 +1367,7 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1357,6 +1385,7 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql return graphql.MarshalFloat(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1374,6 +1403,7 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. return graphql.MarshalFloat(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1435,6 +1465,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1455,6 +1486,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1472,6 +1504,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1492,8 +1525,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -1501,6 +1535,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1521,8 +1556,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1571,6 +1607,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1591,6 +1628,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1608,6 +1646,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1628,6 +1667,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1696,6 +1736,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1716,6 +1757,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1733,6 +1775,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1753,8 +1796,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1762,6 +1806,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1789,6 +1834,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1809,6 +1855,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1867,6 +1914,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1887,6 +1935,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1904,6 +1953,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1931,6 +1981,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1998,6 +2049,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2018,8 +2070,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2027,6 +2080,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2054,6 +2108,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2075,6 +2130,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2096,6 +2152,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2116,8 +2173,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2173,6 +2231,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2193,6 +2252,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2214,6 +2274,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2231,6 +2292,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -2260,8 +2322,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2269,6 +2332,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2286,8 +2350,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2295,6 +2360,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2312,8 +2378,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2321,6 +2388,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -2350,8 +2418,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2359,6 +2428,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2376,8 +2446,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2385,6 +2456,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/example/chat/generated.go b/example/chat/generated.go index e674b402fc..d1d9019f0d 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -157,6 +157,7 @@ func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Chatroom", @@ -177,6 +178,7 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Chatroom", @@ -197,8 +199,9 @@ func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Message(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -253,6 +256,7 @@ func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -273,6 +277,7 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Message_text(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -293,6 +298,7 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -313,6 +319,7 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -367,6 +374,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -459,6 +467,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_room(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -492,6 +501,7 @@ func (ec *executionContext) _Query_room(ctx context.Context, field graphql.Colle return ec._Chatroom(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -525,6 +535,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -580,7 +591,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) @@ -641,6 +654,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -661,6 +675,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -678,6 +693,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -698,8 +714,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -707,6 +724,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -727,8 +745,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -777,6 +796,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -797,6 +817,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -814,6 +835,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -834,6 +856,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -902,6 +925,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -922,6 +946,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -939,6 +964,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -959,8 +985,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -968,6 +995,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -995,6 +1023,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1015,6 +1044,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1073,6 +1103,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1093,6 +1124,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1110,6 +1142,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1137,6 +1170,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1204,6 +1238,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1224,8 +1259,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1233,6 +1269,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1260,6 +1297,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1281,6 +1319,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1302,6 +1341,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1322,8 +1362,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1379,6 +1420,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1399,6 +1441,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1420,6 +1463,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1437,6 +1481,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -1466,8 +1511,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1475,6 +1521,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1492,8 +1539,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1501,6 +1549,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1518,8 +1567,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1527,6 +1577,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -1556,8 +1607,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1565,6 +1617,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1582,8 +1635,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1591,6 +1645,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/example/config/generated.go b/example/config/generated.go index d46311d725..7d2f750b1b 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: megacheck, ineffassign func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -204,6 +205,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -224,8 +226,9 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Todo(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -233,6 +236,7 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -266,6 +270,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -344,6 +349,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -364,6 +370,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -384,6 +391,7 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. return graphql.MarshalInt(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -404,6 +412,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -424,6 +433,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -481,6 +491,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -501,6 +512,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -565,6 +577,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -585,6 +598,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -602,6 +616,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -622,8 +637,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -631,6 +647,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -651,8 +668,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -701,6 +719,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -721,6 +740,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -738,6 +758,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -758,6 +779,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -826,6 +848,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -846,6 +869,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -863,6 +887,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -883,8 +908,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -892,6 +918,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -919,6 +946,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -939,6 +967,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -997,6 +1026,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1017,6 +1047,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1034,6 +1065,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1061,6 +1093,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1128,6 +1161,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1148,8 +1182,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1157,6 +1192,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1184,6 +1220,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1205,6 +1242,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1226,6 +1264,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1246,8 +1285,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1303,6 +1343,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1323,6 +1364,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1344,6 +1386,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1361,6 +1404,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -1390,8 +1434,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1399,6 +1444,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1416,8 +1462,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1425,6 +1472,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1442,8 +1490,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1451,6 +1500,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -1480,8 +1530,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1489,6 +1540,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1506,8 +1558,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1515,6 +1568,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index c3d73ac483..22a2027486 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -129,6 +129,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -149,6 +150,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle return graphql.MarshalInt(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Address_street(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -169,6 +171,7 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Address_country(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -239,6 +242,7 @@ func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -259,6 +263,7 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll return graphql.MarshalInt(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -279,6 +284,7 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Customer_address(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -300,6 +306,7 @@ func (ec *executionContext) _Customer_address(ctx context.Context, field graphql return ec._Address(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -317,8 +324,9 @@ func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql. arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Order(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -358,6 +366,7 @@ func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Item_name(ctx context.Context, field graphql.CollectedField, obj *Item) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Item", @@ -427,6 +436,7 @@ func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Order_id(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -447,6 +457,7 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect return graphql.MarshalInt(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Order_date(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -467,6 +478,7 @@ func (ec *executionContext) _Order_date(ctx context.Context, field graphql.Colle return graphql.MarshalTime(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -487,6 +499,7 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col return graphql.MarshalFloat(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Order_items(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -504,8 +517,9 @@ func (ec *executionContext) _Order_items(ctx context.Context, field graphql.Coll arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Item(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -565,6 +579,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_customers(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -582,8 +597,9 @@ func (ec *executionContext) _Query_customers(ctx context.Context, field graphql. arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Customer(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -591,6 +607,7 @@ func (ec *executionContext) _Query_customers(ctx context.Context, field graphql. return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -631,8 +648,9 @@ func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql. arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Customer(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -640,6 +658,7 @@ func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql. return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -691,14 +710,16 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) arr2 := graphql.Array{} for idx2 := range res[idx1] { arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx2) + rctx := &graphql.ResolverContext{ + Index: &idx2, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Customer(ctx, field.Selections, &res[idx1][idx2]) }(ctx)) @@ -709,6 +730,7 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -742,6 +764,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -807,6 +830,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -827,6 +851,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -844,6 +869,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -864,8 +890,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -873,6 +900,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -893,8 +921,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -943,6 +972,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -963,6 +993,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -980,6 +1011,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1000,6 +1032,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1068,6 +1101,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1088,6 +1122,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1105,6 +1140,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1125,8 +1161,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1134,6 +1171,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1161,6 +1199,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1181,6 +1220,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1239,6 +1279,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1259,6 +1300,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1276,6 +1318,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1303,6 +1346,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1370,6 +1414,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1390,8 +1435,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1399,6 +1445,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1426,6 +1473,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1447,6 +1495,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1468,6 +1517,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1488,8 +1538,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1545,6 +1596,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1565,6 +1617,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1586,6 +1639,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1603,6 +1657,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -1632,8 +1687,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1641,6 +1697,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1658,8 +1715,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1667,6 +1725,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1684,8 +1743,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1693,6 +1753,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -1722,8 +1783,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1731,6 +1793,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1748,8 +1811,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1757,6 +1821,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/example/scalars/generated.go b/example/scalars/generated.go index a02028db18..6b69ac8e6c 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -118,6 +118,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -138,6 +139,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle return model.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Address_location(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -208,6 +210,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -241,6 +244,7 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle return ec._User(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -273,8 +277,9 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._User(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -282,6 +287,7 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -315,6 +321,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -403,6 +410,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -423,6 +431,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return model.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -443,6 +452,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_created(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -460,6 +470,7 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col return model.MarshalTimestamp(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -480,6 +491,7 @@ func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.Co return graphql.MarshalBoolean(bool(res)) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -500,6 +512,7 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_customResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -520,6 +533,7 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap return res } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_address(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -537,6 +551,7 @@ func (ec *executionContext) _User_address(ctx context.Context, field graphql.Col return ec._Address(ctx, field.Selections, &res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_tier(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -598,6 +613,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -618,6 +634,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -635,6 +652,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -655,8 +673,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -664,6 +683,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -684,8 +704,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -734,6 +755,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -754,6 +776,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -771,6 +794,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -791,6 +815,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -859,6 +884,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -879,6 +905,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -896,6 +923,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -916,8 +944,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -925,6 +954,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -952,6 +982,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -972,6 +1003,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1030,6 +1062,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1050,6 +1083,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1067,6 +1101,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1094,6 +1129,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1161,6 +1197,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1181,8 +1218,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1190,6 +1228,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1217,6 +1256,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1238,6 +1278,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1259,6 +1300,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1279,8 +1321,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1336,6 +1379,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1356,6 +1400,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1377,6 +1422,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1394,6 +1440,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -1423,8 +1470,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1432,6 +1480,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1449,8 +1498,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1458,6 +1508,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1475,8 +1526,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1484,6 +1536,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -1513,8 +1566,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1522,6 +1576,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1539,8 +1594,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1548,6 +1604,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/example/selection/generated.go b/example/selection/generated.go index 78b84af745..7e40feac28 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -118,6 +118,7 @@ func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -138,6 +139,7 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -158,6 +160,7 @@ func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.Collec return graphql.MarshalTime(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -175,8 +178,9 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -184,6 +188,7 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -201,8 +206,9 @@ func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -251,6 +257,7 @@ func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Post_message(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -271,6 +278,7 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -291,6 +299,7 @@ func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.Collec return graphql.MarshalTime(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -308,8 +317,9 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -317,6 +327,7 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -334,8 +345,9 @@ func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -383,6 +395,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_events(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -400,8 +413,9 @@ func (ec *executionContext) _Query_events(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Event(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -409,6 +423,7 @@ func (ec *executionContext) _Query_events(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -442,6 +457,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -507,6 +523,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -527,6 +544,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -544,6 +562,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -564,8 +583,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -573,6 +593,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -593,8 +614,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -643,6 +665,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -663,6 +686,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -680,6 +704,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -700,6 +725,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -768,6 +794,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -788,6 +815,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -805,6 +833,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -825,8 +854,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -834,6 +864,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -861,6 +892,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -881,6 +913,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -939,6 +972,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -959,6 +993,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -976,6 +1011,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1003,6 +1039,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1070,6 +1107,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1090,8 +1128,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1099,6 +1138,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1126,6 +1166,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1147,6 +1188,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1168,6 +1210,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1188,8 +1231,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1245,6 +1289,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1265,6 +1310,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1286,6 +1332,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1303,6 +1350,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -1332,8 +1380,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1341,6 +1390,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1358,8 +1408,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1367,6 +1418,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1384,8 +1436,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1393,6 +1446,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -1422,8 +1476,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1431,6 +1486,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1448,8 +1504,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1457,6 +1514,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/example/starwars/generated.go b/example/starwars/generated.go index a318ba0b48..e9a15b05dd 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -180,6 +180,7 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -200,6 +201,7 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -220,6 +222,7 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -237,8 +240,9 @@ func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Character(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -246,6 +250,7 @@ func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -298,6 +303,7 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field return ec._FriendsConnection(ctx, field.Selections, &res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -318,8 +324,9 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return res[idx1] }(ctx)) @@ -327,6 +334,7 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -394,6 +402,7 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -414,6 +423,7 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f return graphql.MarshalInt(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -431,8 +441,9 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._FriendsEdge(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -440,6 +451,7 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -457,8 +469,9 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Character(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -466,6 +479,7 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -520,6 +534,7 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsEdge", @@ -540,6 +555,7 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsEdge", @@ -628,6 +644,7 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_id(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -648,6 +665,7 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_name(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -668,6 +686,7 @@ func (ec *executionContext) _Human_name(ctx context.Context, field graphql.Colle return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_height(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -700,6 +719,7 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col return graphql.MarshalFloat(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -717,6 +737,7 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle return graphql.MarshalFloat(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -734,8 +755,9 @@ func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Character(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -743,6 +765,7 @@ func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -795,6 +818,7 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field return ec._FriendsConnection(ctx, field.Selections, &res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -815,8 +839,9 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return res[idx1] }(ctx)) @@ -824,6 +849,7 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Human_starships(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -841,8 +867,9 @@ func (ec *executionContext) _Human_starships(ctx context.Context, field graphql. arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Starship(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -881,6 +908,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Mutation_createReview(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -966,6 +994,7 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -986,6 +1015,7 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -1006,6 +1036,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -1108,6 +1139,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1137,6 +1169,7 @@ func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.Colle return ec._Character(ctx, field.Selections, &res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1184,8 +1217,9 @@ func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Review(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1193,6 +1227,7 @@ func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1225,8 +1260,9 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._SearchResult(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1234,6 +1270,7 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_character(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1263,6 +1300,7 @@ func (ec *executionContext) _Query_character(ctx context.Context, field graphql. return ec._Character(ctx, field.Selections, &res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1296,6 +1334,7 @@ func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.Coll return ec._Droid(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_human(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1329,6 +1368,7 @@ func (ec *executionContext) _Query_human(ctx context.Context, field graphql.Coll return ec._Human(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1362,6 +1402,7 @@ func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.C return ec._Starship(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1395,6 +1436,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -1452,6 +1494,7 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1472,6 +1515,7 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col return graphql.MarshalInt(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Review_commentary(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1493,6 +1537,7 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Review_time(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1562,6 +1607,7 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1582,6 +1628,7 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll return graphql.MarshalID(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1602,6 +1649,7 @@ func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Starship_length(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1634,6 +1682,7 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. return graphql.MarshalFloat(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Starship_history(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1654,14 +1703,16 @@ func (ec *executionContext) _Starship_history(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) arr2 := graphql.Array{} for idx2 := range res[idx1] { arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx2) + rctx := &graphql.ResolverContext{ + Index: &idx2, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalInt(res[idx1][idx2]) }(ctx)) @@ -1716,6 +1767,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1736,6 +1788,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1753,6 +1806,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1773,8 +1827,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -1782,6 +1837,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1802,8 +1858,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1852,6 +1909,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1872,6 +1930,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1889,6 +1948,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1909,6 +1969,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1977,6 +2038,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1997,6 +2059,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2014,6 +2077,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2034,8 +2098,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2043,6 +2108,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2070,6 +2136,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2090,6 +2157,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2148,6 +2216,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2168,6 +2237,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2185,6 +2255,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2212,6 +2283,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2279,6 +2351,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2299,8 +2372,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2308,6 +2382,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2335,6 +2410,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2356,6 +2432,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2377,6 +2454,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2397,8 +2475,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2454,6 +2533,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2474,6 +2554,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2495,6 +2576,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2512,6 +2594,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -2541,8 +2624,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2550,6 +2634,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2567,8 +2652,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2576,6 +2662,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2593,8 +2680,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2602,6 +2690,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -2631,8 +2720,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2640,6 +2730,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2657,8 +2748,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -2666,6 +2758,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/example/todo/generated.go b/example/todo/generated.go index 872f479c24..71aa82be86 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: megacheck, ineffassign func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -164,6 +165,7 @@ func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field gr return ec._Todo(ctx, field.Selections, &res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _MyMutation_updateTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -268,6 +270,7 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -301,6 +304,7 @@ func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.Col return ec._Todo(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _MyQuery_authenticatedTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -334,6 +338,7 @@ func (ec *executionContext) _MyQuery_authenticatedTodo(ctx context.Context, fiel return ec._Todo(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -355,6 +360,7 @@ func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql return ec._Todo(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -375,8 +381,9 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec._Todo(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -384,6 +391,7 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -417,6 +425,7 @@ func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.C return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _MyQuery___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -480,6 +489,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -500,6 +510,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.MarshalInt(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -520,6 +531,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -584,6 +596,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -604,6 +617,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -621,6 +635,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -641,8 +656,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -650,6 +666,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -670,8 +687,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -720,6 +738,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -740,6 +759,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -757,6 +777,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -777,6 +798,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -845,6 +867,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -865,6 +888,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -882,6 +906,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -902,8 +927,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -911,6 +937,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -938,6 +965,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -958,6 +986,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1016,6 +1045,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1036,6 +1066,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1053,6 +1084,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1080,6 +1112,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1147,6 +1180,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1167,8 +1201,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1176,6 +1211,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1203,6 +1239,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1224,6 +1261,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1245,6 +1283,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1265,8 +1304,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1322,6 +1362,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1342,6 +1383,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1363,6 +1405,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1380,6 +1423,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -1409,8 +1453,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1418,6 +1463,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1435,8 +1481,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1444,6 +1491,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1461,8 +1509,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1470,6 +1519,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -1499,8 +1549,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1508,6 +1559,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1525,8 +1577,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1534,6 +1587,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", diff --git a/graphql/context.go b/graphql/context.go index 3bd0cb8e22..6baee83c69 100644 --- a/graphql/context.go +++ b/graphql/context.go @@ -82,32 +82,18 @@ type ResolverContext struct { Args map[string]interface{} // The raw field Field CollectedField + // The index of array in path. + Index *int // The result object of resolver Result interface{} - - // indicies tracks the array indicies only. all field aliases come from the context stack - indicies []int -} - -func (r *ResolverContext) Copy() *ResolverContext { - return &ResolverContext{ - Parent: r.Parent, - Object: r.Object, - Args: r.Args, - Field: r.Field, - Result: r.Result, - indicies: append(make([]int, 0, len(r.indicies)+1), r.indicies...), - } } 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) } } @@ -121,10 +107,6 @@ func (r *ResolverContext) Path() []interface{} { return path } -func (r *ResolverContext) PushIndex(index int) { - r.indicies = append(r.indicies, index) -} - func GetResolverContext(ctx context.Context) *ResolverContext { val, _ := ctx.Value(resolver).(*ResolverContext) return val diff --git a/integration/generated.go b/integration/generated.go index 6663d827aa..188fe1f114 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -143,6 +143,7 @@ func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Element_child(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -163,6 +164,7 @@ func (ec *executionContext) _Element_child(ctx context.Context, field graphql.Co return ec._Element(ctx, field.Selections, &res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Element_error(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -183,6 +185,7 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Element_mismatched(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -200,8 +203,9 @@ func (ec *executionContext) _Element_mismatched(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalBoolean(res[idx1]) }(ctx)) @@ -282,6 +286,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_path(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -299,8 +304,9 @@ func (ec *executionContext) _Query_path(ctx context.Context, field graphql.Colle arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) if res[idx1] == nil { @@ -312,6 +318,7 @@ func (ec *executionContext) _Query_path(ctx context.Context, field graphql.Colle return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_date(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -344,6 +351,7 @@ func (ec *executionContext) _Query_date(ctx context.Context, field graphql.Colle return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -365,6 +373,7 @@ func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.Col return ec._Viewer(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -385,6 +394,7 @@ func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query_error(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -417,6 +427,7 @@ func (ec *executionContext) _Query_error(ctx context.Context, field graphql.Coll return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -450,6 +461,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -513,6 +525,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -533,6 +546,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) _User_likes(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -553,8 +567,9 @@ func (ec *executionContext) _User_likes(ctx context.Context, field graphql.Colle arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -591,6 +606,7 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.CollectedField, obj *models.Viewer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Viewer", @@ -656,6 +672,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -676,6 +693,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -693,6 +711,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -713,8 +732,9 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return graphql.MarshalString(res[idx1]) }(ctx)) @@ -722,6 +742,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -742,8 +763,9 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -792,6 +814,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -812,6 +835,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -829,6 +853,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -849,6 +874,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -917,6 +943,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -937,6 +964,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -954,6 +982,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -974,8 +1003,9 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -983,6 +1013,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1010,6 +1041,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1030,6 +1062,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1088,6 +1121,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1108,6 +1142,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1125,6 +1160,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1152,6 +1188,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1219,6 +1256,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1239,8 +1277,9 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1248,6 +1287,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1275,6 +1315,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1296,6 +1337,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1317,6 +1359,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.___Type(ctx, field.Selections, res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1337,8 +1380,9 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Directive(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1394,6 +1438,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1414,6 +1459,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1435,6 +1481,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1452,6 +1499,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } +// nolint: megacheck, ineffassign 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{}{} @@ -1481,8 +1529,9 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Field(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1490,6 +1539,7 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1507,8 +1557,9 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1516,6 +1567,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1533,8 +1585,9 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___Type(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1542,6 +1595,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return arr1 } +// nolint: megacheck, ineffassign 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{}{} @@ -1571,8 +1625,9 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___EnumValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1580,6 +1635,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1597,8 +1653,9 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph arr1 := graphql.Array{} for idx1 := range res { arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := graphql.GetResolverContext(ctx).Copy() - rctx.PushIndex(idx1) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } ctx = graphql.WithResolverContext(ctx, rctx) return ec.___InputValue(ctx, field.Selections, &res[idx1]) }(ctx)) @@ -1606,6 +1663,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return arr1 } +// nolint: megacheck, ineffassign func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", From 568a72e9edde1d564f64e1e22267b76670d12853 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 23 Aug 2018 18:04:47 +0900 Subject: [PATCH 4/5] add some refactor --- codegen/object.go | 15 +- codegen/templates/data.go | 2 +- codegen/templates/field.gotpl | 2 +- codegen/testserver/generated.go | 294 ++++++++++++----------- example/chat/generated.go | 236 +++++++++--------- example/config/generated.go | 234 +++++++++--------- example/dataloader/generated.go | 309 +++++++++++++----------- example/scalars/generated.go | 240 ++++++++++--------- example/selection/generated.go | 264 ++++++++++---------- example/starwars/generated.go | 410 +++++++++++++++++--------------- example/todo/generated.go | 237 +++++++++--------- integration/generated.go | 255 ++++++++++---------- 12 files changed, 1317 insertions(+), 1181 deletions(-) diff --git a/codegen/object.go b/codegen/object.go index bb2bea8167..6908d43f98 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -215,18 +215,21 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ return tpl(`{{.arr}} := graphql.Array{} for {{.index}} := range {{.val}} { - {{.arr}} = append({{.arr}}, func(ctx context.Context) graphql.Marshaler { + {{- if not .isScalar }} rctx := &graphql.ResolverContext{ Index: &{{.index}}, } - ctx = graphql.WithResolverContext(ctx, rctx) + ctx := graphql.WithResolverContext(ctx, rctx) + {{- end}} + {{.arr}} = append({{.arr}}, func() graphql.Marshaler { {{ .next }} - }(ctx)) + }()) } return {{.arr}}`, map[string]interface{}{ "val": val, "arr": arr, "index": index, + "isScalar": f.IsScalar, "next": f.doWriteJson(val+"["+index+"]", remainingMods[1:], astType.Elem, false, depth+1), }) @@ -240,7 +243,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 ebb1a2f57e..b06c72ab2f 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{\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: megacheck, ineffassign\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\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 1137273bd6..3f6e4c7732 100644 --- a/codegen/templates/field.gotpl +++ b/codegen/templates/field.gotpl @@ -26,7 +26,7 @@ } } {{ else }} - // nolint: megacheck, ineffassign + // 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) diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 8f3a9fef38..4a057132db 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -123,7 +123,7 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Circle", @@ -141,7 +141,7 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co return graphql.MarshalFloat(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Circle", @@ -203,7 +203,7 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Error_id(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -224,7 +224,7 @@ func (ec *executionContext) _Error_id(ctx context.Context, field graphql.Collect return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -242,7 +242,7 @@ func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -263,7 +263,7 @@ func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, fie return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Error", @@ -325,7 +325,7 @@ func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.Selecti return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field graphql.CollectedField, obj *ForcedResolver) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "ForcedResolver", @@ -344,6 +344,7 @@ func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field gra if res == nil { return graphql.Null } + return ec._Circle(ctx, field.Selections, res) } @@ -379,7 +380,7 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.CollectedField, obj *InnerObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "InnerObject", @@ -432,7 +433,7 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field graphql.CollectedField, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "InvalidIdentifier", @@ -485,7 +486,7 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedField, obj *introspection1.It) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "It", @@ -538,7 +539,7 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphql.CollectedField, obj *OuterObject) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "OuterObject", @@ -556,6 +557,7 @@ func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphq return graphql.Null } res := resTmp.(InnerObject) + return ec._InnerObject(ctx, field.Selections, &res) } @@ -668,7 +670,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -687,10 +689,11 @@ func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field if res == nil { return graphql.Null } + return ec._InvalidIdentifier(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_collision(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -709,10 +712,11 @@ func (ec *executionContext) _Query_collision(ctx context.Context, field graphql. if res == nil { return graphql.Null } + return ec._It(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -751,7 +755,7 @@ func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.C return graphql.MarshalBoolean(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -790,7 +794,7 @@ func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql. return graphql.MarshalBoolean(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -850,7 +854,7 @@ func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graph return graphql.MarshalBoolean(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -867,32 +871,33 @@ func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field grap res := resTmp.([][]*OuterObject) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { arr2 := graphql.Array{} for idx2 := range res[idx1] { - arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx2, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx2, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr2 = append(arr2, func() graphql.Marshaler { if res[idx1][idx2] == nil { return graphql.Null } + return ec._OuterObject(ctx, field.Selections, res[idx1][idx2]) - }(ctx)) + }()) } return arr2 - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -930,7 +935,7 @@ func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.C return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -947,22 +952,23 @@ func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.Col res := resTmp.([]*Shape) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { if res[idx1] == nil { return graphql.Null } + return ec._Shape(ctx, field.Selections, res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -981,10 +987,11 @@ func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphq if res == nil { return graphql.Null } + return ec._Error(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -1005,7 +1012,7 @@ func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1278,7 +1285,7 @@ func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphq return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1309,10 +1316,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -1331,6 +1339,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -1367,7 +1376,7 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1385,7 +1394,7 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql return graphql.MarshalFloat(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1403,7 +1412,7 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. return graphql.MarshalFloat(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Rectangle", @@ -1465,7 +1474,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1486,7 +1495,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1504,7 +1513,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1524,18 +1533,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1555,13 +1560,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1607,7 +1613,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1628,7 +1634,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1646,7 +1652,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1667,7 +1673,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1736,7 +1742,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1757,7 +1763,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1775,7 +1781,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1795,18 +1801,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1831,10 +1838,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1855,7 +1863,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1914,7 +1922,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1935,7 +1943,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1953,7 +1961,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1978,10 +1986,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2049,7 +2058,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2069,18 +2078,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2105,10 +2115,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2127,10 +2138,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2149,10 +2161,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2172,13 +2185,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -2231,7 +2245,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2252,7 +2266,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2274,7 +2288,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2292,7 +2306,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -2321,18 +2335,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2349,18 +2364,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2377,18 +2393,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -2417,18 +2434,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2445,18 +2463,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2475,6 +2494,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co 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 d1d9019f0d..099e3be56d 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -157,7 +157,7 @@ func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Chatroom", @@ -178,7 +178,7 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphql.CollectedField, obj *Chatroom) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Chatroom", @@ -198,13 +198,14 @@ func (ec *executionContext) _Chatroom_messages(ctx context.Context, field graphq res := resTmp.([]Message) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Message(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -256,7 +257,7 @@ func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Message_id(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -277,7 +278,7 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Message_text(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -298,7 +299,7 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -319,7 +320,7 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Message_createdAt(ctx context.Context, field graphql.CollectedField, obj *Message) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Message", @@ -374,7 +375,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -424,6 +425,7 @@ func (ec *executionContext) _Mutation_post(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(Message) + return ec._Message(ctx, field.Selections, &res) } @@ -467,7 +469,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_room(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -498,10 +500,11 @@ func (ec *executionContext) _Query_room(ctx context.Context, field graphql.Colle if res == nil { return graphql.Null } + return ec._Chatroom(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -532,10 +535,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -554,6 +558,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -605,7 +610,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 } } @@ -654,7 +661,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -675,7 +682,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -693,7 +700,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -713,18 +720,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -744,13 +747,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -796,7 +800,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -817,7 +821,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -835,7 +839,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -856,7 +860,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -925,7 +929,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -946,7 +950,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -964,7 +968,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -984,18 +988,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1020,10 +1025,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1044,7 +1050,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1103,7 +1109,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1124,7 +1130,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1142,7 +1148,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1167,10 +1173,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1238,7 +1245,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1258,18 +1265,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1294,10 +1302,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1316,10 +1325,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1338,10 +1348,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1361,13 +1372,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1420,7 +1432,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1441,7 +1453,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1463,7 +1475,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1481,7 +1493,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1510,18 +1522,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1538,18 +1551,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1566,18 +1580,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1606,18 +1621,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1634,18 +1650,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1664,6 +1681,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co 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 7d2f750b1b..2b61dc520e 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -129,7 +129,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -159,6 +159,7 @@ func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field grap return graphql.Null } res := resTmp.(Todo) + return ec._Todo(ctx, field.Selections, &res) } @@ -205,7 +206,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -225,18 +226,19 @@ func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.Coll res := resTmp.([]Todo) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Todo(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -267,10 +269,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -289,6 +292,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -349,7 +353,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -370,7 +374,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -391,7 +395,7 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. return graphql.MarshalInt(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -412,7 +416,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -433,7 +437,7 @@ func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.Collec return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -451,6 +455,7 @@ func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(User) + return ec._User(ctx, field.Selections, &res) } @@ -491,7 +496,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -512,7 +517,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -577,7 +582,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -598,7 +603,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -616,7 +621,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -636,18 +641,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -667,13 +668,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -719,7 +721,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -740,7 +742,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -758,7 +760,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -779,7 +781,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -848,7 +850,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -869,7 +871,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -887,7 +889,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -907,18 +909,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -943,10 +946,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -967,7 +971,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1026,7 +1030,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1047,7 +1051,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1065,7 +1069,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1090,10 +1094,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1161,7 +1166,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1181,18 +1186,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1217,10 +1223,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1239,10 +1246,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1261,10 +1269,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1284,13 +1293,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1343,7 +1353,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1364,7 +1374,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1386,7 +1396,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1404,7 +1414,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1433,18 +1443,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1461,18 +1472,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1489,18 +1501,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1529,18 +1542,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1557,18 +1571,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1587,6 +1602,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co 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 22a2027486..743043f844 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -129,7 +129,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -150,7 +150,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle return graphql.MarshalInt(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Address_street(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -171,7 +171,7 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Address_country(ctx context.Context, field graphql.CollectedField, obj *Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -242,7 +242,7 @@ func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -263,7 +263,7 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll return graphql.MarshalInt(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -284,7 +284,7 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Customer_address(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -303,10 +303,11 @@ func (ec *executionContext) _Customer_address(ctx context.Context, field graphql if res == nil { return graphql.Null } + return ec._Address(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql.CollectedField, obj *Customer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Customer", @@ -323,13 +324,14 @@ func (ec *executionContext) _Customer_orders(ctx context.Context, field graphql. res := resTmp.([]Order) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Order(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -366,7 +368,7 @@ func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Item_name(ctx context.Context, field graphql.CollectedField, obj *Item) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Item", @@ -436,7 +438,7 @@ func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, ob return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Order_id(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -457,7 +459,7 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect return graphql.MarshalInt(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Order_date(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -478,7 +480,7 @@ func (ec *executionContext) _Order_date(ctx context.Context, field graphql.Colle return graphql.MarshalTime(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -499,7 +501,7 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col return graphql.MarshalFloat(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Order_items(ctx context.Context, field graphql.CollectedField, obj *Order) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Order", @@ -516,13 +518,14 @@ func (ec *executionContext) _Order_items(ctx context.Context, field graphql.Coll res := resTmp.([]Item) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Item(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -579,7 +582,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_customers(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -596,18 +599,19 @@ func (ec *executionContext) _Query_customers(ctx context.Context, field graphql. res := resTmp.([]Customer) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Customer(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -647,18 +651,19 @@ func (ec *executionContext) _Query_torture1d(ctx context.Context, field graphql. res := resTmp.([]Customer) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Customer(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -709,28 +714,29 @@ func (ec *executionContext) _Query_torture2d(ctx context.Context, field graphql. res := resTmp.([][]Customer) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { arr2 := graphql.Array{} for idx2 := range res[idx1] { - arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx2, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx2, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr2 = append(arr2, func() graphql.Marshaler { + return ec._Customer(ctx, field.Selections, &res[idx1][idx2]) - }(ctx)) + }()) } return arr2 - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -761,10 +767,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -783,6 +790,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -830,7 +838,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -851,7 +859,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -869,7 +877,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -889,18 +897,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -920,13 +924,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -972,7 +977,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -993,7 +998,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1011,7 +1016,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1032,7 +1037,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1101,7 +1106,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1122,7 +1127,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1140,7 +1145,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1160,18 +1165,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1196,10 +1202,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1220,7 +1227,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1279,7 +1286,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1300,7 +1307,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1318,7 +1325,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1343,10 +1350,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1414,7 +1422,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1434,18 +1442,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1470,10 +1479,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1492,10 +1502,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1514,10 +1525,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1537,13 +1549,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1596,7 +1609,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1617,7 +1630,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1639,7 +1652,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1657,7 +1670,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1686,18 +1699,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1714,18 +1728,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1742,18 +1757,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1782,18 +1798,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1810,18 +1827,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1840,6 +1858,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co 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 6b69ac8e6c..07d32b1210 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -118,7 +118,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Address_id(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -139,7 +139,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle return model.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Address_location(ctx context.Context, field graphql.CollectedField, obj *model.Address) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Address", @@ -210,7 +210,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -241,10 +241,11 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle if res == nil { return graphql.Null } + return ec._User(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -276,18 +277,19 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col res := resTmp.([]model.User) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._User(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -318,10 +320,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -340,6 +343,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -410,7 +414,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -431,7 +435,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return model.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -452,7 +456,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_created(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -470,7 +474,7 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col return model.MarshalTimestamp(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -491,7 +495,7 @@ func (ec *executionContext) _User_isBanned(ctx context.Context, field graphql.Co return graphql.MarshalBoolean(bool(res)) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -512,7 +516,7 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_customResolver(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -533,7 +537,7 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap return res } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_address(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -548,10 +552,11 @@ func (ec *executionContext) _User_address(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(model.Address) + return ec._Address(ctx, field.Selections, &res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_tier(ctx context.Context, field graphql.CollectedField, obj *model.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -613,7 +618,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -634,7 +639,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -652,7 +657,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -672,18 +677,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -703,13 +704,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -755,7 +757,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -776,7 +778,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -794,7 +796,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -815,7 +817,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -884,7 +886,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -905,7 +907,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -923,7 +925,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -943,18 +945,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -979,10 +982,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1003,7 +1007,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1062,7 +1066,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1083,7 +1087,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1101,7 +1105,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1126,10 +1130,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1197,7 +1202,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1217,18 +1222,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1253,10 +1259,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1275,10 +1282,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1297,10 +1305,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1320,13 +1329,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1379,7 +1389,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1400,7 +1410,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1422,7 +1432,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1440,7 +1450,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1469,18 +1479,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1497,18 +1508,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1525,18 +1537,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1565,18 +1578,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1593,18 +1607,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1623,6 +1638,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co 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 7e40feac28..bfbb958f24 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -118,7 +118,7 @@ func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -139,7 +139,7 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -160,7 +160,7 @@ func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.Collec return graphql.MarshalTime(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -177,18 +177,14 @@ func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.CollectedField, obj *Like) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Like", @@ -205,13 +201,9 @@ func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -257,7 +249,7 @@ func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Post_message(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -278,7 +270,7 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -299,7 +291,7 @@ func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.Collec return graphql.MarshalTime(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -316,18 +308,14 @@ func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.CollectedField, obj *Post) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Post", @@ -344,13 +332,9 @@ func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.C res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -395,7 +379,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_events(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -412,18 +396,19 @@ func (ec *executionContext) _Query_events(ctx context.Context, field graphql.Col res := resTmp.([]Event) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Event(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -454,10 +439,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -476,6 +462,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -523,7 +510,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -544,7 +531,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -562,7 +549,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -582,18 +569,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -613,13 +596,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -665,7 +649,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -686,7 +670,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -704,7 +688,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -725,7 +709,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -794,7 +778,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -815,7 +799,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -833,7 +817,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -853,18 +837,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -889,10 +874,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -913,7 +899,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -972,7 +958,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -993,7 +979,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1011,7 +997,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1036,10 +1022,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1107,7 +1094,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1127,18 +1114,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1163,10 +1151,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1185,10 +1174,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1207,10 +1197,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1230,13 +1221,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1289,7 +1281,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1310,7 +1302,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1332,7 +1324,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1350,7 +1342,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1379,18 +1371,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1407,18 +1400,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1435,18 +1429,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1475,18 +1470,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1503,18 +1499,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1533,6 +1530,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co 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 e9a15b05dd..78c0fcf362 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -180,7 +180,7 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -201,7 +201,7 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -222,7 +222,7 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -239,18 +239,19 @@ func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.Co res := resTmp.([]Character) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Character(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -300,10 +301,11 @@ func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field return graphql.Null } res := resTmp.(FriendsConnection) + return ec._FriendsConnection(ctx, field.Selections, &res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -323,18 +325,14 @@ func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql. res := resTmp.([]Episode) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return res[idx1] - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field graphql.CollectedField, obj *Droid) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Droid", @@ -402,7 +400,7 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -423,7 +421,7 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f return graphql.MarshalInt(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -440,18 +438,19 @@ func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field res := resTmp.([]FriendsEdge) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._FriendsEdge(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -468,18 +467,19 @@ func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, fiel res := resTmp.([]Character) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Character(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *FriendsConnection) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsConnection", @@ -497,6 +497,7 @@ func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, fie return graphql.Null } res := resTmp.(PageInfo) + return ec._PageInfo(ctx, field.Selections, &res) } @@ -534,7 +535,7 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsEdge", @@ -555,7 +556,7 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql.CollectedField, obj *FriendsEdge) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "FriendsEdge", @@ -570,6 +571,7 @@ func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql return graphql.Null } res := resTmp.(Character) + return ec._Character(ctx, field.Selections, &res) } @@ -644,7 +646,7 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Human_id(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -665,7 +667,7 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Human_name(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -686,7 +688,7 @@ func (ec *executionContext) _Human_name(ctx context.Context, field graphql.Colle return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -719,7 +721,7 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col return graphql.MarshalFloat(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -737,7 +739,7 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle return graphql.MarshalFloat(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -754,18 +756,19 @@ func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.Co res := resTmp.([]Character) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Character(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -815,10 +818,11 @@ func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field return graphql.Null } res := resTmp.(FriendsConnection) + return ec._FriendsConnection(ctx, field.Selections, &res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -838,18 +842,14 @@ func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql. res := resTmp.([]Episode) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return res[idx1] - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Human_starships(ctx context.Context, field graphql.CollectedField, obj *Human) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Human", @@ -866,13 +866,14 @@ func (ec *executionContext) _Human_starships(ctx context.Context, field graphql. res := resTmp.([]Starship) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Starship(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -908,7 +909,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Mutation_createReview(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -949,6 +950,7 @@ func (ec *executionContext) _Mutation_createReview(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec._Review(ctx, field.Selections, res) } @@ -994,7 +996,7 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -1015,7 +1017,7 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -1036,7 +1038,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *PageInfo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "PageInfo", @@ -1139,7 +1141,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1166,10 +1168,11 @@ func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(Character) + return ec._Character(ctx, field.Selections, &res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1216,18 +1219,19 @@ func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.Co res := resTmp.([]Review) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Review(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1259,18 +1263,19 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col res := resTmp.([]SearchResult) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._SearchResult(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_character(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1297,10 +1302,11 @@ func (ec *executionContext) _Query_character(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(Character) + return ec._Character(ctx, field.Selections, &res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1331,10 +1337,11 @@ func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.Coll if res == nil { return graphql.Null } + return ec._Droid(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_human(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1365,10 +1372,11 @@ func (ec *executionContext) _Query_human(ctx context.Context, field graphql.Coll if res == nil { return graphql.Null } + return ec._Human(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1399,10 +1407,11 @@ func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec._Starship(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -1433,10 +1442,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -1455,6 +1465,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -1494,7 +1505,7 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1515,7 +1526,7 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col return graphql.MarshalInt(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Review_commentary(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1537,7 +1548,7 @@ func (ec *executionContext) _Review_commentary(ctx context.Context, field graphq return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Review_time(ctx context.Context, field graphql.CollectedField, obj *Review) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Review", @@ -1607,7 +1618,7 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1628,7 +1639,7 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll return graphql.MarshalID(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1649,7 +1660,7 @@ func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.Co return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1682,7 +1693,7 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. return graphql.MarshalFloat(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Starship_history(ctx context.Context, field graphql.CollectedField, obj *Starship) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Starship", @@ -1702,23 +1713,15 @@ func (ec *executionContext) _Starship_history(ctx context.Context, field graphql res := resTmp.([][]int) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { arr2 := graphql.Array{} for idx2 := range res[idx1] { - arr2 = append(arr2, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx2, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr2 = append(arr2, func() graphql.Marshaler { return graphql.MarshalInt(res[idx1][idx2]) - }(ctx)) + }()) } return arr2 - }(ctx)) + }()) } return arr1 } @@ -1767,7 +1770,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1788,7 +1791,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1806,7 +1809,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1826,18 +1829,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -1857,13 +1856,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1909,7 +1909,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1930,7 +1930,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1948,7 +1948,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -1969,7 +1969,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -2038,7 +2038,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2059,7 +2059,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2077,7 +2077,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2097,18 +2097,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2133,10 +2134,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2157,7 +2159,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -2216,7 +2218,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2237,7 +2239,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2255,7 +2257,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2280,10 +2282,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -2351,7 +2354,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2371,18 +2374,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2407,10 +2411,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2429,10 +2434,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2451,10 +2457,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -2474,13 +2481,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -2533,7 +2541,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2554,7 +2562,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2576,7 +2584,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2594,7 +2602,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -2623,18 +2631,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2651,18 +2660,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2679,18 +2689,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -2719,18 +2730,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2747,18 +2759,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -2777,6 +2790,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co 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 71aa82be86..cf7b6379dc 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -132,7 +132,7 @@ func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSe return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -162,10 +162,11 @@ func (ec *executionContext) _MyMutation_createTodo(ctx context.Context, field gr return graphql.Null } res := resTmp.(Todo) + return ec._Todo(ctx, field.Selections, &res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyMutation_updateTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -206,6 +207,7 @@ func (ec *executionContext) _MyMutation_updateTodo(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } @@ -270,7 +272,7 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -301,10 +303,11 @@ func (ec *executionContext) _MyQuery_todo(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyQuery_authenticatedTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -335,10 +338,11 @@ func (ec *executionContext) _MyQuery_authenticatedTodo(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -357,10 +361,11 @@ func (ec *executionContext) _MyQuery_lastTodo(ctx context.Context, field graphql if res == nil { return graphql.Null } + return ec._Todo(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -380,18 +385,19 @@ func (ec *executionContext) _MyQuery_todos(ctx context.Context, field graphql.Co res := resTmp.([]Todo) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec._Todo(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -422,10 +428,11 @@ func (ec *executionContext) _MyQuery___type(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _MyQuery___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "MyQuery", @@ -444,6 +451,7 @@ func (ec *executionContext) _MyQuery___schema(ctx context.Context, field graphql if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -489,7 +497,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -510,7 +518,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.MarshalInt(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -531,7 +539,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *Todo) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Todo", @@ -596,7 +604,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -617,7 +625,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -635,7 +643,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -655,18 +663,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -686,13 +690,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -738,7 +743,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -759,7 +764,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -777,7 +782,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -798,7 +803,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -867,7 +872,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -888,7 +893,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -906,7 +911,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -926,18 +931,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -962,10 +968,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -986,7 +993,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1045,7 +1052,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1066,7 +1073,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1084,7 +1091,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1109,10 +1116,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1180,7 +1188,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1200,18 +1208,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1236,10 +1245,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1258,10 +1268,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1280,10 +1291,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1303,13 +1315,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1362,7 +1375,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1383,7 +1396,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1405,7 +1418,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1423,7 +1436,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1452,18 +1465,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1480,18 +1494,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1508,18 +1523,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1548,18 +1564,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1576,18 +1593,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1606,6 +1624,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } diff --git a/integration/generated.go b/integration/generated.go index 4187fa7625..ec38d14df8 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -144,7 +144,7 @@ func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Element_child(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -162,10 +162,11 @@ func (ec *executionContext) _Element_child(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(models.Element) + return ec._Element(ctx, field.Selections, &res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Element_error(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -186,7 +187,7 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Element_mismatched(ctx context.Context, field graphql.CollectedField, obj *models.Element) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Element", @@ -203,13 +204,9 @@ func (ec *executionContext) _Element_mismatched(ctx context.Context, field graph res := resTmp.([]bool) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalBoolean(res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -287,7 +284,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_path(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -304,22 +301,23 @@ func (ec *executionContext) _Query_path(ctx context.Context, field graphql.Colle res := resTmp.([]*models.Element) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { if res[idx1] == nil { return graphql.Null } + return ec._Element(ctx, field.Selections, res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_date(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -352,7 +350,7 @@ func (ec *executionContext) _Query_date(ctx context.Context, field graphql.Colle return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -371,10 +369,11 @@ func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec._Viewer(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -395,7 +394,7 @@ func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query_error(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -428,7 +427,7 @@ func (ec *executionContext) _Query_error(ctx context.Context, field graphql.Coll return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rawArgs := field.ArgumentMap(ec.Variables) args := map[string]interface{}{} @@ -459,10 +458,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Query", @@ -481,6 +481,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if res == nil { return graphql.Null } + return ec.___Schema(ctx, field.Selections, res) } @@ -526,7 +527,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -547,7 +548,7 @@ func (ec *executionContext) _User_name(ctx context.Context, field graphql.Collec return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _User_likes(ctx context.Context, field graphql.CollectedField, obj *remote_api.User) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "User", @@ -567,13 +568,9 @@ func (ec *executionContext) _User_likes(ctx context.Context, field graphql.Colle res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -607,7 +604,7 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.CollectedField, obj *models.Viewer) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "Viewer", @@ -626,6 +623,7 @@ func (ec *executionContext) _Viewer_user(ctx context.Context, field graphql.Coll if res == nil { return graphql.Null } + return ec._User(ctx, field.Selections, res) } @@ -673,7 +671,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -694,7 +692,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -712,7 +710,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -732,18 +730,14 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr res := resTmp.([]string) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { return graphql.MarshalString(res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Directive", @@ -763,13 +757,14 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -815,7 +810,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -836,7 +831,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -854,7 +849,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -875,7 +870,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__EnumValue", @@ -944,7 +939,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -965,7 +960,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -983,7 +978,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1003,18 +998,19 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1039,10 +1035,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1063,7 +1060,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.MarshalBoolean(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Field", @@ -1122,7 +1119,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1143,7 +1140,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1161,7 +1158,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1186,10 +1183,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__InputValue", @@ -1257,7 +1255,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1277,18 +1275,19 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1313,10 +1312,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1335,10 +1335,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1357,10 +1358,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Schema", @@ -1380,13 +1382,14 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap res := resTmp.([]introspection.Directive) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Directive(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } @@ -1439,7 +1442,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1460,7 +1463,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1482,7 +1485,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return graphql.MarshalString(*res) } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1500,7 +1503,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.MarshalString(res) } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1529,18 +1532,19 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co res := resTmp.([]introspection.Field) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Field(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1557,18 +1561,19 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1585,18 +1590,19 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra res := resTmp.([]introspection.Type) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___Type(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// 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{}{} @@ -1625,18 +1631,19 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq res := resTmp.([]introspection.EnumValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___EnumValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1653,18 +1660,19 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph res := resTmp.([]introspection.InputValue) arr1 := graphql.Array{} for idx1 := range res { - arr1 = append(arr1, func(ctx context.Context) graphql.Marshaler { - rctx := &graphql.ResolverContext{ - Index: &idx1, - } - ctx = graphql.WithResolverContext(ctx, rctx) + rctx := &graphql.ResolverContext{ + Index: &idx1, + } + ctx := graphql.WithResolverContext(ctx, rctx) + arr1 = append(arr1, func() graphql.Marshaler { + return ec.___InputValue(ctx, field.Selections, &res[idx1]) - }(ctx)) + }()) } return arr1 } -// nolint: megacheck, ineffassign +// nolint: vetshadow func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { rctx := &graphql.ResolverContext{ Object: "__Type", @@ -1683,6 +1691,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co if res == nil { return graphql.Null } + return ec.___Type(ctx, field.Selections, res) } From 6ef2035b06a98435f9f9fd5b7d8a67b86c7da51d Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 23 Aug 2018 22:49:05 +0900 Subject: [PATCH 5/5] refactor set Result timing --- codegen/import_build.go | 1 + codegen/object.go | 16 ++-- codegen/templates/data.go | 4 +- codegen/templates/field.gotpl | 1 + codegen/templates/object.gotpl | 2 - codegen/testserver/generated.go | 123 ++++++++++++++++++--------- example/chat/generated.go | 88 +++++++++++++------ example/config/generated.go | 89 +++++++++++++------ example/dataloader/generated.go | 114 +++++++++++++++++-------- example/scalars/generated.go | 92 ++++++++++++++------ example/selection/generated.go | 89 +++++++++++++------ example/starwars/generated.go | 146 +++++++++++++++++++++++--------- example/todo/generated.go | 87 +++++++++++++------ integration/generated.go | 93 ++++++++++++++------ 14 files changed, 663 insertions(+), 282 deletions(-) diff --git a/codegen/import_build.go b/codegen/import_build.go index d8f2a2def2..d634834eb2 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 6908d43f98..93d1952102 100644 --- a/codegen/object.go +++ b/codegen/object.go @@ -212,12 +212,17 @@ 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}} @@ -226,11 +231,12 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ }()) } return {{.arr}}`, map[string]interface{}{ - "val": val, - "arr": arr, - "index": index, + "val": val, + "arr": arr, + "index": index, "isScalar": f.IsScalar, - "next": f.doWriteJson(val+"["+index+"]", remainingMods[1:], astType.Elem, false, depth+1), + "usePtr": usePtr, + "next": f.doWriteJson(val+"["+index+"]", remainingMods[1:], astType.Elem, false, depth+1), }) case f.IsScalar: @@ -246,7 +252,7 @@ func (f *Field) doWriteJson(val string, remainingMods []string, astType *ast.Typ return tpl(` return ec._{{.type}}(ctx, field.Selections, {{.val}})`, map[string]interface{}{ "type": f.GQLType, - "val": val, + "val": val, }) } } diff --git a/codegen/templates/data.go b/codegen/templates/data.go index b06c72ab2f..db2816c023 100644 --- a/codegen/templates/data.go +++ b/codegen/templates/data.go @@ -2,12 +2,12 @@ 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{\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\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", "models.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{{ range $model := .Models }}\n\t{{- if .IsInterface }}\n\t\ttype {{.GoType}} interface {}\n\t{{- else }}\n\t\ttype {{.GoType}} struct {\n\t\t\t{{- range $field := .Fields }}\n\t\t\t\t{{- if $field.GoFieldName }}\n\t\t\t\t\t{{ $field.GoFieldName }} {{$field.Signature}} `json:\"{{$field.GQLName}}\"`\n\t\t\t\t{{- else }}\n\t\t\t\t\t{{ $field.GoFKName }} {{$field.GoFKType}}\n\t\t\t\t{{- end }}\n\t\t\t{{- end }}\n\t\t}\n\t{{- end }}\n{{- end}}\n\n{{ range $enum := .Enums }}\n\ttype {{.GoType}} string\n\tconst (\n\t{{ range $value := .Values -}}\n\t\t{{with .Description}} {{.|prefixLines \"// \"}} {{end}}\n\t\t{{$enum.GoType}}{{ .Name|toCamel }} {{$enum.GoType}} = {{.Name|quote}}\n\t{{- end }}\n\t)\n\n\tfunc (e {{.GoType}}) IsValid() bool {\n\t\tswitch e {\n\t\tcase {{ range $index, $element := .Values}}{{if $index}},{{end}}{{ $enum.GoType }}{{ $element.Name|toCamel }}{{end}}:\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tfunc (e {{.GoType}}) String() string {\n\t\treturn string(e)\n\t}\n\n\tfunc (e *{{.GoType}}) UnmarshalGQL(v interface{}) error {\n\t\tstr, ok := v.(string)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"enums must be strings\")\n\t\t}\n\n\t\t*e = {{.GoType}}(str)\n\t\tif !e.IsValid() {\n\t\t\treturn fmt.Errorf(\"%s is not a valid {{.GQLType}}\", str)\n\t\t}\n\t\treturn nil\n\t}\n\n\tfunc (e {{.GoType}}) MarshalGQL(w io.Writer) {\n\t\tfmt.Fprint(w, strconv.Quote(e.String()))\n\t}\n\n{{- end }}\n", - "object.gotpl": "{{ $object := . }}\n\nvar {{ $object.GQLType|lcFirst}}Implementors = {{$object.Implementors}}\n\n// nolint: gocyclo, errcheck, gas, goconst\n{{- if .Stream }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\tObject: {{$object.GQLType|quote}},\n\t})\n\tif len(fields) != 1 {\n\t\tec.Errorf(ctx, \"must subscribe to exactly one stream\")\n\t\treturn nil\n\t}\n\n\tswitch fields[0].Name {\n\t{{- range $field := $object.Fields }}\n\tcase \"{{$field.GQLName}}\":\n\t\treturn ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, fields[0])\n\t{{- end }}\n\tdefault:\n\t\tpanic(\"unknown field \" + strconv.Quote(fields[0].Name))\n\t}\n}\n{{- else }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet{{if not $object.Root}}, obj *{{$object.FullName}} {{end}}) graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\t{{if $object.Root}}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\t\tObject: {{$object.GQLType|quote}},\n\t\t})\n\t{{else}}\n\t\tgraphql.GetResolverContext(ctx).Result = obj\n\t{{end}}\n\n\t{{if $object.IsConcurrent}} var wg sync.WaitGroup {{end}}\n\tout := graphql.NewOrderedMap(len(fields))\n\tinvalid := false\n\tfor i, field := range fields {\n\t\tout.Keys[i] = field.Alias\n\n\t\tswitch field.Name {\n\t\tcase \"__typename\":\n\t\t\tout.Values[i] = graphql.MarshalString({{$object.GQLType|quote}})\n\t\t{{- range $field := $object.Fields }}\n\t\tcase \"{{$field.GQLName}}\":\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\twg.Add(1)\n\t\t\t\tgo func(i int, field graphql.CollectedField) {\n\t\t\t{{- end }}\n\t\t\t\tout.Values[i] = ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, field{{if not $object.Root}}, obj{{end}})\n\t\t\t\t{{- if $field.ASTType.NonNull }}\n\t\t\t\t\tif out.Values[i] == graphql.Null {\n\t\t\t\t\t\tinvalid = true\n\t\t\t\t\t}\n\t\t\t\t{{- end }}\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\t\twg.Done()\n\t\t\t\t}(i, field)\n\t\t\t{{- end }}\n\t\t{{- end }}\n\t\tdefault:\n\t\t\tpanic(\"unknown field \" + strconv.Quote(field.Name))\n\t\t}\n\t}\n\t{{if $object.IsConcurrent}} wg.Wait() {{end}}\n\tif invalid { return graphql.Null }\n\treturn out\n}\n{{- end }}\n", + "object.gotpl": "{{ $object := . }}\n\nvar {{ $object.GQLType|lcFirst}}Implementors = {{$object.Implementors}}\n\n// nolint: gocyclo, errcheck, gas, goconst\n{{- if .Stream }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\tObject: {{$object.GQLType|quote}},\n\t})\n\tif len(fields) != 1 {\n\t\tec.Errorf(ctx, \"must subscribe to exactly one stream\")\n\t\treturn nil\n\t}\n\n\tswitch fields[0].Name {\n\t{{- range $field := $object.Fields }}\n\tcase \"{{$field.GQLName}}\":\n\t\treturn ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, fields[0])\n\t{{- end }}\n\tdefault:\n\t\tpanic(\"unknown field \" + strconv.Quote(fields[0].Name))\n\t}\n}\n{{- else }}\nfunc (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.SelectionSet{{if not $object.Root}}, obj *{{$object.FullName}} {{end}}) graphql.Marshaler {\n\tfields := graphql.CollectFields(ctx, sel, {{$object.GQLType|lcFirst}}Implementors)\n\t{{if $object.Root}}\n\t\tctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{\n\t\t\tObject: {{$object.GQLType|quote}},\n\t\t})\n\t{{end}}\n\n\t{{if $object.IsConcurrent}} var wg sync.WaitGroup {{end}}\n\tout := graphql.NewOrderedMap(len(fields))\n\tinvalid := false\n\tfor i, field := range fields {\n\t\tout.Keys[i] = field.Alias\n\n\t\tswitch field.Name {\n\t\tcase \"__typename\":\n\t\t\tout.Values[i] = graphql.MarshalString({{$object.GQLType|quote}})\n\t\t{{- range $field := $object.Fields }}\n\t\tcase \"{{$field.GQLName}}\":\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\twg.Add(1)\n\t\t\t\tgo func(i int, field graphql.CollectedField) {\n\t\t\t{{- end }}\n\t\t\t\tout.Values[i] = ec._{{$object.GQLType}}_{{$field.GQLName}}(ctx, field{{if not $object.Root}}, obj{{end}})\n\t\t\t\t{{- if $field.ASTType.NonNull }}\n\t\t\t\t\tif out.Values[i] == graphql.Null {\n\t\t\t\t\t\tinvalid = true\n\t\t\t\t\t}\n\t\t\t\t{{- end }}\n\t\t\t{{- if $field.IsConcurrent }}\n\t\t\t\t\twg.Done()\n\t\t\t\t}(i, field)\n\t\t\t{{- end }}\n\t\t{{- end }}\n\t\tdefault:\n\t\t\tpanic(\"unknown field \" + strconv.Quote(field.Name))\n\t\t}\n\t}\n\t{{if $object.IsConcurrent}} wg.Wait() {{end}}\n\tif invalid { return graphql.Null }\n\treturn out\n}\n{{- end }}\n", "resolver.gotpl": "//go:generate gorunpkg github.com/99designs/gqlgen\n\npackage {{ .PackageName }}\n\nimport (\n{{- range $import := .Imports }}\n\t{{- $import.Write }}\n{{ end }}\n)\n\ntype {{.ResolverType}} struct {}\n\n{{ range $object := .Objects -}}\n\t{{- if $object.HasResolvers -}}\n\t\tfunc (r *{{$.ResolverType}}) {{$object.GQLType}}() {{ $object.ResolverInterface.FullName }} {\n\t\t\treturn &{{lcFirst $object.GQLType}}Resolver{r}\n\t\t}\n\t{{ end -}}\n{{ end }}\n\n{{ range $object := .Objects -}}\n\t{{- if $object.HasResolvers -}}\n\t\ttype {{lcFirst $object.GQLType}}Resolver struct { *Resolver }\n\n\t\t{{ range $field := $object.Fields -}}\n\t\t\t{{- if $field.IsResolver -}}\n\t\t\tfunc (r *{{lcFirst $object.GQLType}}Resolver) {{ $field.ShortResolverDeclaration }} {\n\t\t\t\tpanic(\"not implemented\")\n\t\t\t}\n\t\t\t{{ end -}}\n\t\t{{ end -}}\n\t{{ end -}}\n{{ end }}\n", "server.gotpl": "package main\n\nimport (\n{{- range $import := .Imports }}\n\t{{- $import.Write }}\n{{ end }}\n)\n\nconst defaultPort = \"8080\"\n\nfunc main() {\n\tport := os.Getenv(\"PORT\")\n\tif port == \"\" {\n\t\tport = defaultPort\n\t}\n\n\thttp.Handle(\"/\", handler.Playground(\"GraphQL playground\", \"/query\"))\n\thttp.Handle(\"/query\", handler.GraphQL({{.ExecPackageName}}.NewExecutableSchema({{.ExecPackageName}}.Config{Resolvers: &{{.ResolverPackageName}}.Resolver{}})))\n\n\tlog.Printf(\"connect to http://localhost:%s/ for GraphQL playground\", port)\n\tlog.Fatal(http.ListenAndServe(\":\" + port, nil))\n}\n", } diff --git a/codegen/templates/field.gotpl b/codegen/templates/field.gotpl index 3f6e4c7732..ca4d81f425 100644 --- a/codegen/templates/field.gotpl +++ b/codegen/templates/field.gotpl @@ -60,6 +60,7 @@ return graphql.Null } res := resTmp.({{$field.Signature}}) + rctx.Result = res {{ $field.WriteJson }} } {{ end }} diff --git a/codegen/templates/object.gotpl b/codegen/templates/object.gotpl index 810dad1536..e98cbe1ee5 100644 --- a/codegen/templates/object.gotpl +++ b/codegen/templates/object.gotpl @@ -30,8 +30,6 @@ func (ec *executionContext) _{{$object.GQLType}}(ctx context.Context, sel ast.Se ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: {{$object.GQLType|quote}}, }) - {{else}} - graphql.GetResolverContext(ctx).Result = obj {{end}} {{if $object.IsConcurrent}} var wg sync.WaitGroup {{end}} diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 4a057132db..d5dd9431f7 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -98,8 +98,6 @@ var circleImplementors = []string{"Circle", "Shape"} func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, obj *Circle) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, circleImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -138,6 +136,7 @@ func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -156,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) } @@ -165,8 +165,6 @@ var errorImplementors = []string{"Error"} func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, obj *Error) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, errorImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -221,6 +219,7 @@ func (ec *executionContext) _Error_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -239,6 +238,7 @@ func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -260,6 +260,7 @@ func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, fie return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -281,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) { @@ -297,8 +299,6 @@ var forcedResolverImplementors = []string{"ForcedResolver"} func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.SelectionSet, obj *ForcedResolver) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, forcedResolverImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -340,6 +340,7 @@ 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 @@ -354,8 +355,6 @@ var innerObjectImplementors = []string{"InnerObject"} func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionSet, obj *InnerObject) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, innerObjectImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -398,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) } @@ -407,8 +407,6 @@ var invalidIdentifierImplementors = []string{"InvalidIdentifier"} func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.SelectionSet, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, invalidIdentifierImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -451,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) } @@ -460,8 +459,6 @@ var itImplementors = []string{"It"} func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj *introspection1.It) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, itImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -504,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) } @@ -513,8 +511,6 @@ var outerObjectImplementors = []string{"OuterObject"} func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionSet, obj *OuterObject) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, outerObjectImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -557,6 +553,7 @@ 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) } @@ -685,6 +682,7 @@ 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 @@ -708,6 +706,7 @@ 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 @@ -748,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 @@ -787,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 @@ -847,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 @@ -869,17 +871,20 @@ 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, + Index: &idx1, + Result: res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { arr2 := graphql.Array{} for idx2 := range res[idx1] { rctx := &graphql.ResolverContext{ - Index: &idx2, + Index: &idx2, + Result: res[idx1][idx2], } ctx := graphql.WithResolverContext(ctx, rctx) arr2 = append(arr2, func() graphql.Marshaler { @@ -932,6 +937,7 @@ func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -950,10 +956,12 @@ 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, + Index: &idx1, + Result: res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -983,6 +991,7 @@ 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 @@ -1009,6 +1018,7 @@ func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1282,6 +1292,7 @@ func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphq return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1312,6 +1323,7 @@ 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 @@ -1335,6 +1347,7 @@ 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 @@ -1349,8 +1362,6 @@ var rectangleImplementors = []string{"Rectangle", "Shape"} func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet, obj *Rectangle) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, rectangleImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1391,6 +1402,7 @@ func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -1409,6 +1421,7 @@ func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -1427,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) } @@ -1436,8 +1450,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1492,6 +1504,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1510,6 +1523,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1531,6 +1545,7 @@ 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 { @@ -1558,10 +1573,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1578,8 +1595,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1631,6 +1646,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1649,6 +1665,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1670,6 +1687,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1688,6 +1706,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1697,8 +1716,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1760,6 +1777,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1778,6 +1796,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1799,10 +1818,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1831,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) { @@ -1860,6 +1882,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1878,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) } @@ -1887,8 +1911,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1940,6 +1962,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1958,6 +1981,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1979,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) { @@ -2005,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 @@ -2018,8 +2044,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2076,10 +2100,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2108,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) { @@ -2134,6 +2161,7 @@ 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 @@ -2157,6 +2185,7 @@ 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 @@ -2183,10 +2212,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2203,8 +2234,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2263,6 +2292,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2281,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 @@ -2303,6 +2334,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2333,10 +2365,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2362,10 +2396,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2391,10 +2427,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2432,10 +2470,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2461,10 +2501,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2490,6 +2532,7 @@ 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 diff --git a/example/chat/generated.go b/example/chat/generated.go index 099e3be56d..e634ff91d7 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -126,8 +126,6 @@ var chatroomImplementors = []string{"Chatroom"} func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, obj *Chatroom) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, chatroomImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -175,6 +173,7 @@ func (ec *executionContext) _Chatroom_name(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -196,10 +195,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -216,8 +217,6 @@ var messageImplementors = []string{"Message"} func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *Message) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, messageImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -275,6 +274,7 @@ func (ec *executionContext) _Message_id(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -296,6 +296,7 @@ func (ec *executionContext) _Message_text(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -317,6 +318,7 @@ func (ec *executionContext) _Message_createdBy(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -338,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) } @@ -425,6 +428,7 @@ 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) } @@ -496,6 +500,7 @@ 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 @@ -531,6 +536,7 @@ 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 @@ -554,6 +560,7 @@ 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 @@ -623,8 +630,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -679,6 +684,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -697,6 +703,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -718,6 +725,7 @@ 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 { @@ -745,10 +753,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -765,8 +775,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -818,6 +826,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -836,6 +845,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -857,6 +867,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -875,6 +886,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -884,8 +896,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -947,6 +957,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -965,6 +976,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -986,10 +998,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1018,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) { @@ -1047,6 +1062,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1065,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) } @@ -1074,8 +1091,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1127,6 +1142,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1145,6 +1161,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1166,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) { @@ -1192,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 @@ -1205,8 +1224,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1263,10 +1280,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1295,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) { @@ -1321,6 +1341,7 @@ 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 @@ -1344,6 +1365,7 @@ 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 @@ -1370,10 +1392,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1390,8 +1414,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1450,6 +1472,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1468,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 @@ -1490,6 +1514,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1520,10 +1545,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1549,10 +1576,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1578,10 +1607,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1619,10 +1650,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1648,10 +1681,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1677,6 +1712,7 @@ 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 diff --git a/example/config/generated.go b/example/config/generated.go index 2b61dc520e..b8cb067bac 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -159,6 +159,7 @@ 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) } @@ -224,10 +225,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -265,6 +268,7 @@ 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 @@ -288,6 +292,7 @@ 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 @@ -302,8 +307,6 @@ var todoImplementors = []string{"Todo"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, todoImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -371,6 +374,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -392,6 +396,7 @@ func (ec *executionContext) _Todo_databaseId(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -413,6 +418,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -434,6 +440,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) } @@ -455,6 +462,7 @@ 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) } @@ -465,8 +473,6 @@ var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *User) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, userImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -514,6 +520,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -535,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) } @@ -544,8 +552,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -600,6 +606,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -618,6 +625,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -639,6 +647,7 @@ 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 { @@ -666,10 +675,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -686,8 +697,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -739,6 +748,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -757,6 +767,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -778,6 +789,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -796,6 +808,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -805,8 +818,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -868,6 +879,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -886,6 +898,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -907,10 +920,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -939,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) { @@ -968,6 +984,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -986,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) } @@ -995,8 +1013,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1048,6 +1064,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1066,6 +1083,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1087,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) { @@ -1113,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 @@ -1126,8 +1146,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1184,10 +1202,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1216,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) { @@ -1242,6 +1263,7 @@ 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 @@ -1265,6 +1287,7 @@ 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 @@ -1291,10 +1314,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1311,8 +1336,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1371,6 +1394,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1389,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 @@ -1411,6 +1436,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1441,10 +1467,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1470,10 +1498,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1499,10 +1529,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1540,10 +1572,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1569,10 +1603,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1598,6 +1634,7 @@ 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 diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index 743043f844..cc027df156 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -93,8 +93,6 @@ var addressImplementors = []string{"Address"} func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, obj *Address) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, addressImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -147,6 +145,7 @@ func (ec *executionContext) _Address_id(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -168,6 +167,7 @@ func (ec *executionContext) _Address_street(ctx context.Context, field graphql.C return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -189,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) } @@ -198,8 +199,6 @@ var customerImplementors = []string{"Customer"} func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, obj *Customer) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, customerImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -260,6 +259,7 @@ func (ec *executionContext) _Customer_id(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -281,6 +281,7 @@ func (ec *executionContext) _Customer_name(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -299,6 +300,7 @@ 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 @@ -322,10 +324,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -342,8 +346,6 @@ var itemImplementors = []string{"Item"} func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj *Item) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, itemImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -386,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) } @@ -395,8 +398,6 @@ var orderImplementors = []string{"Order"} func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, obj *Order) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, orderImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -456,6 +457,7 @@ func (ec *executionContext) _Order_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -477,6 +479,7 @@ 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) } @@ -498,6 +501,7 @@ func (ec *executionContext) _Order_amount(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -516,10 +520,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -597,10 +603,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -649,10 +657,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -712,17 +722,20 @@ 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, + Index: &idx1, + Result: res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { arr2 := graphql.Array{} for idx2 := range res[idx1] { rctx := &graphql.ResolverContext{ - Index: &idx2, + Index: &idx2, + Result: &res[idx1][idx2], } ctx := graphql.WithResolverContext(ctx, rctx) arr2 = append(arr2, func() graphql.Marshaler { @@ -763,6 +776,7 @@ 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 @@ -786,6 +800,7 @@ 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 @@ -800,8 +815,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -856,6 +869,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -874,6 +888,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -895,6 +910,7 @@ 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 { @@ -922,10 +938,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -942,8 +960,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -995,6 +1011,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1013,6 +1030,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1034,6 +1052,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1052,6 +1071,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1061,8 +1081,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1124,6 +1142,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1142,6 +1161,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1163,10 +1183,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1195,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) { @@ -1224,6 +1247,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1242,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) } @@ -1251,8 +1276,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1304,6 +1327,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1322,6 +1346,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1343,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) { @@ -1369,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 @@ -1382,8 +1409,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1440,10 +1465,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1472,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) { @@ -1498,6 +1526,7 @@ 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 @@ -1521,6 +1550,7 @@ 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 @@ -1547,10 +1577,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1567,8 +1599,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1627,6 +1657,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1645,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 @@ -1667,6 +1699,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1697,10 +1730,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1726,10 +1761,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1755,10 +1792,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1796,10 +1835,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1825,10 +1866,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1854,6 +1897,7 @@ 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 diff --git a/example/scalars/generated.go b/example/scalars/generated.go index 07d32b1210..c4207e3219 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -90,8 +90,6 @@ var addressImplementors = []string{"Address"} func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, obj *model.Address) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, addressImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -136,6 +134,7 @@ 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) } @@ -154,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 @@ -237,6 +237,7 @@ 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 @@ -275,10 +276,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -316,6 +319,7 @@ 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 @@ -339,6 +343,7 @@ 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 @@ -353,8 +358,6 @@ var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, userImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -432,6 +435,7 @@ 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) } @@ -453,6 +457,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) } @@ -471,6 +476,7 @@ 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) } @@ -492,6 +498,7 @@ 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)) } @@ -513,6 +520,7 @@ func (ec *executionContext) _User_primitiveResolver(ctx context.Context, field g return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -534,6 +542,7 @@ func (ec *executionContext) _User_customResolver(ctx context.Context, field grap return graphql.Null } res := resTmp.(model.Point) + rctx.Result = res return res } @@ -552,6 +561,7 @@ 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) } @@ -571,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 } @@ -580,8 +591,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -636,6 +645,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -654,6 +664,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -675,6 +686,7 @@ 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 { @@ -702,10 +714,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -722,8 +736,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -775,6 +787,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -793,6 +806,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -814,6 +828,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -832,6 +847,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -841,8 +857,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -904,6 +918,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -922,6 +937,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -943,10 +959,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -975,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) { @@ -1004,6 +1023,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1022,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) } @@ -1031,8 +1052,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1084,6 +1103,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1102,6 +1122,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1123,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) { @@ -1149,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 @@ -1162,8 +1185,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1220,10 +1241,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1252,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) { @@ -1278,6 +1302,7 @@ 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 @@ -1301,6 +1326,7 @@ 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 @@ -1327,10 +1353,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1347,8 +1375,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1407,6 +1433,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1425,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 @@ -1447,6 +1475,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1477,10 +1506,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1506,10 +1537,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1535,10 +1568,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1576,10 +1611,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1605,10 +1642,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1634,6 +1673,7 @@ 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 diff --git a/example/selection/generated.go b/example/selection/generated.go index bfbb958f24..ab508ececb 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -83,8 +83,6 @@ var likeImplementors = []string{"Like", "Event"} func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj *Like) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, likeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -136,6 +134,7 @@ func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -157,6 +156,7 @@ 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) } @@ -175,6 +175,7 @@ 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 { @@ -199,6 +200,7 @@ 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 { @@ -214,8 +216,6 @@ var postImplementors = []string{"Post", "Event"} func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj *Post) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, postImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -267,6 +267,7 @@ func (ec *executionContext) _Post_message(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -288,6 +289,7 @@ 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) } @@ -306,6 +308,7 @@ 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 { @@ -330,6 +333,7 @@ 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 { @@ -394,10 +398,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -435,6 +441,7 @@ 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 @@ -458,6 +465,7 @@ 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 @@ -472,8 +480,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -528,6 +534,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -546,6 +553,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -567,6 +575,7 @@ 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 { @@ -594,10 +603,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -614,8 +625,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -667,6 +676,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -685,6 +695,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -706,6 +717,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -724,6 +736,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -733,8 +746,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -796,6 +807,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -814,6 +826,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -835,10 +848,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -867,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) { @@ -896,6 +912,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -914,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) } @@ -923,8 +941,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -976,6 +992,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -994,6 +1011,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1015,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) { @@ -1041,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 @@ -1054,8 +1074,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1112,10 +1130,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1144,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) { @@ -1170,6 +1191,7 @@ 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 @@ -1193,6 +1215,7 @@ 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 @@ -1219,10 +1242,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1239,8 +1264,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1299,6 +1322,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1317,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 @@ -1339,6 +1364,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1369,10 +1395,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1398,10 +1426,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1427,10 +1457,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1468,10 +1500,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1497,10 +1531,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1526,6 +1562,7 @@ 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 diff --git a/example/starwars/generated.go b/example/starwars/generated.go index 78c0fcf362..bd208bb524 100644 --- a/example/starwars/generated.go +++ b/example/starwars/generated.go @@ -126,8 +126,6 @@ var droidImplementors = []string{"Droid", "Character"} func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, obj *Droid) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, droidImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -198,6 +196,7 @@ func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -219,6 +218,7 @@ func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -237,10 +237,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -301,6 +303,7 @@ 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) } @@ -323,6 +326,7 @@ 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 { @@ -347,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) } @@ -356,8 +361,6 @@ var friendsConnectionImplementors = []string{"FriendsConnection"} func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.SelectionSet, obj *FriendsConnection) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, friendsConnectionImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -418,6 +421,7 @@ func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, f return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -436,10 +440,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -465,10 +471,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -497,6 +505,7 @@ 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) } @@ -507,8 +516,6 @@ var friendsEdgeImplementors = []string{"FriendsEdge"} func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionSet, obj *FriendsEdge) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, friendsEdgeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -553,6 +560,7 @@ func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -571,6 +579,7 @@ 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) } @@ -581,8 +590,6 @@ var humanImplementors = []string{"Human", "Character"} func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, obj *Human) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, humanImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -664,6 +671,7 @@ func (ec *executionContext) _Human_id(ctx context.Context, field graphql.Collect return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -685,6 +693,7 @@ func (ec *executionContext) _Human_name(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -718,6 +727,7 @@ func (ec *executionContext) _Human_height(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -736,6 +746,7 @@ func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -754,10 +765,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -818,6 +831,7 @@ 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) } @@ -840,6 +854,7 @@ 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 { @@ -864,10 +879,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -946,6 +963,7 @@ 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 @@ -960,8 +978,6 @@ var pageInfoImplementors = []string{"PageInfo"} func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *PageInfo) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, pageInfoImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1014,6 +1030,7 @@ func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field gra return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -1035,6 +1052,7 @@ func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -1056,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) } @@ -1168,6 +1187,7 @@ 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) } @@ -1217,10 +1237,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1261,10 +1283,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1302,6 +1326,7 @@ 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) } @@ -1333,6 +1358,7 @@ 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 @@ -1368,6 +1394,7 @@ 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 @@ -1403,6 +1430,7 @@ 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 @@ -1438,6 +1466,7 @@ 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 @@ -1461,6 +1490,7 @@ 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 @@ -1475,8 +1505,6 @@ var reviewImplementors = []string{"Review"} func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, obj *Review) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, reviewImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1523,6 +1551,7 @@ func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -1541,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 @@ -1563,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) } @@ -1572,8 +1603,6 @@ var starshipImplementors = []string{"Starship"} func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, obj *Starship) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, starshipImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -1636,6 +1665,7 @@ func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalID(res) } @@ -1657,6 +1687,7 @@ func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1690,6 +1721,7 @@ func (ec *executionContext) _Starship_length(ctx context.Context, field graphql. return graphql.Null } res := resTmp.(float64) + rctx.Result = res return graphql.MarshalFloat(res) } @@ -1711,6 +1743,7 @@ 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 { @@ -1732,8 +1765,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1788,6 +1819,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1806,6 +1838,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1827,6 +1860,7 @@ 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 { @@ -1854,10 +1888,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1874,8 +1910,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1927,6 +1961,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1945,6 +1980,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1966,6 +2002,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1984,6 +2021,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1993,8 +2031,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2056,6 +2092,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2074,6 +2111,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2095,10 +2133,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2127,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) { @@ -2156,6 +2197,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -2174,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) } @@ -2183,8 +2226,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2236,6 +2277,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2254,6 +2296,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2275,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) { @@ -2301,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 @@ -2314,8 +2359,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2372,10 +2415,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2404,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) { @@ -2430,6 +2476,7 @@ 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 @@ -2453,6 +2500,7 @@ 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 @@ -2479,10 +2527,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2499,8 +2549,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -2559,6 +2607,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2577,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 @@ -2599,6 +2649,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -2629,10 +2680,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2658,10 +2711,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2687,10 +2742,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2728,10 +2785,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2757,10 +2816,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -2786,6 +2847,7 @@ 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 diff --git a/example/todo/generated.go b/example/todo/generated.go index cf7b6379dc..559b103e73 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -162,6 +162,7 @@ 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) } @@ -203,6 +204,7 @@ 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 @@ -299,6 +301,7 @@ 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 @@ -334,6 +337,7 @@ func (ec *executionContext) _MyQuery_authenticatedTodo(ctx context.Context, fiel return graphql.Null } res := resTmp.(*Todo) + rctx.Result = res if res == nil { return graphql.Null @@ -357,6 +361,7 @@ 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 @@ -383,10 +388,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -424,6 +431,7 @@ 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 @@ -447,6 +455,7 @@ 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 @@ -461,8 +470,6 @@ var todoImplementors = []string{"Todo"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, todoImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -515,6 +522,7 @@ func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.Collecte return graphql.Null } res := resTmp.(int) + rctx.Result = res return graphql.MarshalInt(res) } @@ -536,6 +544,7 @@ func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.Collec return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -557,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) } @@ -566,8 +576,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -622,6 +630,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -640,6 +649,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -661,6 +671,7 @@ 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 { @@ -688,10 +699,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -708,8 +721,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -761,6 +772,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -779,6 +791,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -800,6 +813,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -818,6 +832,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -827,8 +842,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -890,6 +903,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -908,6 +922,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -929,10 +944,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -961,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) { @@ -990,6 +1008,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1008,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) } @@ -1017,8 +1037,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1070,6 +1088,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1088,6 +1107,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1109,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) { @@ -1135,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 @@ -1148,8 +1170,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1206,10 +1226,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1238,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) { @@ -1264,6 +1287,7 @@ 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 @@ -1287,6 +1311,7 @@ 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 @@ -1313,10 +1338,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1333,8 +1360,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1393,6 +1418,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1411,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 @@ -1433,6 +1460,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1463,10 +1491,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1492,10 +1522,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1521,10 +1553,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1562,10 +1596,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1591,10 +1627,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1620,6 +1658,7 @@ 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 diff --git a/integration/generated.go b/integration/generated.go index ec38d14df8..f7802ec3f8 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -98,8 +98,6 @@ var elementImplementors = []string{"Element"} func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, obj *models.Element) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, elementImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -162,6 +160,7 @@ 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) } @@ -184,6 +183,7 @@ func (ec *executionContext) _Element_error(ctx context.Context, field graphql.Co return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -202,6 +202,7 @@ 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 { @@ -299,10 +300,12 @@ 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, + Index: &idx1, + Result: res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -347,6 +350,7 @@ func (ec *executionContext) _Query_date(ctx context.Context, field graphql.Colle return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -365,6 +369,7 @@ 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 @@ -391,6 +396,7 @@ func (ec *executionContext) _Query_jsonEncoding(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -424,6 +430,7 @@ func (ec *executionContext) _Query_error(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -454,6 +461,7 @@ 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 @@ -477,6 +485,7 @@ 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 @@ -491,8 +500,6 @@ var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *remote_api.User) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, userImplementors) - graphql.GetResolverContext(ctx).Result = obj - var wg sync.WaitGroup out := graphql.NewOrderedMap(len(fields)) invalid := false @@ -545,6 +552,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) } @@ -566,6 +574,7 @@ 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 { @@ -581,8 +590,6 @@ var viewerImplementors = []string{"Viewer"} func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *models.Viewer) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, viewerImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -619,6 +626,7 @@ 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 @@ -633,8 +641,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -689,6 +695,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -707,6 +714,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -728,6 +736,7 @@ 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 { @@ -755,10 +764,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -775,8 +786,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -828,6 +837,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -846,6 +856,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -867,6 +878,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -885,6 +897,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -894,8 +907,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __FieldImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -957,6 +968,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -975,6 +987,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -996,10 +1009,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1028,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) { @@ -1057,6 +1073,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return graphql.Null } res := resTmp.(bool) + rctx.Result = res return graphql.MarshalBoolean(res) } @@ -1075,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) } @@ -1084,8 +1102,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1137,6 +1153,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1155,6 +1172,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1176,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) { @@ -1202,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 @@ -1215,8 +1235,6 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1273,10 +1291,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1305,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) { @@ -1331,6 +1352,7 @@ 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 @@ -1354,6 +1376,7 @@ 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 @@ -1380,10 +1403,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1400,8 +1425,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ctx, sel, __TypeImplementors) - graphql.GetResolverContext(ctx).Result = obj - out := graphql.NewOrderedMap(len(fields)) invalid := false for i, field := range fields { @@ -1460,6 +1483,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1478,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 @@ -1500,6 +1525,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return graphql.Null } res := resTmp.(string) + rctx.Result = res return graphql.MarshalString(res) } @@ -1530,10 +1556,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1559,10 +1587,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1588,10 +1618,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1629,10 +1661,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1658,10 +1692,12 @@ 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, + Index: &idx1, + Result: &res[idx1], } ctx := graphql.WithResolverContext(ctx, rctx) arr1 = append(arr1, func() graphql.Marshaler { @@ -1687,6 +1723,7 @@ 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