From 77260e88c853a047e4e61a5357ceda4a5ea26405 Mon Sep 17 00:00:00 2001 From: Viktor Stanchev Date: Mon, 25 Apr 2022 07:38:40 -0400 Subject: [PATCH] shorten some generated code (#2120) * shorten some generated code * generate examples --- _examples/chat/generated.go | 226 ++---- _examples/config/generated.go | 231 ++---- _examples/dataloader/generated.go | 234 ++----- .../accounts/graph/generated/generated.go | 224 ++---- .../products/graph/generated/generated.go | 229 ++---- .../reviews/graph/generated/generated.go | 249 ++----- _examples/fileupload/generated.go | 237 ++----- _examples/scalars/generated.go | 244 ++----- _examples/selection/generated.go | 229 ++---- _examples/starwars/generated/exec.go | 306 ++------ _examples/todo/generated.go | 218 ++---- _examples/type-system-extension/generated.go | 216 ++---- codegen/object.gotpl | 9 +- .../followschema/builtinscalar.generated.go | 5 +- .../followschema/complexity.generated.go | 20 +- .../followschema/defaults.generated.go | 31 +- .../followschema/directive.generated.go | 20 +- .../followschema/embedded.generated.go | 15 +- .../followschema/interfaces.generated.go | 100 +-- .../followschema/issue896.generated.go | 5 +- .../followschema/loops.generated.go | 10 +- .../testserver/followschema/maps.generated.go | 10 +- .../followschema/nulls.generated.go | 20 +- .../followschema/prelude.generated.go | 175 +---- .../primitive_objects.generated.go | 10 +- .../ptr_to_ptr_input.generated.go | 25 +- .../followschema/ptr_to_slice.generated.go | 5 +- .../followschema/scalar_default.generated.go | 5 +- .../followschema/schema.generated.go | 94 +-- .../followschema/slices.generated.go | 20 +- .../followschema/useptr.generated.go | 10 +- .../testserver/followschema/v-ok.generated.go | 10 +- .../followschema/validtypes.generated.go | 30 +- .../weird_type_cases.generated.go | 30 +- .../followschema/wrapped_type.generated.go | 10 +- codegen/testserver/singlefile/generated.go | 660 ++++-------------- integration/generated.go | 199 ++---- .../testdata/entityresolver/generated/exec.go | 364 ++-------- 38 files changed, 1026 insertions(+), 3709 deletions(-) diff --git a/_examples/chat/generated.go b/_examples/chat/generated.go index e7b329c6ff..8b7ed03485 100644 --- a/_examples/chat/generated.go +++ b/_examples/chat/generated.go @@ -2853,21 +2853,15 @@ func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Chatroom") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Chatroom_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Chatroom_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "messages": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Chatroom_messages(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Chatroom_messages(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -2894,41 +2888,29 @@ func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Message") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Message_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Message_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "text": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Message_text(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Message_text(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "createdBy": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Message_createdBy(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Message_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "createdAt": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Message_createdAt(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Message_createdAt(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -2964,11 +2946,10 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "post": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_post(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_post(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ @@ -3024,18 +3005,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3079,48 +3058,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3147,38 +3111,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3202,58 +3154,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3277,38 +3211,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3332,52 +3254,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3404,77 +3308,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/config/generated.go b/_examples/config/generated.go index a1b9bd858b..3703f30c57 100644 --- a/_examples/config/generated.go +++ b/_examples/config/generated.go @@ -2849,11 +2849,10 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "createTodo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createTodo(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createTodo(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ @@ -2912,18 +2911,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2967,41 +2964,29 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj }) case "databaseId": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_databaseId(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_databaseId(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "text": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_text(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_text(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "done": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_done(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_done(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "user": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_user(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_user(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -3028,31 +3013,22 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "role": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_role(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_role(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3079,48 +3055,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3147,38 +3108,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3202,58 +3151,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3277,38 +3208,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3332,52 +3251,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3404,77 +3305,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/dataloader/generated.go b/_examples/dataloader/generated.go index 99357c3969..15bb13880b 100644 --- a/_examples/dataloader/generated.go +++ b/_examples/dataloader/generated.go @@ -3029,31 +3029,22 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Address") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Address_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Address_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "street": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Address_street(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Address_street(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "country": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Address_country(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Address_country(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3080,21 +3071,15 @@ func (ec *executionContext) _Customer(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Customer") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Customer_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Customer_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Customer_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Customer_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -3155,11 +3140,8 @@ func (ec *executionContext) _Item(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Item") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Item_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Item_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3186,31 +3168,22 @@ func (ec *executionContext) _Order(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Order") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Order_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Order_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "date": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Order_date(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Order_date(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "amount": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Order_amount(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Order_amount(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -3323,18 +3296,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3358,48 +3329,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3426,38 +3382,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3481,58 +3425,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3556,38 +3482,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3611,52 +3525,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3683,77 +3579,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/federation/accounts/graph/generated/generated.go b/_examples/federation/accounts/graph/generated/generated.go index 9c31d91220..5310ef5efd 100644 --- a/_examples/federation/accounts/graph/generated/generated.go +++ b/_examples/federation/accounts/graph/generated/generated.go @@ -2931,21 +2931,15 @@ func (ec *executionContext) _EmailHost(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("EmailHost") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmailHost_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmailHost_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmailHost_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmailHost_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3123,18 +3117,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3158,41 +3150,29 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "host": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_host(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_host(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "email": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_email(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_email(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "username": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_username(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_username(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3219,11 +3199,8 @@ func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("_Service") case "sdl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.__Service_sdl(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3247,48 +3224,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3315,38 +3277,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3370,58 +3320,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3445,38 +3377,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3500,52 +3420,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3572,77 +3474,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/federation/products/graph/generated/generated.go b/_examples/federation/products/graph/generated/generated.go index 48809f42bb..ef6d811ca7 100644 --- a/_examples/federation/products/graph/generated/generated.go +++ b/_examples/federation/products/graph/generated/generated.go @@ -3224,21 +3224,15 @@ func (ec *executionContext) _Manufacturer(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("Manufacturer") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Manufacturer_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Manufacturer_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Manufacturer_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Manufacturer_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3265,51 +3259,36 @@ func (ec *executionContext) _Product(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Product") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "manufacturer": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_manufacturer(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_manufacturer(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "upc": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_upc(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_upc(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "price": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_price(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_price(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3411,18 +3390,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3446,11 +3423,8 @@ func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("_Service") case "sdl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.__Service_sdl(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3474,48 +3448,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3542,38 +3501,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3597,58 +3544,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3672,38 +3601,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3727,52 +3644,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3799,77 +3698,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/federation/reviews/graph/generated/generated.go b/_examples/federation/reviews/graph/generated/generated.go index 5d70a18487..0bb7fcb70c 100644 --- a/_examples/federation/reviews/graph/generated/generated.go +++ b/_examples/federation/reviews/graph/generated/generated.go @@ -3259,11 +3259,8 @@ func (ec *executionContext) _EmailHost(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("EmailHost") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmailHost_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmailHost_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3366,11 +3363,8 @@ func (ec *executionContext) _Manufacturer(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("Manufacturer") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Manufacturer_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Manufacturer_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3397,31 +3391,22 @@ func (ec *executionContext) _Product(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Product") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "manufacturer": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_manufacturer(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_manufacturer(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "reviews": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Product_reviews(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Product_reviews(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3500,18 +3485,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3535,31 +3518,22 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Review") case "body": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Review_body(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Review_body(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "author": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Review_author(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Review_author(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "product": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Review_product(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Review_product(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3586,31 +3560,22 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "host": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_host(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_host(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "email": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_email(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_email(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -3654,11 +3619,8 @@ func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("_Service") case "sdl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.__Service_sdl(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3682,48 +3644,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3750,38 +3697,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3805,58 +3740,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3880,38 +3797,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3935,52 +3840,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -4007,77 +3894,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/fileupload/generated.go b/_examples/fileupload/generated.go index f9543b8068..f3d94a7a5c 100644 --- a/_examples/fileupload/generated.go +++ b/_examples/fileupload/generated.go @@ -2818,41 +2818,29 @@ func (ec *executionContext) _File(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("File") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._File_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._File_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._File_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._File_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "content": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._File_content(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._File_content(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "contentType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._File_contentType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._File_contentType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -2888,41 +2876,37 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "singleUpload": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_singleUpload(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_singleUpload(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "singleUploadWithPayload": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_singleUploadWithPayload(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_singleUploadWithPayload(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "multipleUpload": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_multipleUpload(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_multipleUpload(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "multipleUploadWithPayload": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_multipleUploadWithPayload(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_multipleUploadWithPayload(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ @@ -2981,18 +2965,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3016,48 +2998,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3084,38 +3051,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3139,58 +3094,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3214,38 +3151,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3269,52 +3194,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3341,77 +3248,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/scalars/generated.go b/_examples/scalars/generated.go index e3e75554d8..1e7c86fc2c 100644 --- a/_examples/scalars/generated.go +++ b/_examples/scalars/generated.go @@ -3181,21 +3181,15 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Address") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Address_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Address_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "location": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Address_location(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Address_location(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3294,18 +3288,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3329,59 +3321,38 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "created": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_created(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_created(ctx, field, obj) case "modified": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_modified(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_modified(ctx, field, obj) case "valPrefs": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_valPrefs(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_valPrefs(ctx, field, obj) case "ptrPrefs": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_ptrPrefs(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_ptrPrefs(ctx, field, obj) case "isBanned": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_isBanned(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_isBanned(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -3427,18 +3398,12 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj }) case "address": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_address(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_address(ctx, field, obj) case "tier": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_tier(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_tier(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3462,48 +3427,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3530,38 +3480,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3585,58 +3523,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3660,38 +3580,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3715,52 +3623,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3787,77 +3677,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/selection/generated.go b/_examples/selection/generated.go index d39ed954ca..26a013e9c5 100644 --- a/_examples/selection/generated.go +++ b/_examples/selection/generated.go @@ -2603,38 +2603,26 @@ func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Like") case "reaction": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Like_reaction(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Like_reaction(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "sent": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Like_sent(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Like_sent(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "selection": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Like_selection(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Like_selection(ctx, field, obj) case "collected": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Like_collected(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Like_collected(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2658,38 +2646,26 @@ func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Post") case "message": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Post_message(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Post_message(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "sent": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Post_sent(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Post_sent(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "selection": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Post_selection(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Post_selection(ctx, field, obj) case "collected": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Post_collected(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Post_collected(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2742,18 +2718,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2777,48 +2751,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -2845,38 +2804,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2900,58 +2847,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2975,38 +2904,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3030,52 +2947,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3102,77 +3001,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/starwars/generated/exec.go b/_examples/starwars/generated/exec.go index a484439ceb..42d7a3b527 100644 --- a/_examples/starwars/generated/exec.go +++ b/_examples/starwars/generated/exec.go @@ -4829,21 +4829,15 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Droid") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Droid_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Droid_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Droid_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Droid_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -4886,21 +4880,15 @@ func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, ob }) case "appearsIn": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Droid_appearsIn(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Droid_appearsIn(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "primaryFunction": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Droid_primaryFunction(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Droid_primaryFunction(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4924,11 +4912,8 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("FriendsConnection") case "totalCount": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._FriendsConnection_totalCount(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._FriendsConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -4968,11 +4953,8 @@ func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.Sele }) case "pageInfo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._FriendsConnection_pageInfo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._FriendsConnection_pageInfo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -4999,21 +4981,15 @@ func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("FriendsEdge") case "cursor": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._FriendsEdge_cursor(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._FriendsEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "node": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._FriendsEdge_node(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._FriendsEdge_node(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5037,41 +5013,29 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Human") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Human_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Human_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Human_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Human_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "height": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Human_height(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Human_height(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "mass": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Human_mass(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Human_mass(ctx, field, obj) case "friends": field := field @@ -5111,11 +5075,8 @@ func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, ob }) case "appearsIn": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Human_appearsIn(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Human_appearsIn(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -5168,11 +5129,10 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "createReview": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createReview(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createReview(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5196,31 +5156,22 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("PageInfo") case "startCursor": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PageInfo_startCursor(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "endCursor": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PageInfo_endCursor(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "hasNextPage": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PageInfo_hasNextPage(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5402,18 +5353,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5437,28 +5386,19 @@ func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Review") case "stars": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Review_stars(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Review_stars(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "commentary": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Review_commentary(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Review_commentary(ctx, field, obj) case "time": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Review_time(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Review_time(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5482,21 +5422,15 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Starship") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Starship_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Starship_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Starship_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Starship_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -5522,11 +5456,8 @@ func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, }) case "history": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Starship_history(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Starship_history(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -5553,48 +5484,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5621,38 +5537,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5676,58 +5580,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5751,38 +5637,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5806,52 +5680,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5878,77 +5734,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/todo/generated.go b/_examples/todo/generated.go index f190d16f7d..682e31030e 100644 --- a/_examples/todo/generated.go +++ b/_examples/todo/generated.go @@ -2772,21 +2772,19 @@ func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("MyMutation") case "createTodo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MyMutation_createTodo(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._MyMutation_createTodo(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "updateTodo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MyMutation_updateTodo(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._MyMutation_updateTodo(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2882,18 +2880,16 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MyQuery___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._MyQuery___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MyQuery___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._MyQuery___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2917,31 +2913,22 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Todo") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "text": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_text(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_text(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "done": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_done(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_done(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -2968,48 +2955,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3036,38 +3008,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3091,58 +3051,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3166,38 +3108,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3221,52 +3151,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3293,77 +3205,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/_examples/type-system-extension/generated.go b/_examples/type-system-extension/generated.go index c59357f30b..9880e6e686 100644 --- a/_examples/type-system-extension/generated.go +++ b/_examples/type-system-extension/generated.go @@ -2814,11 +2814,10 @@ func (ec *executionContext) _MyMutation(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("MyMutation") case "createTodo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MyMutation_createTodo(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._MyMutation_createTodo(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ @@ -2897,18 +2896,16 @@ func (ec *executionContext) _MyQuery(ctx context.Context, sel ast.SelectionSet) return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MyQuery___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._MyQuery___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MyQuery___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._MyQuery___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -2932,41 +2929,29 @@ func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Todo") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "text": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_text(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_text(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "state": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_state(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_state(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "verified": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Todo_verified(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Todo_verified(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -2993,48 +2978,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3061,38 +3031,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3116,58 +3074,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3191,38 +3131,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3246,52 +3174,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3318,77 +3228,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/object.gotpl b/codegen/object.gotpl index 3dd2a5abf2..1fbdfacec1 100644 --- a/codegen/object.gotpl +++ b/codegen/object.gotpl @@ -80,13 +80,12 @@ func (ec *executionContext) _{{$object.Name}}(ctx context.Context, sel ast.Selec {{end}} }) {{- else }} - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._{{$object.Name}}_{{$field.Name}}(ctx, field{{if not $object.Root}}, obj{{end}}) - } {{if $object.Root}} - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._{{$object.Name}}_{{$field.Name}}(ctx, field) + }) {{else}} - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._{{$object.Name}}_{{$field.Name}}(ctx, field, obj) {{end}} {{- if $field.TypeReference.GQL.NonNull }} diff --git a/codegen/testserver/followschema/builtinscalar.generated.go b/codegen/testserver/followschema/builtinscalar.generated.go index d68e761e93..b10f78eee3 100644 --- a/codegen/testserver/followschema/builtinscalar.generated.go +++ b/codegen/testserver/followschema/builtinscalar.generated.go @@ -89,11 +89,8 @@ func (ec *executionContext) _Map(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Map") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Map_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Map_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/complexity.generated.go b/codegen/testserver/followschema/complexity.generated.go index d49b3d46d4..6af7860db4 100644 --- a/codegen/testserver/followschema/complexity.generated.go +++ b/codegen/testserver/followschema/complexity.generated.go @@ -258,21 +258,15 @@ func (ec *executionContext) _OverlappingFields(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("OverlappingFields") case "oneFoo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_oneFoo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_oneFoo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "twoFoo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_twoFoo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_twoFoo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -298,21 +292,15 @@ func (ec *executionContext) _OverlappingFields(ctx context.Context, sel ast.Sele }) case "newFoo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_newFoo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_newFoo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "new_foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_new_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_new_foo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) diff --git a/codegen/testserver/followschema/defaults.generated.go b/codegen/testserver/followschema/defaults.generated.go index 28a5c45886..af3b550594 100644 --- a/codegen/testserver/followschema/defaults.generated.go +++ b/codegen/testserver/followschema/defaults.generated.go @@ -384,18 +384,12 @@ func (ec *executionContext) _DefaultParametersMirror(ctx context.Context, sel as case "__typename": out.Values[i] = graphql.MarshalString("DefaultParametersMirror") case "falsyBoolean": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._DefaultParametersMirror_falsyBoolean(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._DefaultParametersMirror_falsyBoolean(ctx, field, obj) case "truthyBoolean": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._DefaultParametersMirror_truthyBoolean(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._DefaultParametersMirror_truthyBoolean(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -428,31 +422,28 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "defaultInput": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_defaultInput(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_defaultInput(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "updateSomething": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_updateSomething(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateSomething(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "updatePtrToPtr": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_updatePtrToPtr(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updatePtrToPtr(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/directive.generated.go b/codegen/testserver/followschema/directive.generated.go index f95556d1de..ff81b5569c 100644 --- a/codegen/testserver/followschema/directive.generated.go +++ b/codegen/testserver/followschema/directive.generated.go @@ -631,28 +631,19 @@ func (ec *executionContext) _ObjectDirectives(ctx context.Context, sel ast.Selec case "__typename": out.Values[i] = graphql.MarshalString("ObjectDirectives") case "text": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectives_text(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectives_text(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "nullableText": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectives_nullableText(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectives_nullableText(ctx, field, obj) case "order": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectives_order(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectives_order(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -679,11 +670,8 @@ func (ec *executionContext) _ObjectDirectivesWithCustomGoModel(ctx context.Conte case "__typename": out.Values[i] = graphql.MarshalString("ObjectDirectivesWithCustomGoModel") case "nullableText": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectivesWithCustomGoModel_nullableText(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectivesWithCustomGoModel_nullableText(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/embedded.generated.go b/codegen/testserver/followschema/embedded.generated.go index c804c179fb..03d84cd50e 100644 --- a/codegen/testserver/followschema/embedded.generated.go +++ b/codegen/testserver/followschema/embedded.generated.go @@ -171,11 +171,8 @@ func (ec *executionContext) _EmbeddedCase1(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedCase1") case "exportedEmbeddedPointerExportedMethod": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedCase1_exportedEmbeddedPointerExportedMethod(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedCase1_exportedEmbeddedPointerExportedMethod(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -202,11 +199,8 @@ func (ec *executionContext) _EmbeddedCase2(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedCase2") case "unexportedEmbeddedPointerExportedMethod": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedCase2_unexportedEmbeddedPointerExportedMethod(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedCase2_unexportedEmbeddedPointerExportedMethod(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -233,11 +227,8 @@ func (ec *executionContext) _EmbeddedCase3(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedCase3") case "unexportedEmbeddedInterfaceExportedMethod": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedCase3_unexportedEmbeddedInterfaceExportedMethod(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedCase3_unexportedEmbeddedInterfaceExportedMethod(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/interfaces.generated.go b/codegen/testserver/followschema/interfaces.generated.go index b5ee60df59..5e89ac7ff4 100644 --- a/codegen/testserver/followschema/interfaces.generated.go +++ b/codegen/testserver/followschema/interfaces.generated.go @@ -1007,21 +1007,15 @@ func (ec *executionContext) _BackedByInterface(ctx context.Context, sel ast.Sele }) case "thisShouldBind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._BackedByInterface_thisShouldBind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._BackedByInterface_thisShouldBind(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "thisShouldBindWithError": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._BackedByInterface_thisShouldBindWithError(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._BackedByInterface_thisShouldBindWithError(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -1048,21 +1042,15 @@ func (ec *executionContext) _Cat(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Cat") case "species": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Cat_species(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Cat_species(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "catBreed": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Cat_catBreed(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Cat_catBreed(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -1089,25 +1077,16 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Circle") case "radius": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Circle_radius(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Circle_radius(ctx, field, obj) case "area": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Circle_area(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Circle_area(ctx, field, obj) case "coordinates": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Circle_coordinates(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Circle_coordinates(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -1131,31 +1110,22 @@ func (ec *executionContext) _ConcreteNodeA(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("ConcreteNodeA") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeA_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeA_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "child": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeA_child(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeA_child(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeA_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeA_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -1182,21 +1152,15 @@ func (ec *executionContext) _ConcreteNodeInterface(ctx context.Context, sel ast. case "__typename": out.Values[i] = graphql.MarshalString("ConcreteNodeInterface") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeInterface_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeInterface_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "child": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeInterface_child(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeInterface_child(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -1223,21 +1187,15 @@ func (ec *executionContext) _Coordinates(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("Coordinates") case "x": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Coordinates_x(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Coordinates_x(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "y": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Coordinates_y(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Coordinates_y(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -1264,21 +1222,15 @@ func (ec *executionContext) _Dog(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Dog") case "species": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Dog_species(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Dog_species(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "dogBreed": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Dog_dogBreed(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Dog_dogBreed(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -1305,32 +1257,20 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("Rectangle") case "length": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_length(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_length(ctx, field, obj) case "width": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_width(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_width(ctx, field, obj) case "area": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_area(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_area(ctx, field, obj) case "coordinates": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_coordinates(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_coordinates(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/issue896.generated.go b/codegen/testserver/followschema/issue896.generated.go index afc5f33cb5..2e0334a802 100644 --- a/codegen/testserver/followschema/issue896.generated.go +++ b/codegen/testserver/followschema/issue896.generated.go @@ -87,11 +87,8 @@ func (ec *executionContext) _CheckIssue896(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("CheckIssue896") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._CheckIssue896_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._CheckIssue896_id(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/loops.generated.go b/codegen/testserver/followschema/loops.generated.go index 68281c4bcc..fa3965fa27 100644 --- a/codegen/testserver/followschema/loops.generated.go +++ b/codegen/testserver/followschema/loops.generated.go @@ -138,11 +138,8 @@ func (ec *executionContext) _LoopA(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("LoopA") case "b": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._LoopA_b(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._LoopA_b(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -169,11 +166,8 @@ func (ec *executionContext) _LoopB(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("LoopB") case "a": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._LoopB_a(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._LoopB_a(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/maps.generated.go b/codegen/testserver/followschema/maps.generated.go index 13f5c38899..e34501a885 100644 --- a/codegen/testserver/followschema/maps.generated.go +++ b/codegen/testserver/followschema/maps.generated.go @@ -166,18 +166,12 @@ func (ec *executionContext) _MapStringInterfaceType(ctx context.Context, sel ast case "__typename": out.Values[i] = graphql.MarshalString("MapStringInterfaceType") case "a": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MapStringInterfaceType_a(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MapStringInterfaceType_a(ctx, field, obj) case "b": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MapStringInterfaceType_b(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MapStringInterfaceType_b(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/nulls.generated.go b/codegen/testserver/followschema/nulls.generated.go index 2db46e2153..13f0f00420 100644 --- a/codegen/testserver/followschema/nulls.generated.go +++ b/codegen/testserver/followschema/nulls.generated.go @@ -475,38 +475,26 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Error") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "errorOnNonRequiredField": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_errorOnNonRequiredField(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_errorOnNonRequiredField(ctx, field, obj) case "errorOnRequiredField": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_errorOnRequiredField(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_errorOnRequiredField(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "nilOnRequiredField": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_nilOnRequiredField(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_nilOnRequiredField(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/prelude.generated.go b/codegen/testserver/followschema/prelude.generated.go index 8c9587d398..a61e2bb895 100644 --- a/codegen/testserver/followschema/prelude.generated.go +++ b/codegen/testserver/followschema/prelude.generated.go @@ -1745,48 +1745,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -1813,38 +1798,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -1868,58 +1841,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -1943,38 +1898,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -1998,52 +1941,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -2070,77 +1995,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/primitive_objects.generated.go b/codegen/testserver/followschema/primitive_objects.generated.go index cd670dd0d3..80b9ad21ca 100644 --- a/codegen/testserver/followschema/primitive_objects.generated.go +++ b/codegen/testserver/followschema/primitive_objects.generated.go @@ -284,11 +284,8 @@ func (ec *executionContext) _Primitive(ctx context.Context, sel ast.SelectionSet }) case "squared": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Primitive_squared(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Primitive_squared(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -335,11 +332,8 @@ func (ec *executionContext) _PrimitiveString(ctx context.Context, sel ast.Select }) case "doubled": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PrimitiveString_doubled(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PrimitiveString_doubled(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) diff --git a/codegen/testserver/followschema/ptr_to_ptr_input.generated.go b/codegen/testserver/followschema/ptr_to_ptr_input.generated.go index 54ca756aab..567aa3043e 100644 --- a/codegen/testserver/followschema/ptr_to_ptr_input.generated.go +++ b/codegen/testserver/followschema/ptr_to_ptr_input.generated.go @@ -330,21 +330,15 @@ func (ec *executionContext) _PtrToPtrInner(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("PtrToPtrInner") case "key": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrInner_key(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrInner_key(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrInner_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrInner_value(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -371,28 +365,19 @@ func (ec *executionContext) _PtrToPtrOuter(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("PtrToPtrOuter") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrOuter_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrOuter_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "inner": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrOuter_inner(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrOuter_inner(ctx, field, obj) case "stupidInner": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrOuter_stupidInner(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrOuter_stupidInner(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/ptr_to_slice.generated.go b/codegen/testserver/followschema/ptr_to_slice.generated.go index 1bdff26758..0a6c68b624 100644 --- a/codegen/testserver/followschema/ptr_to_slice.generated.go +++ b/codegen/testserver/followschema/ptr_to_slice.generated.go @@ -86,11 +86,8 @@ func (ec *executionContext) _PtrToSliceContainer(ctx context.Context, sel ast.Se case "__typename": out.Values[i] = graphql.MarshalString("PtrToSliceContainer") case "ptrToSlice": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToSliceContainer_ptrToSlice(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToSliceContainer_ptrToSlice(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/scalar_default.generated.go b/codegen/testserver/followschema/scalar_default.generated.go index af5e4114a1..1e2362c914 100644 --- a/codegen/testserver/followschema/scalar_default.generated.go +++ b/codegen/testserver/followschema/scalar_default.generated.go @@ -86,11 +86,8 @@ func (ec *executionContext) _EmbeddedDefaultScalar(ctx context.Context, sel ast. case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedDefaultScalar") case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedDefaultScalar_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedDefaultScalar_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/schema.generated.go b/codegen/testserver/followschema/schema.generated.go index 05be1e50a4..bb8b19614a 100644 --- a/codegen/testserver/followschema/schema.generated.go +++ b/codegen/testserver/followschema/schema.generated.go @@ -5494,51 +5494,36 @@ func (ec *executionContext) _Autobind(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Autobind") case "int": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_int(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_int(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "int32": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_int32(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_int32(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "int64": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_int64(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_int64(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "idStr": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_idStr(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_idStr(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "idInt": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_idInt(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_idInt(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5565,18 +5550,12 @@ func (ec *executionContext) _EmbeddedPointer(ctx context.Context, sel ast.Select case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedPointer") case "ID": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedPointer_ID(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedPointer_ID(ctx, field, obj) case "Title": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedPointer_Title(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedPointer_Title(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -5638,11 +5617,8 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("InnerObject") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._InnerObject_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._InnerObject_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5669,11 +5645,8 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("InvalidIdentifier") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._InvalidIdentifier_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._InvalidIdentifier_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5700,11 +5673,8 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * case "__typename": out.Values[i] = graphql.MarshalString("It") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._It_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._It_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5751,11 +5721,8 @@ func (ec *executionContext) _ModelMethods(ctx context.Context, sel ast.Selection }) case "noContext": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ModelMethods_noContext(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ModelMethods_noContext(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -5802,11 +5769,8 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("OuterObject") case "inner": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OuterObject_inner(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OuterObject_inner(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -5833,11 +5797,8 @@ func (ec *executionContext) _Pet(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Pet") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Pet_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Pet_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -7259,18 +7220,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -7328,11 +7287,8 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -7358,21 +7314,15 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj }) case "created": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_created(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_created(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "updated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_updated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_updated(ctx, field, obj) case "pets": field := field diff --git a/codegen/testserver/followschema/slices.generated.go b/codegen/testserver/followschema/slices.generated.go index 36b4595855..a37a7e50f7 100644 --- a/codegen/testserver/followschema/slices.generated.go +++ b/codegen/testserver/followschema/slices.generated.go @@ -206,35 +206,23 @@ func (ec *executionContext) _Slices(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Slices") case "test1": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test1(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test1(ctx, field, obj) case "test2": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test2(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test2(ctx, field, obj) case "test3": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test3(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test3(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "test4": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test4(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test4(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/useptr.generated.go b/codegen/testserver/followschema/useptr.generated.go index 59dc76e1f1..12b53e8aae 100644 --- a/codegen/testserver/followschema/useptr.generated.go +++ b/codegen/testserver/followschema/useptr.generated.go @@ -154,11 +154,8 @@ func (ec *executionContext) _A(ctx context.Context, sel ast.SelectionSet, obj *A case "__typename": out.Values[i] = graphql.MarshalString("A") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._A_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._A_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -185,11 +182,8 @@ func (ec *executionContext) _B(ctx context.Context, sel ast.SelectionSet, obj *B case "__typename": out.Values[i] = graphql.MarshalString("B") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._B_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._B_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/v-ok.generated.go b/codegen/testserver/followschema/v-ok.generated.go index 59a2d986e7..de9329f548 100644 --- a/codegen/testserver/followschema/v-ok.generated.go +++ b/codegen/testserver/followschema/v-ok.generated.go @@ -132,11 +132,8 @@ func (ec *executionContext) _VOkCaseNil(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("VOkCaseNil") case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._VOkCaseNil_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._VOkCaseNil_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -160,11 +157,8 @@ func (ec *executionContext) _VOkCaseValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("VOkCaseValue") case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._VOkCaseValue_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._VOkCaseValue_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/followschema/validtypes.generated.go b/codegen/testserver/followschema/validtypes.generated.go index 1b7c9d9445..c575470086 100644 --- a/codegen/testserver/followschema/validtypes.generated.go +++ b/codegen/testserver/followschema/validtypes.generated.go @@ -812,11 +812,8 @@ func (ec *executionContext) _Content_Post(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("Content_Post") case "foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Content_Post_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Content_Post_foo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -840,11 +837,8 @@ func (ec *executionContext) _Content_User(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("Content_User") case "foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Content_User_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Content_User_foo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -868,41 +862,29 @@ func (ec *executionContext) _ValidType(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("ValidType") case "differentCase": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_differentCase(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_differentCase(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "different_case": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_different_case(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_different_case(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "validInputKeywords": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_validInputKeywords(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_validInputKeywords(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "validArgs": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_validArgs(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_validArgs(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/weird_type_cases.generated.go b/codegen/testserver/followschema/weird_type_cases.generated.go index 1b8ee2b3f7..f4c5ef9a6d 100644 --- a/codegen/testserver/followschema/weird_type_cases.generated.go +++ b/codegen/testserver/followschema/weird_type_cases.generated.go @@ -294,11 +294,8 @@ func (ec *executionContext) _AIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("AIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._AIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._AIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -325,11 +322,8 @@ func (ec *executionContext) _AbIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("AbIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._AbIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._AbIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -356,11 +350,8 @@ func (ec *executionContext) _XXIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("XXIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._XXIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._XXIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -387,11 +378,8 @@ func (ec *executionContext) _XxIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("XxIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._XxIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._XxIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -418,11 +406,8 @@ func (ec *executionContext) _asdfIt(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("asdfIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._asdfIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._asdfIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -449,11 +434,8 @@ func (ec *executionContext) _iIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("iIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._iIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._iIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/codegen/testserver/followschema/wrapped_type.generated.go b/codegen/testserver/followschema/wrapped_type.generated.go index 29d9c8b3b3..cb2458f067 100644 --- a/codegen/testserver/followschema/wrapped_type.generated.go +++ b/codegen/testserver/followschema/wrapped_type.generated.go @@ -352,21 +352,15 @@ func (ec *executionContext) _WrappedStruct(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("WrappedStruct") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WrappedStruct_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WrappedStruct_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "desc": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WrappedStruct_desc(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WrappedStruct_desc(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/codegen/testserver/singlefile/generated.go b/codegen/testserver/singlefile/generated.go index a28e8ca377..c8d5310778 100644 --- a/codegen/testserver/singlefile/generated.go +++ b/codegen/testserver/singlefile/generated.go @@ -15164,11 +15164,8 @@ func (ec *executionContext) _A(ctx context.Context, sel ast.SelectionSet, obj *A case "__typename": out.Values[i] = graphql.MarshalString("A") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._A_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._A_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15195,11 +15192,8 @@ func (ec *executionContext) _AIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("AIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._AIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._AIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15226,11 +15220,8 @@ func (ec *executionContext) _AbIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("AbIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._AbIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._AbIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15257,51 +15248,36 @@ func (ec *executionContext) _Autobind(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Autobind") case "int": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_int(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_int(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "int32": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_int32(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_int32(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "int64": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_int64(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_int64(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "idStr": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_idStr(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_idStr(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "idInt": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Autobind_idInt(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Autobind_idInt(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15328,11 +15304,8 @@ func (ec *executionContext) _B(ctx context.Context, sel ast.SelectionSet, obj *B case "__typename": out.Values[i] = graphql.MarshalString("B") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._B_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._B_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15379,21 +15352,15 @@ func (ec *executionContext) _BackedByInterface(ctx context.Context, sel ast.Sele }) case "thisShouldBind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._BackedByInterface_thisShouldBind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._BackedByInterface_thisShouldBind(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "thisShouldBindWithError": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._BackedByInterface_thisShouldBindWithError(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._BackedByInterface_thisShouldBindWithError(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -15420,21 +15387,15 @@ func (ec *executionContext) _Cat(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Cat") case "species": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Cat_species(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Cat_species(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "catBreed": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Cat_catBreed(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Cat_catBreed(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15461,11 +15422,8 @@ func (ec *executionContext) _CheckIssue896(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("CheckIssue896") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._CheckIssue896_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._CheckIssue896_id(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15489,25 +15447,16 @@ func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Circle") case "radius": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Circle_radius(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Circle_radius(ctx, field, obj) case "area": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Circle_area(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Circle_area(ctx, field, obj) case "coordinates": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Circle_coordinates(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Circle_coordinates(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15531,31 +15480,22 @@ func (ec *executionContext) _ConcreteNodeA(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("ConcreteNodeA") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeA_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeA_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "child": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeA_child(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeA_child(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeA_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeA_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15582,21 +15522,15 @@ func (ec *executionContext) _ConcreteNodeInterface(ctx context.Context, sel ast. case "__typename": out.Values[i] = graphql.MarshalString("ConcreteNodeInterface") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeInterface_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeInterface_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "child": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ConcreteNodeInterface_child(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ConcreteNodeInterface_child(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15623,11 +15557,8 @@ func (ec *executionContext) _Content_Post(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("Content_Post") case "foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Content_Post_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Content_Post_foo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15651,11 +15582,8 @@ func (ec *executionContext) _Content_User(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("Content_User") case "foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Content_User_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Content_User_foo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15679,21 +15607,15 @@ func (ec *executionContext) _Coordinates(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("Coordinates") case "x": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Coordinates_x(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Coordinates_x(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "y": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Coordinates_y(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Coordinates_y(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15720,18 +15642,12 @@ func (ec *executionContext) _DefaultParametersMirror(ctx context.Context, sel as case "__typename": out.Values[i] = graphql.MarshalString("DefaultParametersMirror") case "falsyBoolean": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._DefaultParametersMirror_falsyBoolean(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._DefaultParametersMirror_falsyBoolean(ctx, field, obj) case "truthyBoolean": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._DefaultParametersMirror_truthyBoolean(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._DefaultParametersMirror_truthyBoolean(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15755,21 +15671,15 @@ func (ec *executionContext) _Dog(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Dog") case "species": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Dog_species(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Dog_species(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "dogBreed": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Dog_dogBreed(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Dog_dogBreed(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15796,11 +15706,8 @@ func (ec *executionContext) _EmbeddedCase1(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedCase1") case "exportedEmbeddedPointerExportedMethod": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedCase1_exportedEmbeddedPointerExportedMethod(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedCase1_exportedEmbeddedPointerExportedMethod(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15827,11 +15734,8 @@ func (ec *executionContext) _EmbeddedCase2(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedCase2") case "unexportedEmbeddedPointerExportedMethod": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedCase2_unexportedEmbeddedPointerExportedMethod(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedCase2_unexportedEmbeddedPointerExportedMethod(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15858,11 +15762,8 @@ func (ec *executionContext) _EmbeddedCase3(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedCase3") case "unexportedEmbeddedInterfaceExportedMethod": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedCase3_unexportedEmbeddedInterfaceExportedMethod(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedCase3_unexportedEmbeddedInterfaceExportedMethod(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -15889,11 +15790,8 @@ func (ec *executionContext) _EmbeddedDefaultScalar(ctx context.Context, sel ast. case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedDefaultScalar") case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedDefaultScalar_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedDefaultScalar_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15917,18 +15815,12 @@ func (ec *executionContext) _EmbeddedPointer(ctx context.Context, sel ast.Select case "__typename": out.Values[i] = graphql.MarshalString("EmbeddedPointer") case "ID": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedPointer_ID(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedPointer_ID(ctx, field, obj) case "Title": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._EmbeddedPointer_Title(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._EmbeddedPointer_Title(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -15952,38 +15844,26 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Error") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "errorOnNonRequiredField": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_errorOnNonRequiredField(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_errorOnNonRequiredField(ctx, field, obj) case "errorOnRequiredField": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_errorOnRequiredField(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_errorOnRequiredField(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "nilOnRequiredField": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Error_nilOnRequiredField(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Error_nilOnRequiredField(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16169,11 +16049,8 @@ func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("InnerObject") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._InnerObject_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._InnerObject_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16200,11 +16077,8 @@ func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("InvalidIdentifier") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._InvalidIdentifier_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._InvalidIdentifier_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16231,11 +16105,8 @@ func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj * case "__typename": out.Values[i] = graphql.MarshalString("It") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._It_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._It_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16262,11 +16133,8 @@ func (ec *executionContext) _LoopA(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("LoopA") case "b": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._LoopA_b(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._LoopA_b(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16293,11 +16161,8 @@ func (ec *executionContext) _LoopB(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("LoopB") case "a": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._LoopB_a(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._LoopB_a(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16324,11 +16189,8 @@ func (ec *executionContext) _Map(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Map") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Map_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Map_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16355,18 +16217,12 @@ func (ec *executionContext) _MapStringInterfaceType(ctx context.Context, sel ast case "__typename": out.Values[i] = graphql.MarshalString("MapStringInterfaceType") case "a": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MapStringInterfaceType_a(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MapStringInterfaceType_a(ctx, field, obj) case "b": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MapStringInterfaceType_b(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MapStringInterfaceType_b(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -16410,11 +16266,8 @@ func (ec *executionContext) _ModelMethods(ctx context.Context, sel ast.Selection }) case "noContext": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ModelMethods_noContext(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ModelMethods_noContext(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -16470,31 +16323,28 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "defaultInput": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_defaultInput(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_defaultInput(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "updateSomething": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_updateSomething(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateSomething(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ } case "updatePtrToPtr": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_updatePtrToPtr(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updatePtrToPtr(ctx, field) + }) if out.Values[i] == graphql.Null { invalids++ @@ -16521,28 +16371,19 @@ func (ec *executionContext) _ObjectDirectives(ctx context.Context, sel ast.Selec case "__typename": out.Values[i] = graphql.MarshalString("ObjectDirectives") case "text": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectives_text(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectives_text(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "nullableText": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectives_nullableText(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectives_nullableText(ctx, field, obj) case "order": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectives_order(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectives_order(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16569,11 +16410,8 @@ func (ec *executionContext) _ObjectDirectivesWithCustomGoModel(ctx context.Conte case "__typename": out.Values[i] = graphql.MarshalString("ObjectDirectivesWithCustomGoModel") case "nullableText": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ObjectDirectivesWithCustomGoModel_nullableText(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ObjectDirectivesWithCustomGoModel_nullableText(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -16597,11 +16435,8 @@ func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("OuterObject") case "inner": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OuterObject_inner(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OuterObject_inner(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -16628,21 +16463,15 @@ func (ec *executionContext) _OverlappingFields(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("OverlappingFields") case "oneFoo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_oneFoo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_oneFoo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "twoFoo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_twoFoo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_twoFoo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -16668,21 +16497,15 @@ func (ec *executionContext) _OverlappingFields(ctx context.Context, sel ast.Sele }) case "newFoo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_newFoo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_newFoo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "new_foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._OverlappingFields_new_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._OverlappingFields_new_foo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -16790,11 +16613,8 @@ func (ec *executionContext) _Pet(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Pet") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Pet_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Pet_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -16858,11 +16678,8 @@ func (ec *executionContext) _Primitive(ctx context.Context, sel ast.SelectionSet }) case "squared": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Primitive_squared(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Primitive_squared(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -16909,11 +16726,8 @@ func (ec *executionContext) _PrimitiveString(ctx context.Context, sel ast.Select }) case "doubled": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PrimitiveString_doubled(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PrimitiveString_doubled(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -16960,21 +16774,15 @@ func (ec *executionContext) _PtrToPtrInner(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("PtrToPtrInner") case "key": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrInner_key(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrInner_key(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrInner_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrInner_value(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -17001,28 +16809,19 @@ func (ec *executionContext) _PtrToPtrOuter(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("PtrToPtrOuter") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrOuter_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrOuter_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "inner": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrOuter_inner(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrOuter_inner(ctx, field, obj) case "stupidInner": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToPtrOuter_stupidInner(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToPtrOuter_stupidInner(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -17046,11 +16845,8 @@ func (ec *executionContext) _PtrToSliceContainer(ctx context.Context, sel ast.Se case "__typename": out.Values[i] = graphql.MarshalString("PtrToSliceContainer") case "ptrToSlice": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PtrToSliceContainer_ptrToSlice(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PtrToSliceContainer_ptrToSlice(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -18452,18 +18248,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -18487,32 +18281,20 @@ func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("Rectangle") case "length": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_length(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_length(ctx, field, obj) case "width": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_width(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_width(ctx, field, obj) case "area": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_area(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_area(ctx, field, obj) case "coordinates": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Rectangle_coordinates(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Rectangle_coordinates(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -18536,35 +18318,23 @@ func (ec *executionContext) _Slices(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Slices") case "test1": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test1(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test1(ctx, field, obj) case "test2": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test2(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test2(ctx, field, obj) case "test3": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test3(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test3(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "test4": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Slices_test4(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Slices_test4(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -18625,11 +18395,8 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -18655,21 +18422,15 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj }) case "created": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_created(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_created(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "updated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_updated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_updated(ctx, field, obj) case "pets": field := field @@ -18710,11 +18471,8 @@ func (ec *executionContext) _VOkCaseNil(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("VOkCaseNil") case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._VOkCaseNil_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._VOkCaseNil_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -18738,11 +18496,8 @@ func (ec *executionContext) _VOkCaseValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("VOkCaseValue") case "value": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._VOkCaseValue_value(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._VOkCaseValue_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -18766,41 +18521,29 @@ func (ec *executionContext) _ValidType(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("ValidType") case "differentCase": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_differentCase(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_differentCase(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "different_case": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_different_case(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_different_case(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "validInputKeywords": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_validInputKeywords(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_validInputKeywords(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "validArgs": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._ValidType_validArgs(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._ValidType_validArgs(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -18947,21 +18690,15 @@ func (ec *executionContext) _WrappedStruct(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("WrappedStruct") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WrappedStruct_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WrappedStruct_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "desc": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WrappedStruct_desc(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WrappedStruct_desc(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -18985,11 +18722,8 @@ func (ec *executionContext) _XXIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("XXIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._XXIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._XXIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -19016,11 +18750,8 @@ func (ec *executionContext) _XxIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("XxIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._XxIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._XxIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -19047,48 +18778,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -19115,38 +18831,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -19170,58 +18874,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -19245,38 +18931,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -19300,52 +18974,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -19372,77 +19028,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -19466,11 +19092,8 @@ func (ec *executionContext) _asdfIt(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("asdfIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._asdfIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._asdfIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -19497,11 +19120,8 @@ func (ec *executionContext) _iIt(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("iIt") case "id": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._iIt_id(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._iIt_id(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ diff --git a/integration/generated.go b/integration/generated.go index 2cc67f7379..da6062004a 100644 --- a/integration/generated.go +++ b/integration/generated.go @@ -3350,18 +3350,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3385,11 +3383,8 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._User_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._User_name(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) @@ -3436,11 +3431,8 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Viewer") case "user": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Viewer_user(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Viewer_user(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3464,48 +3456,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3532,38 +3509,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3587,58 +3552,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3662,38 +3609,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3717,52 +3652,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -3789,77 +3706,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) diff --git a/plugin/federation/testdata/entityresolver/generated/exec.go b/plugin/federation/testdata/entityresolver/generated/exec.go index 27f6692dba..8c5278850d 100644 --- a/plugin/federation/testdata/entityresolver/generated/exec.go +++ b/plugin/federation/testdata/entityresolver/generated/exec.go @@ -6357,21 +6357,15 @@ func (ec *executionContext) _Hello(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Hello") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Hello_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Hello_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "secondary": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Hello_secondary(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._Hello_secondary(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6398,21 +6392,15 @@ func (ec *executionContext) _HelloMultiSingleKeys(ctx context.Context, sel ast.S case "__typename": out.Values[i] = graphql.MarshalString("HelloMultiSingleKeys") case "key1": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HelloMultiSingleKeys_key1(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._HelloMultiSingleKeys_key1(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "key2": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HelloMultiSingleKeys_key2(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._HelloMultiSingleKeys_key2(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6439,11 +6427,8 @@ func (ec *executionContext) _HelloWithErrors(ctx context.Context, sel ast.Select case "__typename": out.Values[i] = graphql.MarshalString("HelloWithErrors") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._HelloWithErrors_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._HelloWithErrors_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6470,11 +6455,8 @@ func (ec *executionContext) _MultiHello(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("MultiHello") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHello_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHello_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6501,41 +6483,29 @@ func (ec *executionContext) _MultiHelloMultipleRequires(ctx context.Context, sel case "__typename": out.Values[i] = graphql.MarshalString("MultiHelloMultipleRequires") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloMultipleRequires_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloMultipleRequires_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "key1": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloMultipleRequires_key1(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloMultipleRequires_key1(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "key2": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloMultipleRequires_key2(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloMultipleRequires_key2(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "key3": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloMultipleRequires_key3(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloMultipleRequires_key3(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6562,31 +6532,22 @@ func (ec *executionContext) _MultiHelloRequires(ctx context.Context, sel ast.Sel case "__typename": out.Values[i] = graphql.MarshalString("MultiHelloRequires") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloRequires_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloRequires_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "key1": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloRequires_key1(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloRequires_key1(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "key2": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloRequires_key2(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloRequires_key2(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6613,11 +6574,8 @@ func (ec *executionContext) _MultiHelloWithError(ctx context.Context, sel ast.Se case "__typename": out.Values[i] = graphql.MarshalString("MultiHelloWithError") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiHelloWithError_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiHelloWithError_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6644,31 +6602,22 @@ func (ec *executionContext) _MultiPlanetRequiresNested(ctx context.Context, sel case "__typename": out.Values[i] = graphql.MarshalString("MultiPlanetRequiresNested") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiPlanetRequiresNested_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiPlanetRequiresNested_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "world": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiPlanetRequiresNested_world(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiPlanetRequiresNested_world(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "size": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._MultiPlanetRequiresNested_size(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._MultiPlanetRequiresNested_size(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6695,41 +6644,29 @@ func (ec *executionContext) _PlanetMultipleRequires(ctx context.Context, sel ast case "__typename": out.Values[i] = graphql.MarshalString("PlanetMultipleRequires") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetMultipleRequires_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetMultipleRequires_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "diameter": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetMultipleRequires_diameter(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetMultipleRequires_diameter(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "density": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetMultipleRequires_density(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetMultipleRequires_density(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "weight": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetMultipleRequires_weight(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetMultipleRequires_weight(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6756,31 +6693,22 @@ func (ec *executionContext) _PlanetRequires(ctx context.Context, sel ast.Selecti case "__typename": out.Values[i] = graphql.MarshalString("PlanetRequires") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetRequires_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetRequires_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "size": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetRequires_size(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetRequires_size(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "diameter": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetRequires_diameter(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetRequires_diameter(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6807,31 +6735,22 @@ func (ec *executionContext) _PlanetRequiresNested(ctx context.Context, sel ast.S case "__typename": out.Values[i] = graphql.MarshalString("PlanetRequiresNested") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetRequiresNested_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetRequiresNested_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "world": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetRequiresNested_world(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetRequiresNested_world(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "size": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._PlanetRequiresNested_size(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._PlanetRequiresNested_size(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -6913,18 +6832,16 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return rrm(innerCtx) }) case "__type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) case "__schema": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - } - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -6948,31 +6865,22 @@ func (ec *executionContext) _World(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("World") case "foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._World_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._World_foo(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "bar": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._World_bar(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._World_bar(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "hello": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._World_hello(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._World_hello(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -6996,11 +6904,8 @@ func (ec *executionContext) _WorldName(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("WorldName") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WorldName_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WorldName_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -7027,31 +6932,22 @@ func (ec *executionContext) _WorldWithMultipleKeys(ctx context.Context, sel ast. case "__typename": out.Values[i] = graphql.MarshalString("WorldWithMultipleKeys") case "foo": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WorldWithMultipleKeys_foo(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WorldWithMultipleKeys_foo(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "bar": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WorldWithMultipleKeys_bar(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WorldWithMultipleKeys_bar(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "hello": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec._WorldWithMultipleKeys_hello(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec._WorldWithMultipleKeys_hello(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -7075,11 +6971,8 @@ func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("_Service") case "sdl": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.__Service_sdl(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.__Service_sdl(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -7103,48 +6996,33 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_locations(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Directive_isRepeatable(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -7171,38 +7049,26 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___EnumValue_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -7226,58 +7092,40 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_args(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_isDeprecated(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Field_deprecationReason(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -7301,38 +7149,26 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_type(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___InputValue_defaultValue(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -7356,52 +7192,34 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_types(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "queryType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_queryType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_mutationType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_subscriptionType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Schema_directives(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -7428,77 +7246,47 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_kind(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } case "name": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_name(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_description(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_fields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_interfaces(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_possibleTypes(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_enumValues(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_inputFields(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_ofType(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - return ec.___Type_specifiedByURL(ctx, field, obj) - } - out.Values[i] = innerFunc(ctx) + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name))