From 7ba1b3b298695a7382abda437d3417d0aeae9c5b Mon Sep 17 00:00:00 2001 From: asp24 Date: Wed, 17 Apr 2019 13:01:37 +0300 Subject: [PATCH] graphql.CollectFields now accept *RequestContext as first arg It was done because RequestContext is a part of executionContext and can be passed directly without extraction from ctx. This is increasing performance when model depth is high --- codegen/object.gotpl | 4 +- codegen/testserver/generated.go | 70 +++++++++++----------- example/chat/generated.go | 22 +++---- example/config/generated.go | 20 +++---- example/dataloader/generated.go | 22 +++---- example/scalars/generated.go | 18 +++--- example/selection/generated.go | 18 +++--- example/starwars/benchmarks_test.go | 2 + example/starwars/generated/exec.go | 30 +++++----- example/todo/generated.go | 18 +++--- example/type-system-extension/generated.go | 18 +++--- graphql/context.go | 4 +- graphql/exec.go | 5 +- integration/generated.go | 20 +++---- 14 files changed, 136 insertions(+), 135 deletions(-) diff --git a/codegen/object.gotpl b/codegen/object.gotpl index 19da1b1988b..5cc738311cb 100644 --- a/codegen/object.gotpl +++ b/codegen/object.gotpl @@ -4,7 +4,7 @@ var {{ $object.Name|lcFirst}}Implementors = {{$object.Implementors}} {{- if .Stream }} func (ec *executionContext) _{{$object.Name}}(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, {{$object.Name|lcFirst}}Implementors) + fields := graphql.CollectFields(ec.RequestContext, sel, {{$object.Name|lcFirst}}Implementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: {{$object.Name|quote}}, }) @@ -24,7 +24,7 @@ func (ec *executionContext) _{{$object.Name}}(ctx context.Context, sel ast.Selec } {{- else }} func (ec *executionContext) _{{$object.Name}}(ctx context.Context, sel ast.SelectionSet{{ if not $object.Root }},obj {{$object.Reference | ref }}{{ end }}) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, {{$object.Name|lcFirst}}Implementors) + fields := graphql.CollectFields(ec.RequestContext, sel, {{$object.Name|lcFirst}}Implementors) {{if $object.Root}} ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: {{$object.Name|quote}}, diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index ea9638c0e6f..d5ac2e357f1 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -5704,7 +5704,7 @@ func (ec *executionContext) _TestUnion(ctx context.Context, sel ast.SelectionSet var aImplementors = []string{"A", "TestUnion"} func (ec *executionContext) _A(ctx context.Context, sel ast.SelectionSet, obj *A) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, aImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, aImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5731,7 +5731,7 @@ func (ec *executionContext) _A(ctx context.Context, sel ast.SelectionSet, obj *A var aItImplementors = []string{"AIt"} func (ec *executionContext) _AIt(ctx context.Context, sel ast.SelectionSet, obj *AIt) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, aItImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, aItImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5758,7 +5758,7 @@ func (ec *executionContext) _AIt(ctx context.Context, sel ast.SelectionSet, obj var abItImplementors = []string{"AbIt"} func (ec *executionContext) _AbIt(ctx context.Context, sel ast.SelectionSet, obj *AbIt) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, abItImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, abItImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5785,7 +5785,7 @@ func (ec *executionContext) _AbIt(ctx context.Context, sel ast.SelectionSet, obj var autobindImplementors = []string{"Autobind"} func (ec *executionContext) _Autobind(ctx context.Context, sel ast.SelectionSet, obj *Autobind) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, autobindImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, autobindImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5832,7 +5832,7 @@ func (ec *executionContext) _Autobind(ctx context.Context, sel ast.SelectionSet, var bImplementors = []string{"B", "TestUnion"} func (ec *executionContext) _B(ctx context.Context, sel ast.SelectionSet, obj *B) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, bImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, bImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5859,7 +5859,7 @@ func (ec *executionContext) _B(ctx context.Context, sel ast.SelectionSet, obj *B var circleImplementors = []string{"Circle", "Shape", "ShapeUnion"} func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, obj *Circle) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, circleImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, circleImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5885,7 +5885,7 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o var embeddedDefaultScalarImplementors = []string{"EmbeddedDefaultScalar"} func (ec *executionContext) _EmbeddedDefaultScalar(ctx context.Context, sel ast.SelectionSet, obj *EmbeddedDefaultScalar) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, embeddedDefaultScalarImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, embeddedDefaultScalarImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5909,7 +5909,7 @@ func (ec *executionContext) _EmbeddedDefaultScalar(ctx context.Context, sel ast. var embeddedPointerImplementors = []string{"EmbeddedPointer"} func (ec *executionContext) _EmbeddedPointer(ctx context.Context, sel ast.SelectionSet, obj *EmbeddedPointerModel) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, embeddedPointerImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, embeddedPointerImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5935,7 +5935,7 @@ func (ec *executionContext) _EmbeddedPointer(ctx context.Context, sel ast.Select var errorImplementors = []string{"Error"} func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, obj *Error) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, errorImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, errorImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -5974,7 +5974,7 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob var forcedResolverImplementors = []string{"ForcedResolver"} func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.SelectionSet, obj *ForcedResolver) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, forcedResolverImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, forcedResolverImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6007,7 +6007,7 @@ func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.Selecti var innerObjectImplementors = []string{"InnerObject"} func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionSet, obj *InnerObject) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, innerObjectImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, innerObjectImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6034,7 +6034,7 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, invalidIdentifierImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6061,7 +6061,7 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele 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) + fields := graphql.CollectFields(ec.RequestContext, sel, itImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6088,7 +6088,7 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * var mapImplementors = []string{"Map"} func (ec *executionContext) _Map(ctx context.Context, sel ast.SelectionSet, obj *Map) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, mapImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, mapImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6115,7 +6115,7 @@ func (ec *executionContext) _Map(ctx context.Context, sel ast.SelectionSet, obj var mapStringInterfaceTypeImplementors = []string{"MapStringInterfaceType"} func (ec *executionContext) _MapStringInterfaceType(ctx context.Context, sel ast.SelectionSet, obj map[string]interface{}) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, mapStringInterfaceTypeImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, mapStringInterfaceTypeImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6141,7 +6141,7 @@ func (ec *executionContext) _MapStringInterfaceType(ctx context.Context, sel ast var modelMethodsImplementors = []string{"ModelMethods"} func (ec *executionContext) _ModelMethods(ctx context.Context, sel ast.SelectionSet, obj *ModelMethods) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, modelMethodsImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, modelMethodsImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6196,7 +6196,7 @@ func (ec *executionContext) _ModelMethods(ctx context.Context, sel ast.Selection var outerObjectImplementors = []string{"OuterObject"} func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionSet, obj *OuterObject) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, outerObjectImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, outerObjectImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6223,7 +6223,7 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS var overlappingFieldsImplementors = []string{"OverlappingFields"} func (ec *executionContext) _OverlappingFields(ctx context.Context, sel ast.SelectionSet, obj *OverlappingFields) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, overlappingFieldsImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, overlappingFieldsImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6279,7 +6279,7 @@ func (ec *executionContext) _OverlappingFields(ctx context.Context, sel ast.Sele var panicsImplementors = []string{"Panics"} func (ec *executionContext) _Panics(ctx context.Context, sel ast.SelectionSet, obj *Panics) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, panicsImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, panicsImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6343,7 +6343,7 @@ func (ec *executionContext) _Panics(ctx context.Context, sel ast.SelectionSet, o var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -6727,7 +6727,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr var rectangleImplementors = []string{"Rectangle", "Shape", "ShapeUnion"} func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet, obj *Rectangle) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, rectangleImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, rectangleImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6755,7 +6755,7 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet var slicesImplementors = []string{"Slices"} func (ec *executionContext) _Slices(ctx context.Context, sel ast.SelectionSet, obj *Slices) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, slicesImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, slicesImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6791,7 +6791,7 @@ func (ec *executionContext) _Slices(ctx context.Context, sel ast.SelectionSet, o var subscriptionImplementors = []string{"Subscription"} func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, subscriptionImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, subscriptionImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Subscription", }) @@ -6813,7 +6813,7 @@ func (ec *executionContext) _Subscription(ctx context.Context, sel ast.Selection var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *User) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, userImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, userImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6861,7 +6861,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj var validTypeImplementors = []string{"ValidType"} func (ec *executionContext) _ValidType(ctx context.Context, sel ast.SelectionSet, obj *ValidType) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, validTypeImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, validTypeImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6903,7 +6903,7 @@ func (ec *executionContext) _ValidType(ctx context.Context, sel ast.SelectionSet var xXItImplementors = []string{"XXIt"} func (ec *executionContext) _XXIt(ctx context.Context, sel ast.SelectionSet, obj *XXIt) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, xXItImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, xXItImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6930,7 +6930,7 @@ func (ec *executionContext) _XXIt(ctx context.Context, sel ast.SelectionSet, obj var xxItImplementors = []string{"XxIt"} func (ec *executionContext) _XxIt(ctx context.Context, sel ast.SelectionSet, obj *XxIt) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, xxItImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, xxItImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6957,7 +6957,7 @@ func (ec *executionContext) _XxIt(ctx context.Context, sel ast.SelectionSet, obj 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -6996,7 +6996,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -7032,7 +7032,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -7078,7 +7078,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -7114,7 +7114,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -7155,7 +7155,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -7198,7 +7198,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o var asdfItImplementors = []string{"asdfIt"} func (ec *executionContext) _asdfIt(ctx context.Context, sel ast.SelectionSet, obj *AsdfIt) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, asdfItImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, asdfItImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -7225,7 +7225,7 @@ func (ec *executionContext) _asdfIt(ctx context.Context, sel ast.SelectionSet, o var iItImplementors = []string{"iIt"} func (ec *executionContext) _iIt(ctx context.Context, sel ast.SelectionSet, obj *IIt) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, iItImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, iItImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/chat/generated.go b/example/chat/generated.go index 9081ed4439b..2b9a8e1a777 100644 --- a/example/chat/generated.go +++ b/example/chat/generated.go @@ -1572,7 +1572,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co var chatroomImplementors = []string{"Chatroom"} func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, obj *Chatroom) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, chatroomImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, chatroomImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1604,7 +1604,7 @@ func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, var messageImplementors = []string{"Message"} func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *Message) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, messageImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, messageImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1646,7 +1646,7 @@ func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, mutationImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, mutationImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Mutation", @@ -1677,7 +1677,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -1718,7 +1718,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr var subscriptionImplementors = []string{"Subscription"} func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, subscriptionImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, subscriptionImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Subscription", }) @@ -1738,7 +1738,7 @@ func (ec *executionContext) _Subscription(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1777,7 +1777,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1813,7 +1813,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1859,7 +1859,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1895,7 +1895,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1936,7 +1936,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/config/generated.go b/example/config/generated.go index c95c8f1a063..1860c1fc587 100644 --- a/example/config/generated.go +++ b/example/config/generated.go @@ -1498,7 +1498,7 @@ func (ec *executionContext) unmarshalInputNewTodo(ctx context.Context, v interfa var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, mutationImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, mutationImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Mutation", @@ -1529,7 +1529,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -1573,7 +1573,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr var todoImplementors = []string{"Todo"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, todoImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, todoImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1629,7 +1629,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj var userImplementors = []string{"User"} func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *User) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, userImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, userImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1661,7 +1661,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1700,7 +1700,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1736,7 +1736,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1782,7 +1782,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1818,7 +1818,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1859,7 +1859,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/dataloader/generated.go b/example/dataloader/generated.go index ab15069c1a6..fc6655761f9 100644 --- a/example/dataloader/generated.go +++ b/example/dataloader/generated.go @@ -1692,7 +1692,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co var addressImplementors = []string{"Address"} func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, obj *Address) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, addressImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, addressImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1729,7 +1729,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, var customerImplementors = []string{"Customer"} func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, obj *Customer) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, customerImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, customerImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1783,7 +1783,7 @@ func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, var itemImplementors = []string{"Item"} func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj *Item) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, itemImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, itemImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1810,7 +1810,7 @@ func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj var orderImplementors = []string{"Order"} func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, obj *Order) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, orderImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, orderImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1858,7 +1858,7 @@ func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, ob var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -1921,7 +1921,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1960,7 +1960,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1996,7 +1996,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -2042,7 +2042,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -2078,7 +2078,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -2119,7 +2119,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/scalars/generated.go b/example/scalars/generated.go index e611828ae3e..6c73a01a46c 100644 --- a/example/scalars/generated.go +++ b/example/scalars/generated.go @@ -1615,7 +1615,7 @@ func (ec *executionContext) unmarshalInputSearchArgs(ctx context.Context, v inte 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) + fields := graphql.CollectFields(ec.RequestContext, sel, addressImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1644,7 +1644,7 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -1699,7 +1699,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr 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) + fields := graphql.CollectFields(ec.RequestContext, sel, userImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1770,7 +1770,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1809,7 +1809,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1845,7 +1845,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1891,7 +1891,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1927,7 +1927,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1968,7 +1968,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/selection/generated.go b/example/selection/generated.go index 18a99e88ba6..3dd4222807e 100644 --- a/example/selection/generated.go +++ b/example/selection/generated.go @@ -1426,7 +1426,7 @@ func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, ob 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) + fields := graphql.CollectFields(ec.RequestContext, sel, likeImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1462,7 +1462,7 @@ func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj 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) + fields := graphql.CollectFields(ec.RequestContext, sel, postImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1498,7 +1498,7 @@ func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -1539,7 +1539,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1578,7 +1578,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1614,7 +1614,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1660,7 +1660,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1696,7 +1696,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1737,7 +1737,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/starwars/benchmarks_test.go b/example/starwars/benchmarks_test.go index f0d9e1f0438..af2401f222b 100644 --- a/example/starwars/benchmarks_test.go +++ b/example/starwars/benchmarks_test.go @@ -17,7 +17,9 @@ func BenchmarkSimpleQueryNoArgs(b *testing.B) { var body strings.Reader r := httptest.NewRequest("POST", "/graphql", &body) + b.ReportAllocs() b.ResetTimer() + rec := httptest.NewRecorder() for i := 0; i < b.N; i++ { body.Reset(q) diff --git a/example/starwars/generated/exec.go b/example/starwars/generated/exec.go index f31dcbe29b3..5c95db8cd21 100644 --- a/example/starwars/generated/exec.go +++ b/example/starwars/generated/exec.go @@ -2973,7 +2973,7 @@ func (ec *executionContext) _SearchResult(ctx context.Context, sel ast.Selection var droidImplementors = []string{"Droid", "Character", "SearchResult"} func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, obj *models.Droid) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, droidImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, droidImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3037,7 +3037,7 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob var friendsConnectionImplementors = []string{"FriendsConnection"} func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.SelectionSet, obj *models.FriendsConnection) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, friendsConnectionImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, friendsConnectionImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3091,7 +3091,7 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele var friendsEdgeImplementors = []string{"FriendsEdge"} func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionSet, obj *models.FriendsEdge) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, friendsEdgeImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, friendsEdgeImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3120,7 +3120,7 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS var humanImplementors = []string{"Human", "Character", "SearchResult"} func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, obj *models.Human) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, humanImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, humanImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3200,7 +3200,7 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, mutationImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, mutationImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Mutation", @@ -3228,7 +3228,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) var pageInfoImplementors = []string{"PageInfo"} func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *models.PageInfo) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, pageInfoImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, pageInfoImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3265,7 +3265,7 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -3378,7 +3378,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr var reviewImplementors = []string{"Review"} func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, obj *models.Review) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, reviewImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, reviewImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3409,7 +3409,7 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o var starshipImplementors = []string{"Starship", "SearchResult"} func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, obj *models.Starship) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, starshipImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, starshipImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3460,7 +3460,7 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3499,7 +3499,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3535,7 +3535,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3581,7 +3581,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3617,7 +3617,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -3658,7 +3658,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/todo/generated.go b/example/todo/generated.go index 08ffac652d7..4d583693dca 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -1556,7 +1556,7 @@ func (ec *executionContext) unmarshalInputTodoInput(ctx context.Context, v inter var myMutationImplementors = []string{"MyMutation"} func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, myMutationImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, myMutationImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "MyMutation", @@ -1589,7 +1589,7 @@ func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSe var myQueryImplementors = []string{"MyQuery"} func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, myQueryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, myQueryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "MyQuery", @@ -1655,7 +1655,7 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) var todoImplementors = []string{"Todo"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, todoImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, todoImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1692,7 +1692,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1731,7 +1731,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1767,7 +1767,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1813,7 +1813,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1849,7 +1849,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1890,7 +1890,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/example/type-system-extension/generated.go b/example/type-system-extension/generated.go index d15500fd9f9..ad9957b9a31 100644 --- a/example/type-system-extension/generated.go +++ b/example/type-system-extension/generated.go @@ -1581,7 +1581,7 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj var myMutationImplementors = []string{"MyMutation"} func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, myMutationImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, myMutationImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "MyMutation", @@ -1612,7 +1612,7 @@ func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSe var myQueryImplementors = []string{"MyQuery"} func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, myQueryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, myQueryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "MyQuery", @@ -1667,7 +1667,7 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) var todoImplementors = []string{"Todo", "Node", "Data"} func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *Todo) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, todoImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, todoImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1709,7 +1709,7 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1748,7 +1748,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1784,7 +1784,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1830,7 +1830,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1866,7 +1866,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1907,7 +1907,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false diff --git a/graphql/context.go b/graphql/context.go index 58d3c741e12..356f5175b39 100644 --- a/graphql/context.go +++ b/graphql/context.go @@ -132,14 +132,14 @@ func WithResolverContext(ctx context.Context, rc *ResolverContext) context.Conte // This is just a convenient wrapper method for CollectFields func CollectFieldsCtx(ctx context.Context, satisfies []string) []CollectedField { resctx := GetResolverContext(ctx) - return CollectFields(ctx, resctx.Field.Selections, satisfies) + return CollectFields(GetRequestContext(ctx), resctx.Field.Selections, satisfies) } // CollectAllFields returns a slice of all GraphQL field names that were selected for the current resolver context. // The slice will contain the unique set of all field names requested regardless of fragment type conditions. func CollectAllFields(ctx context.Context) []string { resctx := GetResolverContext(ctx) - collected := CollectFields(ctx, resctx.Field.Selections, nil) + collected := CollectFields(GetRequestContext(ctx), resctx.Field.Selections, nil) uniq := make([]string, 0, len(collected)) Next: for _, f := range collected { diff --git a/graphql/exec.go b/graphql/exec.go index d6f0bd03709..3e00a4d57b1 100644 --- a/graphql/exec.go +++ b/graphql/exec.go @@ -19,8 +19,8 @@ type ExecutableSchema interface { // CollectFields returns the set of fields from an ast.SelectionSet where all collected fields satisfy at least one of the GraphQL types // passed through satisfies. Providing an empty or nil slice for satisfies will return collect all fields regardless of fragment // type conditions. -func CollectFields(ctx context.Context, selSet ast.SelectionSet, satisfies []string) []CollectedField { - return collectFields(GetRequestContext(ctx), selSet, satisfies, map[string]bool{}) +func CollectFields(reqCtx *RequestContext, selSet ast.SelectionSet, satisfies []string) []CollectedField { + return collectFields(reqCtx, selSet, satisfies, map[string]bool{}) } func collectFields(reqCtx *RequestContext, selSet ast.SelectionSet, satisfies []string, visited map[string]bool) []CollectedField { @@ -73,7 +73,6 @@ func collectFields(reqCtx *RequestContext, selSet ast.SelectionSet, satisfies [] f := getOrCreateAndAppendField(&groupedFields, childField.Name, func() CollectedField { return childField }) f.Selections = append(f.Selections, childField.Selections...) } - default: panic(fmt.Errorf("unsupported %T", sel)) } diff --git a/integration/generated.go b/integration/generated.go index 6b17e93743e..9bb78f91ec0 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -1647,7 +1647,7 @@ func (ec *executionContext) unmarshalInputDateFilter(ctx context.Context, v inte 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) + fields := graphql.CollectFields(ec.RequestContext, sel, elementImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1708,7 +1708,7 @@ func (ec *executionContext) _Element(ctx context.Context, sel ast.SelectionSet, var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ctx, sel, queryImplementors) + fields := graphql.CollectFields(ec.RequestContext, sel, queryImplementors) ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ Object: "Query", @@ -1802,7 +1802,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr 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) + fields := graphql.CollectFields(ec.RequestContext, sel, userImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1843,7 +1843,7 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj 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) + fields := graphql.CollectFields(ec.RequestContext, sel, viewerImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1867,7 +1867,7 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1906,7 +1906,7 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1942,7 +1942,7 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -1988,7 +1988,7 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -2024,7 +2024,7 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) invalid := false @@ -2065,7 +2065,7 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, 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) + fields := graphql.CollectFields(ec.RequestContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) invalid := false