git.sr.ht/~sircmpwn/gqlgen@v0.0.0-20200522192042-c84d29a1c940/example/federation/products/graph/generated/generated.go (about)

     1  // Code generated by git.sr.ht/~sircmpwn/gqlgen, DO NOT EDIT.
     2  
     3  package generated
     4  
     5  import (
     6  	"bytes"
     7  	"context"
     8  	"errors"
     9  	"fmt"
    10  	"strconv"
    11  	"sync"
    12  	"sync/atomic"
    13  
    14  	"git.sr.ht/~sircmpwn/gqlgen/example/federation/products/graph/model"
    15  	"git.sr.ht/~sircmpwn/gqlgen/graphql"
    16  	"git.sr.ht/~sircmpwn/gqlgen/graphql/introspection"
    17  	"git.sr.ht/~sircmpwn/gqlgen/plugin/federation/fedruntime"
    18  	gqlparser "github.com/vektah/gqlparser/v2"
    19  	"github.com/vektah/gqlparser/v2/ast"
    20  )
    21  
    22  // region    ************************** generated!.gotpl **************************
    23  
    24  // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
    25  func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
    26  	return &executableSchema{
    27  		resolvers:  cfg.Resolvers,
    28  		directives: cfg.Directives,
    29  		complexity: cfg.Complexity,
    30  	}
    31  }
    32  
    33  type Config struct {
    34  	Resolvers  ResolverRoot
    35  	Directives DirectiveRoot
    36  	Complexity ComplexityRoot
    37  }
    38  
    39  type ResolverRoot interface {
    40  	Entity() EntityResolver
    41  	Query() QueryResolver
    42  }
    43  
    44  type DirectiveRoot struct {
    45  }
    46  
    47  type ComplexityRoot struct {
    48  	Entity struct {
    49  		FindProductByUpc func(childComplexity int, upc string) int
    50  	}
    51  
    52  	Product struct {
    53  		Name  func(childComplexity int) int
    54  		Price func(childComplexity int) int
    55  		Upc   func(childComplexity int) int
    56  	}
    57  
    58  	Query struct {
    59  		TopProducts        func(childComplexity int, first *int) int
    60  		__resolve__service func(childComplexity int) int
    61  		__resolve_entities func(childComplexity int, representations []map[string]interface{}) int
    62  	}
    63  
    64  	Service struct {
    65  		SDL func(childComplexity int) int
    66  	}
    67  }
    68  
    69  type EntityResolver interface {
    70  	FindProductByUpc(ctx context.Context, upc string) (*model.Product, error)
    71  }
    72  type QueryResolver interface {
    73  	TopProducts(ctx context.Context, first *int) ([]*model.Product, error)
    74  }
    75  
    76  type executableSchema struct {
    77  	resolvers  ResolverRoot
    78  	directives DirectiveRoot
    79  	complexity ComplexityRoot
    80  }
    81  
    82  func (e *executableSchema) Schema() *ast.Schema {
    83  	return parsedSchema
    84  }
    85  
    86  func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
    87  	ec := executionContext{nil, e}
    88  	_ = ec
    89  	switch typeName + "." + field {
    90  
    91  	case "Entity.findProductByUpc":
    92  		if e.complexity.Entity.FindProductByUpc == nil {
    93  			break
    94  		}
    95  
    96  		args, err := ec.field_Entity_findProductByUpc_args(context.TODO(), rawArgs)
    97  		if err != nil {
    98  			return 0, false
    99  		}
   100  
   101  		return e.complexity.Entity.FindProductByUpc(childComplexity, args["upc"].(string)), true
   102  
   103  	case "Product.name":
   104  		if e.complexity.Product.Name == nil {
   105  			break
   106  		}
   107  
   108  		return e.complexity.Product.Name(childComplexity), true
   109  
   110  	case "Product.price":
   111  		if e.complexity.Product.Price == nil {
   112  			break
   113  		}
   114  
   115  		return e.complexity.Product.Price(childComplexity), true
   116  
   117  	case "Product.upc":
   118  		if e.complexity.Product.Upc == nil {
   119  			break
   120  		}
   121  
   122  		return e.complexity.Product.Upc(childComplexity), true
   123  
   124  	case "Query.topProducts":
   125  		if e.complexity.Query.TopProducts == nil {
   126  			break
   127  		}
   128  
   129  		args, err := ec.field_Query_topProducts_args(context.TODO(), rawArgs)
   130  		if err != nil {
   131  			return 0, false
   132  		}
   133  
   134  		return e.complexity.Query.TopProducts(childComplexity, args["first"].(*int)), true
   135  
   136  	case "Query._service":
   137  		if e.complexity.Query.__resolve__service == nil {
   138  			break
   139  		}
   140  
   141  		return e.complexity.Query.__resolve__service(childComplexity), true
   142  
   143  	case "Query._entities":
   144  		if e.complexity.Query.__resolve_entities == nil {
   145  			break
   146  		}
   147  
   148  		args, err := ec.field_Query__entities_args(context.TODO(), rawArgs)
   149  		if err != nil {
   150  			return 0, false
   151  		}
   152  
   153  		return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]interface{})), true
   154  
   155  	case "_Service.sdl":
   156  		if e.complexity.Service.SDL == nil {
   157  			break
   158  		}
   159  
   160  		return e.complexity.Service.SDL(childComplexity), true
   161  
   162  	}
   163  	return 0, false
   164  }
   165  
   166  func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
   167  	rc := graphql.GetOperationContext(ctx)
   168  	ec := executionContext{rc, e}
   169  	first := true
   170  
   171  	switch rc.Operation.Operation {
   172  	case ast.Query:
   173  		return func(ctx context.Context) *graphql.Response {
   174  			if !first {
   175  				return nil
   176  			}
   177  			first = false
   178  			data := ec._Query(ctx, rc.Operation.SelectionSet)
   179  			var buf bytes.Buffer
   180  			data.MarshalGQL(&buf)
   181  
   182  			return &graphql.Response{
   183  				Data: buf.Bytes(),
   184  			}
   185  		}
   186  
   187  	default:
   188  		return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
   189  	}
   190  }
   191  
   192  type executionContext struct {
   193  	*graphql.OperationContext
   194  	*executableSchema
   195  }
   196  
   197  func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
   198  	if ec.DisableIntrospection {
   199  		return nil, errors.New("introspection disabled")
   200  	}
   201  	return introspection.WrapSchema(parsedSchema), nil
   202  }
   203  
   204  func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
   205  	if ec.DisableIntrospection {
   206  		return nil, errors.New("introspection disabled")
   207  	}
   208  	return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil
   209  }
   210  
   211  var sources = []*ast.Source{
   212  	&ast.Source{Name: "graph/schema.graphqls", Input: `extend type Query {
   213      topProducts(first: Int = 5): [Product]
   214  }
   215  
   216  type Product @key(fields: "upc") {
   217      upc: String!
   218      name: String!
   219      price: Int!
   220  }
   221  `, BuiltIn: false},
   222  	&ast.Source{Name: "federation/directives.graphql", Input: `
   223  scalar _Any
   224  scalar _FieldSet
   225  
   226  directive @external on FIELD_DEFINITION
   227  directive @requires(fields: _FieldSet!) on FIELD_DEFINITION
   228  directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
   229  directive @key(fields: _FieldSet!) on OBJECT | INTERFACE
   230  directive @extends on OBJECT
   231  `, BuiltIn: true},
   232  	&ast.Source{Name: "federation/entity.graphql", Input: `
   233  # a union of all types that use the @key directive
   234  union _Entity = Product
   235  
   236  # fake type to build resolver interfaces for users to implement
   237  type Entity {
   238  		findProductByUpc(upc: String!,): Product!
   239  
   240  }
   241  
   242  type _Service {
   243    sdl: String
   244  }
   245  
   246  extend type Query {
   247    _entities(representations: [_Any!]!): [_Entity]!
   248    _service: _Service!
   249  }
   250  `, BuiltIn: true},
   251  }
   252  var parsedSchema = gqlparser.MustLoadSchema(sources...)
   253  
   254  // endregion ************************** generated!.gotpl **************************
   255  
   256  // region    ***************************** args.gotpl *****************************
   257  
   258  func (ec *executionContext) field_Entity_findProductByUpc_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   259  	var err error
   260  	args := map[string]interface{}{}
   261  	var arg0 string
   262  	if tmp, ok := rawArgs["upc"]; ok {
   263  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
   264  		if err != nil {
   265  			return nil, err
   266  		}
   267  	}
   268  	args["upc"] = arg0
   269  	return args, nil
   270  }
   271  
   272  func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   273  	var err error
   274  	args := map[string]interface{}{}
   275  	var arg0 string
   276  	if tmp, ok := rawArgs["name"]; ok {
   277  		arg0, err = ec.unmarshalNString2string(ctx, tmp)
   278  		if err != nil {
   279  			return nil, err
   280  		}
   281  	}
   282  	args["name"] = arg0
   283  	return args, nil
   284  }
   285  
   286  func (ec *executionContext) field_Query__entities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   287  	var err error
   288  	args := map[string]interface{}{}
   289  	var arg0 []map[string]interface{}
   290  	if tmp, ok := rawArgs["representations"]; ok {
   291  		arg0, err = ec.unmarshalN_Any2ᚕmapᚄ(ctx, tmp)
   292  		if err != nil {
   293  			return nil, err
   294  		}
   295  	}
   296  	args["representations"] = arg0
   297  	return args, nil
   298  }
   299  
   300  func (ec *executionContext) field_Query_topProducts_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   301  	var err error
   302  	args := map[string]interface{}{}
   303  	var arg0 *int
   304  	if tmp, ok := rawArgs["first"]; ok {
   305  		arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp)
   306  		if err != nil {
   307  			return nil, err
   308  		}
   309  	}
   310  	args["first"] = arg0
   311  	return args, nil
   312  }
   313  
   314  func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   315  	var err error
   316  	args := map[string]interface{}{}
   317  	var arg0 bool
   318  	if tmp, ok := rawArgs["includeDeprecated"]; ok {
   319  		arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
   320  		if err != nil {
   321  			return nil, err
   322  		}
   323  	}
   324  	args["includeDeprecated"] = arg0
   325  	return args, nil
   326  }
   327  
   328  func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
   329  	var err error
   330  	args := map[string]interface{}{}
   331  	var arg0 bool
   332  	if tmp, ok := rawArgs["includeDeprecated"]; ok {
   333  		arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp)
   334  		if err != nil {
   335  			return nil, err
   336  		}
   337  	}
   338  	args["includeDeprecated"] = arg0
   339  	return args, nil
   340  }
   341  
   342  // endregion ***************************** args.gotpl *****************************
   343  
   344  // region    ************************** directives.gotpl **************************
   345  
   346  // endregion ************************** directives.gotpl **************************
   347  
   348  // region    **************************** field.gotpl *****************************
   349  
   350  func (ec *executionContext) _Entity_findProductByUpc(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   351  	defer func() {
   352  		if r := recover(); r != nil {
   353  			ec.Error(ctx, ec.Recover(ctx, r))
   354  			ret = graphql.Null
   355  		}
   356  	}()
   357  	fc := &graphql.FieldContext{
   358  		Object:   "Entity",
   359  		Field:    field,
   360  		Args:     nil,
   361  		IsMethod: true,
   362  	}
   363  
   364  	ctx = graphql.WithFieldContext(ctx, fc)
   365  	rawArgs := field.ArgumentMap(ec.Variables)
   366  	args, err := ec.field_Entity_findProductByUpc_args(ctx, rawArgs)
   367  	if err != nil {
   368  		ec.Error(ctx, err)
   369  		return graphql.Null
   370  	}
   371  	fc.Args = args
   372  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   373  		ctx = rctx // use context from middleware stack in children
   374  		return ec.resolvers.Entity().FindProductByUpc(rctx, args["upc"].(string))
   375  	})
   376  	if err != nil {
   377  		ec.Error(ctx, err)
   378  		return graphql.Null
   379  	}
   380  	if resTmp == nil {
   381  		if !graphql.HasFieldError(ctx, fc) {
   382  			ec.Errorf(ctx, "must not be null")
   383  		}
   384  		return graphql.Null
   385  	}
   386  	res := resTmp.(*model.Product)
   387  	fc.Result = res
   388  	return ec.marshalNProduct2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx, field.Selections, res)
   389  }
   390  
   391  func (ec *executionContext) _Product_upc(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) {
   392  	defer func() {
   393  		if r := recover(); r != nil {
   394  			ec.Error(ctx, ec.Recover(ctx, r))
   395  			ret = graphql.Null
   396  		}
   397  	}()
   398  	fc := &graphql.FieldContext{
   399  		Object:   "Product",
   400  		Field:    field,
   401  		Args:     nil,
   402  		IsMethod: false,
   403  	}
   404  
   405  	ctx = graphql.WithFieldContext(ctx, fc)
   406  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   407  		ctx = rctx // use context from middleware stack in children
   408  		return obj.Upc, nil
   409  	})
   410  	if err != nil {
   411  		ec.Error(ctx, err)
   412  		return graphql.Null
   413  	}
   414  	if resTmp == nil {
   415  		if !graphql.HasFieldError(ctx, fc) {
   416  			ec.Errorf(ctx, "must not be null")
   417  		}
   418  		return graphql.Null
   419  	}
   420  	res := resTmp.(string)
   421  	fc.Result = res
   422  	return ec.marshalNString2string(ctx, field.Selections, res)
   423  }
   424  
   425  func (ec *executionContext) _Product_name(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) {
   426  	defer func() {
   427  		if r := recover(); r != nil {
   428  			ec.Error(ctx, ec.Recover(ctx, r))
   429  			ret = graphql.Null
   430  		}
   431  	}()
   432  	fc := &graphql.FieldContext{
   433  		Object:   "Product",
   434  		Field:    field,
   435  		Args:     nil,
   436  		IsMethod: false,
   437  	}
   438  
   439  	ctx = graphql.WithFieldContext(ctx, fc)
   440  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   441  		ctx = rctx // use context from middleware stack in children
   442  		return obj.Name, nil
   443  	})
   444  	if err != nil {
   445  		ec.Error(ctx, err)
   446  		return graphql.Null
   447  	}
   448  	if resTmp == nil {
   449  		if !graphql.HasFieldError(ctx, fc) {
   450  			ec.Errorf(ctx, "must not be null")
   451  		}
   452  		return graphql.Null
   453  	}
   454  	res := resTmp.(string)
   455  	fc.Result = res
   456  	return ec.marshalNString2string(ctx, field.Selections, res)
   457  }
   458  
   459  func (ec *executionContext) _Product_price(ctx context.Context, field graphql.CollectedField, obj *model.Product) (ret graphql.Marshaler) {
   460  	defer func() {
   461  		if r := recover(); r != nil {
   462  			ec.Error(ctx, ec.Recover(ctx, r))
   463  			ret = graphql.Null
   464  		}
   465  	}()
   466  	fc := &graphql.FieldContext{
   467  		Object:   "Product",
   468  		Field:    field,
   469  		Args:     nil,
   470  		IsMethod: false,
   471  	}
   472  
   473  	ctx = graphql.WithFieldContext(ctx, fc)
   474  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   475  		ctx = rctx // use context from middleware stack in children
   476  		return obj.Price, nil
   477  	})
   478  	if err != nil {
   479  		ec.Error(ctx, err)
   480  		return graphql.Null
   481  	}
   482  	if resTmp == nil {
   483  		if !graphql.HasFieldError(ctx, fc) {
   484  			ec.Errorf(ctx, "must not be null")
   485  		}
   486  		return graphql.Null
   487  	}
   488  	res := resTmp.(int)
   489  	fc.Result = res
   490  	return ec.marshalNInt2int(ctx, field.Selections, res)
   491  }
   492  
   493  func (ec *executionContext) _Query_topProducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   494  	defer func() {
   495  		if r := recover(); r != nil {
   496  			ec.Error(ctx, ec.Recover(ctx, r))
   497  			ret = graphql.Null
   498  		}
   499  	}()
   500  	fc := &graphql.FieldContext{
   501  		Object:   "Query",
   502  		Field:    field,
   503  		Args:     nil,
   504  		IsMethod: true,
   505  	}
   506  
   507  	ctx = graphql.WithFieldContext(ctx, fc)
   508  	rawArgs := field.ArgumentMap(ec.Variables)
   509  	args, err := ec.field_Query_topProducts_args(ctx, rawArgs)
   510  	if err != nil {
   511  		ec.Error(ctx, err)
   512  		return graphql.Null
   513  	}
   514  	fc.Args = args
   515  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   516  		ctx = rctx // use context from middleware stack in children
   517  		return ec.resolvers.Query().TopProducts(rctx, args["first"].(*int))
   518  	})
   519  	if err != nil {
   520  		ec.Error(ctx, err)
   521  		return graphql.Null
   522  	}
   523  	if resTmp == nil {
   524  		return graphql.Null
   525  	}
   526  	res := resTmp.([]*model.Product)
   527  	fc.Result = res
   528  	return ec.marshalOProduct2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx, field.Selections, res)
   529  }
   530  
   531  func (ec *executionContext) _Query__entities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   532  	defer func() {
   533  		if r := recover(); r != nil {
   534  			ec.Error(ctx, ec.Recover(ctx, r))
   535  			ret = graphql.Null
   536  		}
   537  	}()
   538  	fc := &graphql.FieldContext{
   539  		Object:   "Query",
   540  		Field:    field,
   541  		Args:     nil,
   542  		IsMethod: true,
   543  	}
   544  
   545  	ctx = graphql.WithFieldContext(ctx, fc)
   546  	rawArgs := field.ArgumentMap(ec.Variables)
   547  	args, err := ec.field_Query__entities_args(ctx, rawArgs)
   548  	if err != nil {
   549  		ec.Error(ctx, err)
   550  		return graphql.Null
   551  	}
   552  	fc.Args = args
   553  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   554  		ctx = rctx // use context from middleware stack in children
   555  		return ec.__resolve_entities(ctx, args["representations"].([]map[string]interface{}))
   556  	})
   557  	if err != nil {
   558  		ec.Error(ctx, err)
   559  		return graphql.Null
   560  	}
   561  	if resTmp == nil {
   562  		if !graphql.HasFieldError(ctx, fc) {
   563  			ec.Errorf(ctx, "must not be null")
   564  		}
   565  		return graphql.Null
   566  	}
   567  	res := resTmp.([]fedruntime.Entity)
   568  	fc.Result = res
   569  	return ec.marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, field.Selections, res)
   570  }
   571  
   572  func (ec *executionContext) _Query__service(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   573  	defer func() {
   574  		if r := recover(); r != nil {
   575  			ec.Error(ctx, ec.Recover(ctx, r))
   576  			ret = graphql.Null
   577  		}
   578  	}()
   579  	fc := &graphql.FieldContext{
   580  		Object:   "Query",
   581  		Field:    field,
   582  		Args:     nil,
   583  		IsMethod: true,
   584  	}
   585  
   586  	ctx = graphql.WithFieldContext(ctx, fc)
   587  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   588  		ctx = rctx // use context from middleware stack in children
   589  		return ec.__resolve__service(ctx)
   590  	})
   591  	if err != nil {
   592  		ec.Error(ctx, err)
   593  		return graphql.Null
   594  	}
   595  	if resTmp == nil {
   596  		if !graphql.HasFieldError(ctx, fc) {
   597  			ec.Errorf(ctx, "must not be null")
   598  		}
   599  		return graphql.Null
   600  	}
   601  	res := resTmp.(fedruntime.Service)
   602  	fc.Result = res
   603  	return ec.marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx, field.Selections, res)
   604  }
   605  
   606  func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   607  	defer func() {
   608  		if r := recover(); r != nil {
   609  			ec.Error(ctx, ec.Recover(ctx, r))
   610  			ret = graphql.Null
   611  		}
   612  	}()
   613  	fc := &graphql.FieldContext{
   614  		Object:   "Query",
   615  		Field:    field,
   616  		Args:     nil,
   617  		IsMethod: true,
   618  	}
   619  
   620  	ctx = graphql.WithFieldContext(ctx, fc)
   621  	rawArgs := field.ArgumentMap(ec.Variables)
   622  	args, err := ec.field_Query___type_args(ctx, rawArgs)
   623  	if err != nil {
   624  		ec.Error(ctx, err)
   625  		return graphql.Null
   626  	}
   627  	fc.Args = args
   628  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   629  		ctx = rctx // use context from middleware stack in children
   630  		return ec.introspectType(args["name"].(string))
   631  	})
   632  	if err != nil {
   633  		ec.Error(ctx, err)
   634  		return graphql.Null
   635  	}
   636  	if resTmp == nil {
   637  		return graphql.Null
   638  	}
   639  	res := resTmp.(*introspection.Type)
   640  	fc.Result = res
   641  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
   642  }
   643  
   644  func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
   645  	defer func() {
   646  		if r := recover(); r != nil {
   647  			ec.Error(ctx, ec.Recover(ctx, r))
   648  			ret = graphql.Null
   649  		}
   650  	}()
   651  	fc := &graphql.FieldContext{
   652  		Object:   "Query",
   653  		Field:    field,
   654  		Args:     nil,
   655  		IsMethod: true,
   656  	}
   657  
   658  	ctx = graphql.WithFieldContext(ctx, fc)
   659  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   660  		ctx = rctx // use context from middleware stack in children
   661  		return ec.introspectSchema()
   662  	})
   663  	if err != nil {
   664  		ec.Error(ctx, err)
   665  		return graphql.Null
   666  	}
   667  	if resTmp == nil {
   668  		return graphql.Null
   669  	}
   670  	res := resTmp.(*introspection.Schema)
   671  	fc.Result = res
   672  	return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res)
   673  }
   674  
   675  func (ec *executionContext) __Service_sdl(ctx context.Context, field graphql.CollectedField, obj *fedruntime.Service) (ret graphql.Marshaler) {
   676  	defer func() {
   677  		if r := recover(); r != nil {
   678  			ec.Error(ctx, ec.Recover(ctx, r))
   679  			ret = graphql.Null
   680  		}
   681  	}()
   682  	fc := &graphql.FieldContext{
   683  		Object:   "_Service",
   684  		Field:    field,
   685  		Args:     nil,
   686  		IsMethod: false,
   687  	}
   688  
   689  	ctx = graphql.WithFieldContext(ctx, fc)
   690  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   691  		ctx = rctx // use context from middleware stack in children
   692  		return obj.SDL, nil
   693  	})
   694  	if err != nil {
   695  		ec.Error(ctx, err)
   696  		return graphql.Null
   697  	}
   698  	if resTmp == nil {
   699  		return graphql.Null
   700  	}
   701  	res := resTmp.(string)
   702  	fc.Result = res
   703  	return ec.marshalOString2string(ctx, field.Selections, res)
   704  }
   705  
   706  func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   707  	defer func() {
   708  		if r := recover(); r != nil {
   709  			ec.Error(ctx, ec.Recover(ctx, r))
   710  			ret = graphql.Null
   711  		}
   712  	}()
   713  	fc := &graphql.FieldContext{
   714  		Object:   "__Directive",
   715  		Field:    field,
   716  		Args:     nil,
   717  		IsMethod: false,
   718  	}
   719  
   720  	ctx = graphql.WithFieldContext(ctx, fc)
   721  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   722  		ctx = rctx // use context from middleware stack in children
   723  		return obj.Name, nil
   724  	})
   725  	if err != nil {
   726  		ec.Error(ctx, err)
   727  		return graphql.Null
   728  	}
   729  	if resTmp == nil {
   730  		if !graphql.HasFieldError(ctx, fc) {
   731  			ec.Errorf(ctx, "must not be null")
   732  		}
   733  		return graphql.Null
   734  	}
   735  	res := resTmp.(string)
   736  	fc.Result = res
   737  	return ec.marshalNString2string(ctx, field.Selections, res)
   738  }
   739  
   740  func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   741  	defer func() {
   742  		if r := recover(); r != nil {
   743  			ec.Error(ctx, ec.Recover(ctx, r))
   744  			ret = graphql.Null
   745  		}
   746  	}()
   747  	fc := &graphql.FieldContext{
   748  		Object:   "__Directive",
   749  		Field:    field,
   750  		Args:     nil,
   751  		IsMethod: false,
   752  	}
   753  
   754  	ctx = graphql.WithFieldContext(ctx, fc)
   755  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   756  		ctx = rctx // use context from middleware stack in children
   757  		return obj.Description, nil
   758  	})
   759  	if err != nil {
   760  		ec.Error(ctx, err)
   761  		return graphql.Null
   762  	}
   763  	if resTmp == nil {
   764  		return graphql.Null
   765  	}
   766  	res := resTmp.(string)
   767  	fc.Result = res
   768  	return ec.marshalOString2string(ctx, field.Selections, res)
   769  }
   770  
   771  func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   772  	defer func() {
   773  		if r := recover(); r != nil {
   774  			ec.Error(ctx, ec.Recover(ctx, r))
   775  			ret = graphql.Null
   776  		}
   777  	}()
   778  	fc := &graphql.FieldContext{
   779  		Object:   "__Directive",
   780  		Field:    field,
   781  		Args:     nil,
   782  		IsMethod: false,
   783  	}
   784  
   785  	ctx = graphql.WithFieldContext(ctx, fc)
   786  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   787  		ctx = rctx // use context from middleware stack in children
   788  		return obj.Locations, nil
   789  	})
   790  	if err != nil {
   791  		ec.Error(ctx, err)
   792  		return graphql.Null
   793  	}
   794  	if resTmp == nil {
   795  		if !graphql.HasFieldError(ctx, fc) {
   796  			ec.Errorf(ctx, "must not be null")
   797  		}
   798  		return graphql.Null
   799  	}
   800  	res := resTmp.([]string)
   801  	fc.Result = res
   802  	return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res)
   803  }
   804  
   805  func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
   806  	defer func() {
   807  		if r := recover(); r != nil {
   808  			ec.Error(ctx, ec.Recover(ctx, r))
   809  			ret = graphql.Null
   810  		}
   811  	}()
   812  	fc := &graphql.FieldContext{
   813  		Object:   "__Directive",
   814  		Field:    field,
   815  		Args:     nil,
   816  		IsMethod: false,
   817  	}
   818  
   819  	ctx = graphql.WithFieldContext(ctx, fc)
   820  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   821  		ctx = rctx // use context from middleware stack in children
   822  		return obj.Args, nil
   823  	})
   824  	if err != nil {
   825  		ec.Error(ctx, err)
   826  		return graphql.Null
   827  	}
   828  	if resTmp == nil {
   829  		if !graphql.HasFieldError(ctx, fc) {
   830  			ec.Errorf(ctx, "must not be null")
   831  		}
   832  		return graphql.Null
   833  	}
   834  	res := resTmp.([]introspection.InputValue)
   835  	fc.Result = res
   836  	return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
   837  }
   838  
   839  func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
   840  	defer func() {
   841  		if r := recover(); r != nil {
   842  			ec.Error(ctx, ec.Recover(ctx, r))
   843  			ret = graphql.Null
   844  		}
   845  	}()
   846  	fc := &graphql.FieldContext{
   847  		Object:   "__EnumValue",
   848  		Field:    field,
   849  		Args:     nil,
   850  		IsMethod: false,
   851  	}
   852  
   853  	ctx = graphql.WithFieldContext(ctx, fc)
   854  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   855  		ctx = rctx // use context from middleware stack in children
   856  		return obj.Name, nil
   857  	})
   858  	if err != nil {
   859  		ec.Error(ctx, err)
   860  		return graphql.Null
   861  	}
   862  	if resTmp == nil {
   863  		if !graphql.HasFieldError(ctx, fc) {
   864  			ec.Errorf(ctx, "must not be null")
   865  		}
   866  		return graphql.Null
   867  	}
   868  	res := resTmp.(string)
   869  	fc.Result = res
   870  	return ec.marshalNString2string(ctx, field.Selections, res)
   871  }
   872  
   873  func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
   874  	defer func() {
   875  		if r := recover(); r != nil {
   876  			ec.Error(ctx, ec.Recover(ctx, r))
   877  			ret = graphql.Null
   878  		}
   879  	}()
   880  	fc := &graphql.FieldContext{
   881  		Object:   "__EnumValue",
   882  		Field:    field,
   883  		Args:     nil,
   884  		IsMethod: false,
   885  	}
   886  
   887  	ctx = graphql.WithFieldContext(ctx, fc)
   888  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   889  		ctx = rctx // use context from middleware stack in children
   890  		return obj.Description, nil
   891  	})
   892  	if err != nil {
   893  		ec.Error(ctx, err)
   894  		return graphql.Null
   895  	}
   896  	if resTmp == nil {
   897  		return graphql.Null
   898  	}
   899  	res := resTmp.(string)
   900  	fc.Result = res
   901  	return ec.marshalOString2string(ctx, field.Selections, res)
   902  }
   903  
   904  func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
   905  	defer func() {
   906  		if r := recover(); r != nil {
   907  			ec.Error(ctx, ec.Recover(ctx, r))
   908  			ret = graphql.Null
   909  		}
   910  	}()
   911  	fc := &graphql.FieldContext{
   912  		Object:   "__EnumValue",
   913  		Field:    field,
   914  		Args:     nil,
   915  		IsMethod: true,
   916  	}
   917  
   918  	ctx = graphql.WithFieldContext(ctx, fc)
   919  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   920  		ctx = rctx // use context from middleware stack in children
   921  		return obj.IsDeprecated(), nil
   922  	})
   923  	if err != nil {
   924  		ec.Error(ctx, err)
   925  		return graphql.Null
   926  	}
   927  	if resTmp == nil {
   928  		if !graphql.HasFieldError(ctx, fc) {
   929  			ec.Errorf(ctx, "must not be null")
   930  		}
   931  		return graphql.Null
   932  	}
   933  	res := resTmp.(bool)
   934  	fc.Result = res
   935  	return ec.marshalNBoolean2bool(ctx, field.Selections, res)
   936  }
   937  
   938  func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
   939  	defer func() {
   940  		if r := recover(); r != nil {
   941  			ec.Error(ctx, ec.Recover(ctx, r))
   942  			ret = graphql.Null
   943  		}
   944  	}()
   945  	fc := &graphql.FieldContext{
   946  		Object:   "__EnumValue",
   947  		Field:    field,
   948  		Args:     nil,
   949  		IsMethod: true,
   950  	}
   951  
   952  	ctx = graphql.WithFieldContext(ctx, fc)
   953  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   954  		ctx = rctx // use context from middleware stack in children
   955  		return obj.DeprecationReason(), nil
   956  	})
   957  	if err != nil {
   958  		ec.Error(ctx, err)
   959  		return graphql.Null
   960  	}
   961  	if resTmp == nil {
   962  		return graphql.Null
   963  	}
   964  	res := resTmp.(*string)
   965  	fc.Result = res
   966  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
   967  }
   968  
   969  func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
   970  	defer func() {
   971  		if r := recover(); r != nil {
   972  			ec.Error(ctx, ec.Recover(ctx, r))
   973  			ret = graphql.Null
   974  		}
   975  	}()
   976  	fc := &graphql.FieldContext{
   977  		Object:   "__Field",
   978  		Field:    field,
   979  		Args:     nil,
   980  		IsMethod: false,
   981  	}
   982  
   983  	ctx = graphql.WithFieldContext(ctx, fc)
   984  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
   985  		ctx = rctx // use context from middleware stack in children
   986  		return obj.Name, nil
   987  	})
   988  	if err != nil {
   989  		ec.Error(ctx, err)
   990  		return graphql.Null
   991  	}
   992  	if resTmp == nil {
   993  		if !graphql.HasFieldError(ctx, fc) {
   994  			ec.Errorf(ctx, "must not be null")
   995  		}
   996  		return graphql.Null
   997  	}
   998  	res := resTmp.(string)
   999  	fc.Result = res
  1000  	return ec.marshalNString2string(ctx, field.Selections, res)
  1001  }
  1002  
  1003  func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1004  	defer func() {
  1005  		if r := recover(); r != nil {
  1006  			ec.Error(ctx, ec.Recover(ctx, r))
  1007  			ret = graphql.Null
  1008  		}
  1009  	}()
  1010  	fc := &graphql.FieldContext{
  1011  		Object:   "__Field",
  1012  		Field:    field,
  1013  		Args:     nil,
  1014  		IsMethod: false,
  1015  	}
  1016  
  1017  	ctx = graphql.WithFieldContext(ctx, fc)
  1018  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1019  		ctx = rctx // use context from middleware stack in children
  1020  		return obj.Description, nil
  1021  	})
  1022  	if err != nil {
  1023  		ec.Error(ctx, err)
  1024  		return graphql.Null
  1025  	}
  1026  	if resTmp == nil {
  1027  		return graphql.Null
  1028  	}
  1029  	res := resTmp.(string)
  1030  	fc.Result = res
  1031  	return ec.marshalOString2string(ctx, field.Selections, res)
  1032  }
  1033  
  1034  func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1035  	defer func() {
  1036  		if r := recover(); r != nil {
  1037  			ec.Error(ctx, ec.Recover(ctx, r))
  1038  			ret = graphql.Null
  1039  		}
  1040  	}()
  1041  	fc := &graphql.FieldContext{
  1042  		Object:   "__Field",
  1043  		Field:    field,
  1044  		Args:     nil,
  1045  		IsMethod: false,
  1046  	}
  1047  
  1048  	ctx = graphql.WithFieldContext(ctx, fc)
  1049  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1050  		ctx = rctx // use context from middleware stack in children
  1051  		return obj.Args, nil
  1052  	})
  1053  	if err != nil {
  1054  		ec.Error(ctx, err)
  1055  		return graphql.Null
  1056  	}
  1057  	if resTmp == nil {
  1058  		if !graphql.HasFieldError(ctx, fc) {
  1059  			ec.Errorf(ctx, "must not be null")
  1060  		}
  1061  		return graphql.Null
  1062  	}
  1063  	res := resTmp.([]introspection.InputValue)
  1064  	fc.Result = res
  1065  	return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
  1066  }
  1067  
  1068  func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1069  	defer func() {
  1070  		if r := recover(); r != nil {
  1071  			ec.Error(ctx, ec.Recover(ctx, r))
  1072  			ret = graphql.Null
  1073  		}
  1074  	}()
  1075  	fc := &graphql.FieldContext{
  1076  		Object:   "__Field",
  1077  		Field:    field,
  1078  		Args:     nil,
  1079  		IsMethod: false,
  1080  	}
  1081  
  1082  	ctx = graphql.WithFieldContext(ctx, fc)
  1083  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1084  		ctx = rctx // use context from middleware stack in children
  1085  		return obj.Type, nil
  1086  	})
  1087  	if err != nil {
  1088  		ec.Error(ctx, err)
  1089  		return graphql.Null
  1090  	}
  1091  	if resTmp == nil {
  1092  		if !graphql.HasFieldError(ctx, fc) {
  1093  			ec.Errorf(ctx, "must not be null")
  1094  		}
  1095  		return graphql.Null
  1096  	}
  1097  	res := resTmp.(*introspection.Type)
  1098  	fc.Result = res
  1099  	return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1100  }
  1101  
  1102  func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1103  	defer func() {
  1104  		if r := recover(); r != nil {
  1105  			ec.Error(ctx, ec.Recover(ctx, r))
  1106  			ret = graphql.Null
  1107  		}
  1108  	}()
  1109  	fc := &graphql.FieldContext{
  1110  		Object:   "__Field",
  1111  		Field:    field,
  1112  		Args:     nil,
  1113  		IsMethod: true,
  1114  	}
  1115  
  1116  	ctx = graphql.WithFieldContext(ctx, fc)
  1117  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1118  		ctx = rctx // use context from middleware stack in children
  1119  		return obj.IsDeprecated(), nil
  1120  	})
  1121  	if err != nil {
  1122  		ec.Error(ctx, err)
  1123  		return graphql.Null
  1124  	}
  1125  	if resTmp == nil {
  1126  		if !graphql.HasFieldError(ctx, fc) {
  1127  			ec.Errorf(ctx, "must not be null")
  1128  		}
  1129  		return graphql.Null
  1130  	}
  1131  	res := resTmp.(bool)
  1132  	fc.Result = res
  1133  	return ec.marshalNBoolean2bool(ctx, field.Selections, res)
  1134  }
  1135  
  1136  func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
  1137  	defer func() {
  1138  		if r := recover(); r != nil {
  1139  			ec.Error(ctx, ec.Recover(ctx, r))
  1140  			ret = graphql.Null
  1141  		}
  1142  	}()
  1143  	fc := &graphql.FieldContext{
  1144  		Object:   "__Field",
  1145  		Field:    field,
  1146  		Args:     nil,
  1147  		IsMethod: true,
  1148  	}
  1149  
  1150  	ctx = graphql.WithFieldContext(ctx, fc)
  1151  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1152  		ctx = rctx // use context from middleware stack in children
  1153  		return obj.DeprecationReason(), nil
  1154  	})
  1155  	if err != nil {
  1156  		ec.Error(ctx, err)
  1157  		return graphql.Null
  1158  	}
  1159  	if resTmp == nil {
  1160  		return graphql.Null
  1161  	}
  1162  	res := resTmp.(*string)
  1163  	fc.Result = res
  1164  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
  1165  }
  1166  
  1167  func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1168  	defer func() {
  1169  		if r := recover(); r != nil {
  1170  			ec.Error(ctx, ec.Recover(ctx, r))
  1171  			ret = graphql.Null
  1172  		}
  1173  	}()
  1174  	fc := &graphql.FieldContext{
  1175  		Object:   "__InputValue",
  1176  		Field:    field,
  1177  		Args:     nil,
  1178  		IsMethod: false,
  1179  	}
  1180  
  1181  	ctx = graphql.WithFieldContext(ctx, fc)
  1182  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1183  		ctx = rctx // use context from middleware stack in children
  1184  		return obj.Name, nil
  1185  	})
  1186  	if err != nil {
  1187  		ec.Error(ctx, err)
  1188  		return graphql.Null
  1189  	}
  1190  	if resTmp == nil {
  1191  		if !graphql.HasFieldError(ctx, fc) {
  1192  			ec.Errorf(ctx, "must not be null")
  1193  		}
  1194  		return graphql.Null
  1195  	}
  1196  	res := resTmp.(string)
  1197  	fc.Result = res
  1198  	return ec.marshalNString2string(ctx, field.Selections, res)
  1199  }
  1200  
  1201  func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1202  	defer func() {
  1203  		if r := recover(); r != nil {
  1204  			ec.Error(ctx, ec.Recover(ctx, r))
  1205  			ret = graphql.Null
  1206  		}
  1207  	}()
  1208  	fc := &graphql.FieldContext{
  1209  		Object:   "__InputValue",
  1210  		Field:    field,
  1211  		Args:     nil,
  1212  		IsMethod: false,
  1213  	}
  1214  
  1215  	ctx = graphql.WithFieldContext(ctx, fc)
  1216  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1217  		ctx = rctx // use context from middleware stack in children
  1218  		return obj.Description, nil
  1219  	})
  1220  	if err != nil {
  1221  		ec.Error(ctx, err)
  1222  		return graphql.Null
  1223  	}
  1224  	if resTmp == nil {
  1225  		return graphql.Null
  1226  	}
  1227  	res := resTmp.(string)
  1228  	fc.Result = res
  1229  	return ec.marshalOString2string(ctx, field.Selections, res)
  1230  }
  1231  
  1232  func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1233  	defer func() {
  1234  		if r := recover(); r != nil {
  1235  			ec.Error(ctx, ec.Recover(ctx, r))
  1236  			ret = graphql.Null
  1237  		}
  1238  	}()
  1239  	fc := &graphql.FieldContext{
  1240  		Object:   "__InputValue",
  1241  		Field:    field,
  1242  		Args:     nil,
  1243  		IsMethod: false,
  1244  	}
  1245  
  1246  	ctx = graphql.WithFieldContext(ctx, fc)
  1247  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1248  		ctx = rctx // use context from middleware stack in children
  1249  		return obj.Type, nil
  1250  	})
  1251  	if err != nil {
  1252  		ec.Error(ctx, err)
  1253  		return graphql.Null
  1254  	}
  1255  	if resTmp == nil {
  1256  		if !graphql.HasFieldError(ctx, fc) {
  1257  			ec.Errorf(ctx, "must not be null")
  1258  		}
  1259  		return graphql.Null
  1260  	}
  1261  	res := resTmp.(*introspection.Type)
  1262  	fc.Result = res
  1263  	return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1264  }
  1265  
  1266  func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
  1267  	defer func() {
  1268  		if r := recover(); r != nil {
  1269  			ec.Error(ctx, ec.Recover(ctx, r))
  1270  			ret = graphql.Null
  1271  		}
  1272  	}()
  1273  	fc := &graphql.FieldContext{
  1274  		Object:   "__InputValue",
  1275  		Field:    field,
  1276  		Args:     nil,
  1277  		IsMethod: false,
  1278  	}
  1279  
  1280  	ctx = graphql.WithFieldContext(ctx, fc)
  1281  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1282  		ctx = rctx // use context from middleware stack in children
  1283  		return obj.DefaultValue, nil
  1284  	})
  1285  	if err != nil {
  1286  		ec.Error(ctx, err)
  1287  		return graphql.Null
  1288  	}
  1289  	if resTmp == nil {
  1290  		return graphql.Null
  1291  	}
  1292  	res := resTmp.(*string)
  1293  	fc.Result = res
  1294  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
  1295  }
  1296  
  1297  func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1298  	defer func() {
  1299  		if r := recover(); r != nil {
  1300  			ec.Error(ctx, ec.Recover(ctx, r))
  1301  			ret = graphql.Null
  1302  		}
  1303  	}()
  1304  	fc := &graphql.FieldContext{
  1305  		Object:   "__Schema",
  1306  		Field:    field,
  1307  		Args:     nil,
  1308  		IsMethod: true,
  1309  	}
  1310  
  1311  	ctx = graphql.WithFieldContext(ctx, fc)
  1312  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1313  		ctx = rctx // use context from middleware stack in children
  1314  		return obj.Types(), nil
  1315  	})
  1316  	if err != nil {
  1317  		ec.Error(ctx, err)
  1318  		return graphql.Null
  1319  	}
  1320  	if resTmp == nil {
  1321  		if !graphql.HasFieldError(ctx, fc) {
  1322  			ec.Errorf(ctx, "must not be null")
  1323  		}
  1324  		return graphql.Null
  1325  	}
  1326  	res := resTmp.([]introspection.Type)
  1327  	fc.Result = res
  1328  	return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
  1329  }
  1330  
  1331  func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1332  	defer func() {
  1333  		if r := recover(); r != nil {
  1334  			ec.Error(ctx, ec.Recover(ctx, r))
  1335  			ret = graphql.Null
  1336  		}
  1337  	}()
  1338  	fc := &graphql.FieldContext{
  1339  		Object:   "__Schema",
  1340  		Field:    field,
  1341  		Args:     nil,
  1342  		IsMethod: true,
  1343  	}
  1344  
  1345  	ctx = graphql.WithFieldContext(ctx, fc)
  1346  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1347  		ctx = rctx // use context from middleware stack in children
  1348  		return obj.QueryType(), nil
  1349  	})
  1350  	if err != nil {
  1351  		ec.Error(ctx, err)
  1352  		return graphql.Null
  1353  	}
  1354  	if resTmp == nil {
  1355  		if !graphql.HasFieldError(ctx, fc) {
  1356  			ec.Errorf(ctx, "must not be null")
  1357  		}
  1358  		return graphql.Null
  1359  	}
  1360  	res := resTmp.(*introspection.Type)
  1361  	fc.Result = res
  1362  	return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1363  }
  1364  
  1365  func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1366  	defer func() {
  1367  		if r := recover(); r != nil {
  1368  			ec.Error(ctx, ec.Recover(ctx, r))
  1369  			ret = graphql.Null
  1370  		}
  1371  	}()
  1372  	fc := &graphql.FieldContext{
  1373  		Object:   "__Schema",
  1374  		Field:    field,
  1375  		Args:     nil,
  1376  		IsMethod: true,
  1377  	}
  1378  
  1379  	ctx = graphql.WithFieldContext(ctx, fc)
  1380  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1381  		ctx = rctx // use context from middleware stack in children
  1382  		return obj.MutationType(), nil
  1383  	})
  1384  	if err != nil {
  1385  		ec.Error(ctx, err)
  1386  		return graphql.Null
  1387  	}
  1388  	if resTmp == nil {
  1389  		return graphql.Null
  1390  	}
  1391  	res := resTmp.(*introspection.Type)
  1392  	fc.Result = res
  1393  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1394  }
  1395  
  1396  func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1397  	defer func() {
  1398  		if r := recover(); r != nil {
  1399  			ec.Error(ctx, ec.Recover(ctx, r))
  1400  			ret = graphql.Null
  1401  		}
  1402  	}()
  1403  	fc := &graphql.FieldContext{
  1404  		Object:   "__Schema",
  1405  		Field:    field,
  1406  		Args:     nil,
  1407  		IsMethod: true,
  1408  	}
  1409  
  1410  	ctx = graphql.WithFieldContext(ctx, fc)
  1411  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1412  		ctx = rctx // use context from middleware stack in children
  1413  		return obj.SubscriptionType(), nil
  1414  	})
  1415  	if err != nil {
  1416  		ec.Error(ctx, err)
  1417  		return graphql.Null
  1418  	}
  1419  	if resTmp == nil {
  1420  		return graphql.Null
  1421  	}
  1422  	res := resTmp.(*introspection.Type)
  1423  	fc.Result = res
  1424  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1425  }
  1426  
  1427  func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
  1428  	defer func() {
  1429  		if r := recover(); r != nil {
  1430  			ec.Error(ctx, ec.Recover(ctx, r))
  1431  			ret = graphql.Null
  1432  		}
  1433  	}()
  1434  	fc := &graphql.FieldContext{
  1435  		Object:   "__Schema",
  1436  		Field:    field,
  1437  		Args:     nil,
  1438  		IsMethod: true,
  1439  	}
  1440  
  1441  	ctx = graphql.WithFieldContext(ctx, fc)
  1442  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1443  		ctx = rctx // use context from middleware stack in children
  1444  		return obj.Directives(), nil
  1445  	})
  1446  	if err != nil {
  1447  		ec.Error(ctx, err)
  1448  		return graphql.Null
  1449  	}
  1450  	if resTmp == nil {
  1451  		if !graphql.HasFieldError(ctx, fc) {
  1452  			ec.Errorf(ctx, "must not be null")
  1453  		}
  1454  		return graphql.Null
  1455  	}
  1456  	res := resTmp.([]introspection.Directive)
  1457  	fc.Result = res
  1458  	return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res)
  1459  }
  1460  
  1461  func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1462  	defer func() {
  1463  		if r := recover(); r != nil {
  1464  			ec.Error(ctx, ec.Recover(ctx, r))
  1465  			ret = graphql.Null
  1466  		}
  1467  	}()
  1468  	fc := &graphql.FieldContext{
  1469  		Object:   "__Type",
  1470  		Field:    field,
  1471  		Args:     nil,
  1472  		IsMethod: true,
  1473  	}
  1474  
  1475  	ctx = graphql.WithFieldContext(ctx, fc)
  1476  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1477  		ctx = rctx // use context from middleware stack in children
  1478  		return obj.Kind(), nil
  1479  	})
  1480  	if err != nil {
  1481  		ec.Error(ctx, err)
  1482  		return graphql.Null
  1483  	}
  1484  	if resTmp == nil {
  1485  		if !graphql.HasFieldError(ctx, fc) {
  1486  			ec.Errorf(ctx, "must not be null")
  1487  		}
  1488  		return graphql.Null
  1489  	}
  1490  	res := resTmp.(string)
  1491  	fc.Result = res
  1492  	return ec.marshalN__TypeKind2string(ctx, field.Selections, res)
  1493  }
  1494  
  1495  func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1496  	defer func() {
  1497  		if r := recover(); r != nil {
  1498  			ec.Error(ctx, ec.Recover(ctx, r))
  1499  			ret = graphql.Null
  1500  		}
  1501  	}()
  1502  	fc := &graphql.FieldContext{
  1503  		Object:   "__Type",
  1504  		Field:    field,
  1505  		Args:     nil,
  1506  		IsMethod: true,
  1507  	}
  1508  
  1509  	ctx = graphql.WithFieldContext(ctx, fc)
  1510  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1511  		ctx = rctx // use context from middleware stack in children
  1512  		return obj.Name(), nil
  1513  	})
  1514  	if err != nil {
  1515  		ec.Error(ctx, err)
  1516  		return graphql.Null
  1517  	}
  1518  	if resTmp == nil {
  1519  		return graphql.Null
  1520  	}
  1521  	res := resTmp.(*string)
  1522  	fc.Result = res
  1523  	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
  1524  }
  1525  
  1526  func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1527  	defer func() {
  1528  		if r := recover(); r != nil {
  1529  			ec.Error(ctx, ec.Recover(ctx, r))
  1530  			ret = graphql.Null
  1531  		}
  1532  	}()
  1533  	fc := &graphql.FieldContext{
  1534  		Object:   "__Type",
  1535  		Field:    field,
  1536  		Args:     nil,
  1537  		IsMethod: true,
  1538  	}
  1539  
  1540  	ctx = graphql.WithFieldContext(ctx, fc)
  1541  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1542  		ctx = rctx // use context from middleware stack in children
  1543  		return obj.Description(), nil
  1544  	})
  1545  	if err != nil {
  1546  		ec.Error(ctx, err)
  1547  		return graphql.Null
  1548  	}
  1549  	if resTmp == nil {
  1550  		return graphql.Null
  1551  	}
  1552  	res := resTmp.(string)
  1553  	fc.Result = res
  1554  	return ec.marshalOString2string(ctx, field.Selections, res)
  1555  }
  1556  
  1557  func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1558  	defer func() {
  1559  		if r := recover(); r != nil {
  1560  			ec.Error(ctx, ec.Recover(ctx, r))
  1561  			ret = graphql.Null
  1562  		}
  1563  	}()
  1564  	fc := &graphql.FieldContext{
  1565  		Object:   "__Type",
  1566  		Field:    field,
  1567  		Args:     nil,
  1568  		IsMethod: true,
  1569  	}
  1570  
  1571  	ctx = graphql.WithFieldContext(ctx, fc)
  1572  	rawArgs := field.ArgumentMap(ec.Variables)
  1573  	args, err := ec.field___Type_fields_args(ctx, rawArgs)
  1574  	if err != nil {
  1575  		ec.Error(ctx, err)
  1576  		return graphql.Null
  1577  	}
  1578  	fc.Args = args
  1579  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1580  		ctx = rctx // use context from middleware stack in children
  1581  		return obj.Fields(args["includeDeprecated"].(bool)), nil
  1582  	})
  1583  	if err != nil {
  1584  		ec.Error(ctx, err)
  1585  		return graphql.Null
  1586  	}
  1587  	if resTmp == nil {
  1588  		return graphql.Null
  1589  	}
  1590  	res := resTmp.([]introspection.Field)
  1591  	fc.Result = res
  1592  	return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res)
  1593  }
  1594  
  1595  func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1596  	defer func() {
  1597  		if r := recover(); r != nil {
  1598  			ec.Error(ctx, ec.Recover(ctx, r))
  1599  			ret = graphql.Null
  1600  		}
  1601  	}()
  1602  	fc := &graphql.FieldContext{
  1603  		Object:   "__Type",
  1604  		Field:    field,
  1605  		Args:     nil,
  1606  		IsMethod: true,
  1607  	}
  1608  
  1609  	ctx = graphql.WithFieldContext(ctx, fc)
  1610  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1611  		ctx = rctx // use context from middleware stack in children
  1612  		return obj.Interfaces(), nil
  1613  	})
  1614  	if err != nil {
  1615  		ec.Error(ctx, err)
  1616  		return graphql.Null
  1617  	}
  1618  	if resTmp == nil {
  1619  		return graphql.Null
  1620  	}
  1621  	res := resTmp.([]introspection.Type)
  1622  	fc.Result = res
  1623  	return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
  1624  }
  1625  
  1626  func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1627  	defer func() {
  1628  		if r := recover(); r != nil {
  1629  			ec.Error(ctx, ec.Recover(ctx, r))
  1630  			ret = graphql.Null
  1631  		}
  1632  	}()
  1633  	fc := &graphql.FieldContext{
  1634  		Object:   "__Type",
  1635  		Field:    field,
  1636  		Args:     nil,
  1637  		IsMethod: true,
  1638  	}
  1639  
  1640  	ctx = graphql.WithFieldContext(ctx, fc)
  1641  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1642  		ctx = rctx // use context from middleware stack in children
  1643  		return obj.PossibleTypes(), nil
  1644  	})
  1645  	if err != nil {
  1646  		ec.Error(ctx, err)
  1647  		return graphql.Null
  1648  	}
  1649  	if resTmp == nil {
  1650  		return graphql.Null
  1651  	}
  1652  	res := resTmp.([]introspection.Type)
  1653  	fc.Result = res
  1654  	return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
  1655  }
  1656  
  1657  func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1658  	defer func() {
  1659  		if r := recover(); r != nil {
  1660  			ec.Error(ctx, ec.Recover(ctx, r))
  1661  			ret = graphql.Null
  1662  		}
  1663  	}()
  1664  	fc := &graphql.FieldContext{
  1665  		Object:   "__Type",
  1666  		Field:    field,
  1667  		Args:     nil,
  1668  		IsMethod: true,
  1669  	}
  1670  
  1671  	ctx = graphql.WithFieldContext(ctx, fc)
  1672  	rawArgs := field.ArgumentMap(ec.Variables)
  1673  	args, err := ec.field___Type_enumValues_args(ctx, rawArgs)
  1674  	if err != nil {
  1675  		ec.Error(ctx, err)
  1676  		return graphql.Null
  1677  	}
  1678  	fc.Args = args
  1679  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1680  		ctx = rctx // use context from middleware stack in children
  1681  		return obj.EnumValues(args["includeDeprecated"].(bool)), nil
  1682  	})
  1683  	if err != nil {
  1684  		ec.Error(ctx, err)
  1685  		return graphql.Null
  1686  	}
  1687  	if resTmp == nil {
  1688  		return graphql.Null
  1689  	}
  1690  	res := resTmp.([]introspection.EnumValue)
  1691  	fc.Result = res
  1692  	return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res)
  1693  }
  1694  
  1695  func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1696  	defer func() {
  1697  		if r := recover(); r != nil {
  1698  			ec.Error(ctx, ec.Recover(ctx, r))
  1699  			ret = graphql.Null
  1700  		}
  1701  	}()
  1702  	fc := &graphql.FieldContext{
  1703  		Object:   "__Type",
  1704  		Field:    field,
  1705  		Args:     nil,
  1706  		IsMethod: true,
  1707  	}
  1708  
  1709  	ctx = graphql.WithFieldContext(ctx, fc)
  1710  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1711  		ctx = rctx // use context from middleware stack in children
  1712  		return obj.InputFields(), nil
  1713  	})
  1714  	if err != nil {
  1715  		ec.Error(ctx, err)
  1716  		return graphql.Null
  1717  	}
  1718  	if resTmp == nil {
  1719  		return graphql.Null
  1720  	}
  1721  	res := resTmp.([]introspection.InputValue)
  1722  	fc.Result = res
  1723  	return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
  1724  }
  1725  
  1726  func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
  1727  	defer func() {
  1728  		if r := recover(); r != nil {
  1729  			ec.Error(ctx, ec.Recover(ctx, r))
  1730  			ret = graphql.Null
  1731  		}
  1732  	}()
  1733  	fc := &graphql.FieldContext{
  1734  		Object:   "__Type",
  1735  		Field:    field,
  1736  		Args:     nil,
  1737  		IsMethod: true,
  1738  	}
  1739  
  1740  	ctx = graphql.WithFieldContext(ctx, fc)
  1741  	resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
  1742  		ctx = rctx // use context from middleware stack in children
  1743  		return obj.OfType(), nil
  1744  	})
  1745  	if err != nil {
  1746  		ec.Error(ctx, err)
  1747  		return graphql.Null
  1748  	}
  1749  	if resTmp == nil {
  1750  		return graphql.Null
  1751  	}
  1752  	res := resTmp.(*introspection.Type)
  1753  	fc.Result = res
  1754  	return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
  1755  }
  1756  
  1757  // endregion **************************** field.gotpl *****************************
  1758  
  1759  // region    **************************** input.gotpl *****************************
  1760  
  1761  // endregion **************************** input.gotpl *****************************
  1762  
  1763  // region    ************************** interface.gotpl ***************************
  1764  
  1765  func (ec *executionContext) __Entity(ctx context.Context, sel ast.SelectionSet, obj fedruntime.Entity) graphql.Marshaler {
  1766  	switch obj := (obj).(type) {
  1767  	case nil:
  1768  		return graphql.Null
  1769  	case model.Product:
  1770  		return ec._Product(ctx, sel, &obj)
  1771  	case *model.Product:
  1772  		if obj == nil {
  1773  			return graphql.Null
  1774  		}
  1775  		return ec._Product(ctx, sel, obj)
  1776  	default:
  1777  		panic(fmt.Errorf("unexpected type %T", obj))
  1778  	}
  1779  }
  1780  
  1781  // endregion ************************** interface.gotpl ***************************
  1782  
  1783  // region    **************************** object.gotpl ****************************
  1784  
  1785  var entityImplementors = []string{"Entity"}
  1786  
  1787  func (ec *executionContext) _Entity(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
  1788  	fields := graphql.CollectFields(ec.OperationContext, sel, entityImplementors)
  1789  
  1790  	ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
  1791  		Object: "Entity",
  1792  	})
  1793  
  1794  	out := graphql.NewFieldSet(fields)
  1795  	var invalids uint32
  1796  	for i, field := range fields {
  1797  		switch field.Name {
  1798  		case "__typename":
  1799  			out.Values[i] = graphql.MarshalString("Entity")
  1800  		case "findProductByUpc":
  1801  			field := field
  1802  			out.Concurrently(i, func() (res graphql.Marshaler) {
  1803  				defer func() {
  1804  					if r := recover(); r != nil {
  1805  						ec.Error(ctx, ec.Recover(ctx, r))
  1806  					}
  1807  				}()
  1808  				res = ec._Entity_findProductByUpc(ctx, field)
  1809  				if res == graphql.Null {
  1810  					atomic.AddUint32(&invalids, 1)
  1811  				}
  1812  				return res
  1813  			})
  1814  		default:
  1815  			panic("unknown field " + strconv.Quote(field.Name))
  1816  		}
  1817  	}
  1818  	out.Dispatch()
  1819  	if invalids > 0 {
  1820  		return graphql.Null
  1821  	}
  1822  	return out
  1823  }
  1824  
  1825  var productImplementors = []string{"Product", "_Entity"}
  1826  
  1827  func (ec *executionContext) _Product(ctx context.Context, sel ast.SelectionSet, obj *model.Product) graphql.Marshaler {
  1828  	fields := graphql.CollectFields(ec.OperationContext, sel, productImplementors)
  1829  
  1830  	out := graphql.NewFieldSet(fields)
  1831  	var invalids uint32
  1832  	for i, field := range fields {
  1833  		switch field.Name {
  1834  		case "__typename":
  1835  			out.Values[i] = graphql.MarshalString("Product")
  1836  		case "upc":
  1837  			out.Values[i] = ec._Product_upc(ctx, field, obj)
  1838  			if out.Values[i] == graphql.Null {
  1839  				invalids++
  1840  			}
  1841  		case "name":
  1842  			out.Values[i] = ec._Product_name(ctx, field, obj)
  1843  			if out.Values[i] == graphql.Null {
  1844  				invalids++
  1845  			}
  1846  		case "price":
  1847  			out.Values[i] = ec._Product_price(ctx, field, obj)
  1848  			if out.Values[i] == graphql.Null {
  1849  				invalids++
  1850  			}
  1851  		default:
  1852  			panic("unknown field " + strconv.Quote(field.Name))
  1853  		}
  1854  	}
  1855  	out.Dispatch()
  1856  	if invalids > 0 {
  1857  		return graphql.Null
  1858  	}
  1859  	return out
  1860  }
  1861  
  1862  var queryImplementors = []string{"Query"}
  1863  
  1864  func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
  1865  	fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
  1866  
  1867  	ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
  1868  		Object: "Query",
  1869  	})
  1870  
  1871  	out := graphql.NewFieldSet(fields)
  1872  	var invalids uint32
  1873  	for i, field := range fields {
  1874  		switch field.Name {
  1875  		case "__typename":
  1876  			out.Values[i] = graphql.MarshalString("Query")
  1877  		case "topProducts":
  1878  			field := field
  1879  			out.Concurrently(i, func() (res graphql.Marshaler) {
  1880  				defer func() {
  1881  					if r := recover(); r != nil {
  1882  						ec.Error(ctx, ec.Recover(ctx, r))
  1883  					}
  1884  				}()
  1885  				res = ec._Query_topProducts(ctx, field)
  1886  				return res
  1887  			})
  1888  		case "_entities":
  1889  			field := field
  1890  			out.Concurrently(i, func() (res graphql.Marshaler) {
  1891  				defer func() {
  1892  					if r := recover(); r != nil {
  1893  						ec.Error(ctx, ec.Recover(ctx, r))
  1894  					}
  1895  				}()
  1896  				res = ec._Query__entities(ctx, field)
  1897  				if res == graphql.Null {
  1898  					atomic.AddUint32(&invalids, 1)
  1899  				}
  1900  				return res
  1901  			})
  1902  		case "_service":
  1903  			field := field
  1904  			out.Concurrently(i, func() (res graphql.Marshaler) {
  1905  				defer func() {
  1906  					if r := recover(); r != nil {
  1907  						ec.Error(ctx, ec.Recover(ctx, r))
  1908  					}
  1909  				}()
  1910  				res = ec._Query__service(ctx, field)
  1911  				if res == graphql.Null {
  1912  					atomic.AddUint32(&invalids, 1)
  1913  				}
  1914  				return res
  1915  			})
  1916  		case "__type":
  1917  			out.Values[i] = ec._Query___type(ctx, field)
  1918  		case "__schema":
  1919  			out.Values[i] = ec._Query___schema(ctx, field)
  1920  		default:
  1921  			panic("unknown field " + strconv.Quote(field.Name))
  1922  		}
  1923  	}
  1924  	out.Dispatch()
  1925  	if invalids > 0 {
  1926  		return graphql.Null
  1927  	}
  1928  	return out
  1929  }
  1930  
  1931  var _ServiceImplementors = []string{"_Service"}
  1932  
  1933  func (ec *executionContext) __Service(ctx context.Context, sel ast.SelectionSet, obj *fedruntime.Service) graphql.Marshaler {
  1934  	fields := graphql.CollectFields(ec.OperationContext, sel, _ServiceImplementors)
  1935  
  1936  	out := graphql.NewFieldSet(fields)
  1937  	var invalids uint32
  1938  	for i, field := range fields {
  1939  		switch field.Name {
  1940  		case "__typename":
  1941  			out.Values[i] = graphql.MarshalString("_Service")
  1942  		case "sdl":
  1943  			out.Values[i] = ec.__Service_sdl(ctx, field, obj)
  1944  		default:
  1945  			panic("unknown field " + strconv.Quote(field.Name))
  1946  		}
  1947  	}
  1948  	out.Dispatch()
  1949  	if invalids > 0 {
  1950  		return graphql.Null
  1951  	}
  1952  	return out
  1953  }
  1954  
  1955  var __DirectiveImplementors = []string{"__Directive"}
  1956  
  1957  func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {
  1958  	fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)
  1959  
  1960  	out := graphql.NewFieldSet(fields)
  1961  	var invalids uint32
  1962  	for i, field := range fields {
  1963  		switch field.Name {
  1964  		case "__typename":
  1965  			out.Values[i] = graphql.MarshalString("__Directive")
  1966  		case "name":
  1967  			out.Values[i] = ec.___Directive_name(ctx, field, obj)
  1968  			if out.Values[i] == graphql.Null {
  1969  				invalids++
  1970  			}
  1971  		case "description":
  1972  			out.Values[i] = ec.___Directive_description(ctx, field, obj)
  1973  		case "locations":
  1974  			out.Values[i] = ec.___Directive_locations(ctx, field, obj)
  1975  			if out.Values[i] == graphql.Null {
  1976  				invalids++
  1977  			}
  1978  		case "args":
  1979  			out.Values[i] = ec.___Directive_args(ctx, field, obj)
  1980  			if out.Values[i] == graphql.Null {
  1981  				invalids++
  1982  			}
  1983  		default:
  1984  			panic("unknown field " + strconv.Quote(field.Name))
  1985  		}
  1986  	}
  1987  	out.Dispatch()
  1988  	if invalids > 0 {
  1989  		return graphql.Null
  1990  	}
  1991  	return out
  1992  }
  1993  
  1994  var __EnumValueImplementors = []string{"__EnumValue"}
  1995  
  1996  func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {
  1997  	fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)
  1998  
  1999  	out := graphql.NewFieldSet(fields)
  2000  	var invalids uint32
  2001  	for i, field := range fields {
  2002  		switch field.Name {
  2003  		case "__typename":
  2004  			out.Values[i] = graphql.MarshalString("__EnumValue")
  2005  		case "name":
  2006  			out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
  2007  			if out.Values[i] == graphql.Null {
  2008  				invalids++
  2009  			}
  2010  		case "description":
  2011  			out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
  2012  		case "isDeprecated":
  2013  			out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
  2014  			if out.Values[i] == graphql.Null {
  2015  				invalids++
  2016  			}
  2017  		case "deprecationReason":
  2018  			out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
  2019  		default:
  2020  			panic("unknown field " + strconv.Quote(field.Name))
  2021  		}
  2022  	}
  2023  	out.Dispatch()
  2024  	if invalids > 0 {
  2025  		return graphql.Null
  2026  	}
  2027  	return out
  2028  }
  2029  
  2030  var __FieldImplementors = []string{"__Field"}
  2031  
  2032  func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {
  2033  	fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)
  2034  
  2035  	out := graphql.NewFieldSet(fields)
  2036  	var invalids uint32
  2037  	for i, field := range fields {
  2038  		switch field.Name {
  2039  		case "__typename":
  2040  			out.Values[i] = graphql.MarshalString("__Field")
  2041  		case "name":
  2042  			out.Values[i] = ec.___Field_name(ctx, field, obj)
  2043  			if out.Values[i] == graphql.Null {
  2044  				invalids++
  2045  			}
  2046  		case "description":
  2047  			out.Values[i] = ec.___Field_description(ctx, field, obj)
  2048  		case "args":
  2049  			out.Values[i] = ec.___Field_args(ctx, field, obj)
  2050  			if out.Values[i] == graphql.Null {
  2051  				invalids++
  2052  			}
  2053  		case "type":
  2054  			out.Values[i] = ec.___Field_type(ctx, field, obj)
  2055  			if out.Values[i] == graphql.Null {
  2056  				invalids++
  2057  			}
  2058  		case "isDeprecated":
  2059  			out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
  2060  			if out.Values[i] == graphql.Null {
  2061  				invalids++
  2062  			}
  2063  		case "deprecationReason":
  2064  			out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
  2065  		default:
  2066  			panic("unknown field " + strconv.Quote(field.Name))
  2067  		}
  2068  	}
  2069  	out.Dispatch()
  2070  	if invalids > 0 {
  2071  		return graphql.Null
  2072  	}
  2073  	return out
  2074  }
  2075  
  2076  var __InputValueImplementors = []string{"__InputValue"}
  2077  
  2078  func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {
  2079  	fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)
  2080  
  2081  	out := graphql.NewFieldSet(fields)
  2082  	var invalids uint32
  2083  	for i, field := range fields {
  2084  		switch field.Name {
  2085  		case "__typename":
  2086  			out.Values[i] = graphql.MarshalString("__InputValue")
  2087  		case "name":
  2088  			out.Values[i] = ec.___InputValue_name(ctx, field, obj)
  2089  			if out.Values[i] == graphql.Null {
  2090  				invalids++
  2091  			}
  2092  		case "description":
  2093  			out.Values[i] = ec.___InputValue_description(ctx, field, obj)
  2094  		case "type":
  2095  			out.Values[i] = ec.___InputValue_type(ctx, field, obj)
  2096  			if out.Values[i] == graphql.Null {
  2097  				invalids++
  2098  			}
  2099  		case "defaultValue":
  2100  			out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
  2101  		default:
  2102  			panic("unknown field " + strconv.Quote(field.Name))
  2103  		}
  2104  	}
  2105  	out.Dispatch()
  2106  	if invalids > 0 {
  2107  		return graphql.Null
  2108  	}
  2109  	return out
  2110  }
  2111  
  2112  var __SchemaImplementors = []string{"__Schema"}
  2113  
  2114  func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {
  2115  	fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)
  2116  
  2117  	out := graphql.NewFieldSet(fields)
  2118  	var invalids uint32
  2119  	for i, field := range fields {
  2120  		switch field.Name {
  2121  		case "__typename":
  2122  			out.Values[i] = graphql.MarshalString("__Schema")
  2123  		case "types":
  2124  			out.Values[i] = ec.___Schema_types(ctx, field, obj)
  2125  			if out.Values[i] == graphql.Null {
  2126  				invalids++
  2127  			}
  2128  		case "queryType":
  2129  			out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
  2130  			if out.Values[i] == graphql.Null {
  2131  				invalids++
  2132  			}
  2133  		case "mutationType":
  2134  			out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
  2135  		case "subscriptionType":
  2136  			out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
  2137  		case "directives":
  2138  			out.Values[i] = ec.___Schema_directives(ctx, field, obj)
  2139  			if out.Values[i] == graphql.Null {
  2140  				invalids++
  2141  			}
  2142  		default:
  2143  			panic("unknown field " + strconv.Quote(field.Name))
  2144  		}
  2145  	}
  2146  	out.Dispatch()
  2147  	if invalids > 0 {
  2148  		return graphql.Null
  2149  	}
  2150  	return out
  2151  }
  2152  
  2153  var __TypeImplementors = []string{"__Type"}
  2154  
  2155  func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {
  2156  	fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)
  2157  
  2158  	out := graphql.NewFieldSet(fields)
  2159  	var invalids uint32
  2160  	for i, field := range fields {
  2161  		switch field.Name {
  2162  		case "__typename":
  2163  			out.Values[i] = graphql.MarshalString("__Type")
  2164  		case "kind":
  2165  			out.Values[i] = ec.___Type_kind(ctx, field, obj)
  2166  			if out.Values[i] == graphql.Null {
  2167  				invalids++
  2168  			}
  2169  		case "name":
  2170  			out.Values[i] = ec.___Type_name(ctx, field, obj)
  2171  		case "description":
  2172  			out.Values[i] = ec.___Type_description(ctx, field, obj)
  2173  		case "fields":
  2174  			out.Values[i] = ec.___Type_fields(ctx, field, obj)
  2175  		case "interfaces":
  2176  			out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
  2177  		case "possibleTypes":
  2178  			out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
  2179  		case "enumValues":
  2180  			out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
  2181  		case "inputFields":
  2182  			out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
  2183  		case "ofType":
  2184  			out.Values[i] = ec.___Type_ofType(ctx, field, obj)
  2185  		default:
  2186  			panic("unknown field " + strconv.Quote(field.Name))
  2187  		}
  2188  	}
  2189  	out.Dispatch()
  2190  	if invalids > 0 {
  2191  		return graphql.Null
  2192  	}
  2193  	return out
  2194  }
  2195  
  2196  // endregion **************************** object.gotpl ****************************
  2197  
  2198  // region    ***************************** type.gotpl *****************************
  2199  
  2200  func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
  2201  	return graphql.UnmarshalBoolean(v)
  2202  }
  2203  
  2204  func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
  2205  	res := graphql.MarshalBoolean(v)
  2206  	if res == graphql.Null {
  2207  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2208  			ec.Errorf(ctx, "must not be null")
  2209  		}
  2210  	}
  2211  	return res
  2212  }
  2213  
  2214  func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) {
  2215  	return graphql.UnmarshalInt(v)
  2216  }
  2217  
  2218  func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler {
  2219  	res := graphql.MarshalInt(v)
  2220  	if res == graphql.Null {
  2221  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2222  			ec.Errorf(ctx, "must not be null")
  2223  		}
  2224  	}
  2225  	return res
  2226  }
  2227  
  2228  func (ec *executionContext) marshalNProduct2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v model.Product) graphql.Marshaler {
  2229  	return ec._Product(ctx, sel, &v)
  2230  }
  2231  
  2232  func (ec *executionContext) marshalNProduct2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v *model.Product) graphql.Marshaler {
  2233  	if v == nil {
  2234  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2235  			ec.Errorf(ctx, "must not be null")
  2236  		}
  2237  		return graphql.Null
  2238  	}
  2239  	return ec._Product(ctx, sel, v)
  2240  }
  2241  
  2242  func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) {
  2243  	return graphql.UnmarshalString(v)
  2244  }
  2245  
  2246  func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2247  	res := graphql.MarshalString(v)
  2248  	if res == graphql.Null {
  2249  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2250  			ec.Errorf(ctx, "must not be null")
  2251  		}
  2252  	}
  2253  	return res
  2254  }
  2255  
  2256  func (ec *executionContext) unmarshalN_Any2map(ctx context.Context, v interface{}) (map[string]interface{}, error) {
  2257  	if v == nil {
  2258  		return nil, nil
  2259  	}
  2260  	return graphql.UnmarshalMap(v)
  2261  }
  2262  
  2263  func (ec *executionContext) marshalN_Any2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) graphql.Marshaler {
  2264  	if v == nil {
  2265  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2266  			ec.Errorf(ctx, "must not be null")
  2267  		}
  2268  		return graphql.Null
  2269  	}
  2270  	res := graphql.MarshalMap(v)
  2271  	if res == graphql.Null {
  2272  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2273  			ec.Errorf(ctx, "must not be null")
  2274  		}
  2275  	}
  2276  	return res
  2277  }
  2278  
  2279  func (ec *executionContext) unmarshalN_Any2ᚕmapᚄ(ctx context.Context, v interface{}) ([]map[string]interface{}, error) {
  2280  	var vSlice []interface{}
  2281  	if v != nil {
  2282  		if tmp1, ok := v.([]interface{}); ok {
  2283  			vSlice = tmp1
  2284  		} else {
  2285  			vSlice = []interface{}{v}
  2286  		}
  2287  	}
  2288  	var err error
  2289  	res := make([]map[string]interface{}, len(vSlice))
  2290  	for i := range vSlice {
  2291  		res[i], err = ec.unmarshalN_Any2map(ctx, vSlice[i])
  2292  		if err != nil {
  2293  			return nil, err
  2294  		}
  2295  	}
  2296  	return res, nil
  2297  }
  2298  
  2299  func (ec *executionContext) marshalN_Any2ᚕmapᚄ(ctx context.Context, sel ast.SelectionSet, v []map[string]interface{}) graphql.Marshaler {
  2300  	ret := make(graphql.Array, len(v))
  2301  	for i := range v {
  2302  		ret[i] = ec.marshalN_Any2map(ctx, sel, v[i])
  2303  	}
  2304  
  2305  	return ret
  2306  }
  2307  
  2308  func (ec *executionContext) marshalN_Entity2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v []fedruntime.Entity) graphql.Marshaler {
  2309  	ret := make(graphql.Array, len(v))
  2310  	var wg sync.WaitGroup
  2311  	isLen1 := len(v) == 1
  2312  	if !isLen1 {
  2313  		wg.Add(len(v))
  2314  	}
  2315  	for i := range v {
  2316  		i := i
  2317  		fc := &graphql.FieldContext{
  2318  			Index:  &i,
  2319  			Result: &v[i],
  2320  		}
  2321  		ctx := graphql.WithFieldContext(ctx, fc)
  2322  		f := func(i int) {
  2323  			defer func() {
  2324  				if r := recover(); r != nil {
  2325  					ec.Error(ctx, ec.Recover(ctx, r))
  2326  					ret = nil
  2327  				}
  2328  			}()
  2329  			if !isLen1 {
  2330  				defer wg.Done()
  2331  			}
  2332  			ret[i] = ec.marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx, sel, v[i])
  2333  		}
  2334  		if isLen1 {
  2335  			f(i)
  2336  		} else {
  2337  			go f(i)
  2338  		}
  2339  
  2340  	}
  2341  	wg.Wait()
  2342  	return ret
  2343  }
  2344  
  2345  func (ec *executionContext) unmarshalN_FieldSet2string(ctx context.Context, v interface{}) (string, error) {
  2346  	return graphql.UnmarshalString(v)
  2347  }
  2348  
  2349  func (ec *executionContext) marshalN_FieldSet2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2350  	res := graphql.MarshalString(v)
  2351  	if res == graphql.Null {
  2352  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2353  			ec.Errorf(ctx, "must not be null")
  2354  		}
  2355  	}
  2356  	return res
  2357  }
  2358  
  2359  func (ec *executionContext) marshalN_Service2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐService(ctx context.Context, sel ast.SelectionSet, v fedruntime.Service) graphql.Marshaler {
  2360  	return ec.__Service(ctx, sel, &v)
  2361  }
  2362  
  2363  func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
  2364  	return ec.___Directive(ctx, sel, &v)
  2365  }
  2366  
  2367  func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler {
  2368  	ret := make(graphql.Array, len(v))
  2369  	var wg sync.WaitGroup
  2370  	isLen1 := len(v) == 1
  2371  	if !isLen1 {
  2372  		wg.Add(len(v))
  2373  	}
  2374  	for i := range v {
  2375  		i := i
  2376  		fc := &graphql.FieldContext{
  2377  			Index:  &i,
  2378  			Result: &v[i],
  2379  		}
  2380  		ctx := graphql.WithFieldContext(ctx, fc)
  2381  		f := func(i int) {
  2382  			defer func() {
  2383  				if r := recover(); r != nil {
  2384  					ec.Error(ctx, ec.Recover(ctx, r))
  2385  					ret = nil
  2386  				}
  2387  			}()
  2388  			if !isLen1 {
  2389  				defer wg.Done()
  2390  			}
  2391  			ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i])
  2392  		}
  2393  		if isLen1 {
  2394  			f(i)
  2395  		} else {
  2396  			go f(i)
  2397  		}
  2398  
  2399  	}
  2400  	wg.Wait()
  2401  	return ret
  2402  }
  2403  
  2404  func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) {
  2405  	return graphql.UnmarshalString(v)
  2406  }
  2407  
  2408  func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2409  	res := graphql.MarshalString(v)
  2410  	if res == graphql.Null {
  2411  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2412  			ec.Errorf(ctx, "must not be null")
  2413  		}
  2414  	}
  2415  	return res
  2416  }
  2417  
  2418  func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
  2419  	var vSlice []interface{}
  2420  	if v != nil {
  2421  		if tmp1, ok := v.([]interface{}); ok {
  2422  			vSlice = tmp1
  2423  		} else {
  2424  			vSlice = []interface{}{v}
  2425  		}
  2426  	}
  2427  	var err error
  2428  	res := make([]string, len(vSlice))
  2429  	for i := range vSlice {
  2430  		res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i])
  2431  		if err != nil {
  2432  			return nil, err
  2433  		}
  2434  	}
  2435  	return res, nil
  2436  }
  2437  
  2438  func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
  2439  	ret := make(graphql.Array, len(v))
  2440  	var wg sync.WaitGroup
  2441  	isLen1 := len(v) == 1
  2442  	if !isLen1 {
  2443  		wg.Add(len(v))
  2444  	}
  2445  	for i := range v {
  2446  		i := i
  2447  		fc := &graphql.FieldContext{
  2448  			Index:  &i,
  2449  			Result: &v[i],
  2450  		}
  2451  		ctx := graphql.WithFieldContext(ctx, fc)
  2452  		f := func(i int) {
  2453  			defer func() {
  2454  				if r := recover(); r != nil {
  2455  					ec.Error(ctx, ec.Recover(ctx, r))
  2456  					ret = nil
  2457  				}
  2458  			}()
  2459  			if !isLen1 {
  2460  				defer wg.Done()
  2461  			}
  2462  			ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i])
  2463  		}
  2464  		if isLen1 {
  2465  			f(i)
  2466  		} else {
  2467  			go f(i)
  2468  		}
  2469  
  2470  	}
  2471  	wg.Wait()
  2472  	return ret
  2473  }
  2474  
  2475  func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler {
  2476  	return ec.___EnumValue(ctx, sel, &v)
  2477  }
  2478  
  2479  func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler {
  2480  	return ec.___Field(ctx, sel, &v)
  2481  }
  2482  
  2483  func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler {
  2484  	return ec.___InputValue(ctx, sel, &v)
  2485  }
  2486  
  2487  func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
  2488  	ret := make(graphql.Array, len(v))
  2489  	var wg sync.WaitGroup
  2490  	isLen1 := len(v) == 1
  2491  	if !isLen1 {
  2492  		wg.Add(len(v))
  2493  	}
  2494  	for i := range v {
  2495  		i := i
  2496  		fc := &graphql.FieldContext{
  2497  			Index:  &i,
  2498  			Result: &v[i],
  2499  		}
  2500  		ctx := graphql.WithFieldContext(ctx, fc)
  2501  		f := func(i int) {
  2502  			defer func() {
  2503  				if r := recover(); r != nil {
  2504  					ec.Error(ctx, ec.Recover(ctx, r))
  2505  					ret = nil
  2506  				}
  2507  			}()
  2508  			if !isLen1 {
  2509  				defer wg.Done()
  2510  			}
  2511  			ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
  2512  		}
  2513  		if isLen1 {
  2514  			f(i)
  2515  		} else {
  2516  			go f(i)
  2517  		}
  2518  
  2519  	}
  2520  	wg.Wait()
  2521  	return ret
  2522  }
  2523  
  2524  func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
  2525  	return ec.___Type(ctx, sel, &v)
  2526  }
  2527  
  2528  func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
  2529  	ret := make(graphql.Array, len(v))
  2530  	var wg sync.WaitGroup
  2531  	isLen1 := len(v) == 1
  2532  	if !isLen1 {
  2533  		wg.Add(len(v))
  2534  	}
  2535  	for i := range v {
  2536  		i := i
  2537  		fc := &graphql.FieldContext{
  2538  			Index:  &i,
  2539  			Result: &v[i],
  2540  		}
  2541  		ctx := graphql.WithFieldContext(ctx, fc)
  2542  		f := func(i int) {
  2543  			defer func() {
  2544  				if r := recover(); r != nil {
  2545  					ec.Error(ctx, ec.Recover(ctx, r))
  2546  					ret = nil
  2547  				}
  2548  			}()
  2549  			if !isLen1 {
  2550  				defer wg.Done()
  2551  			}
  2552  			ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
  2553  		}
  2554  		if isLen1 {
  2555  			f(i)
  2556  		} else {
  2557  			go f(i)
  2558  		}
  2559  
  2560  	}
  2561  	wg.Wait()
  2562  	return ret
  2563  }
  2564  
  2565  func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
  2566  	if v == nil {
  2567  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2568  			ec.Errorf(ctx, "must not be null")
  2569  		}
  2570  		return graphql.Null
  2571  	}
  2572  	return ec.___Type(ctx, sel, v)
  2573  }
  2574  
  2575  func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) {
  2576  	return graphql.UnmarshalString(v)
  2577  }
  2578  
  2579  func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2580  	res := graphql.MarshalString(v)
  2581  	if res == graphql.Null {
  2582  		if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
  2583  			ec.Errorf(ctx, "must not be null")
  2584  		}
  2585  	}
  2586  	return res
  2587  }
  2588  
  2589  func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
  2590  	return graphql.UnmarshalBoolean(v)
  2591  }
  2592  
  2593  func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
  2594  	return graphql.MarshalBoolean(v)
  2595  }
  2596  
  2597  func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) {
  2598  	if v == nil {
  2599  		return nil, nil
  2600  	}
  2601  	res, err := ec.unmarshalOBoolean2bool(ctx, v)
  2602  	return &res, err
  2603  }
  2604  
  2605  func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler {
  2606  	if v == nil {
  2607  		return graphql.Null
  2608  	}
  2609  	return ec.marshalOBoolean2bool(ctx, sel, *v)
  2610  }
  2611  
  2612  func (ec *executionContext) unmarshalOInt2int(ctx context.Context, v interface{}) (int, error) {
  2613  	return graphql.UnmarshalInt(v)
  2614  }
  2615  
  2616  func (ec *executionContext) marshalOInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler {
  2617  	return graphql.MarshalInt(v)
  2618  }
  2619  
  2620  func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) {
  2621  	if v == nil {
  2622  		return nil, nil
  2623  	}
  2624  	res, err := ec.unmarshalOInt2int(ctx, v)
  2625  	return &res, err
  2626  }
  2627  
  2628  func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler {
  2629  	if v == nil {
  2630  		return graphql.Null
  2631  	}
  2632  	return ec.marshalOInt2int(ctx, sel, *v)
  2633  }
  2634  
  2635  func (ec *executionContext) marshalOProduct2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v model.Product) graphql.Marshaler {
  2636  	return ec._Product(ctx, sel, &v)
  2637  }
  2638  
  2639  func (ec *executionContext) marshalOProduct2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v []*model.Product) graphql.Marshaler {
  2640  	if v == nil {
  2641  		return graphql.Null
  2642  	}
  2643  	ret := make(graphql.Array, len(v))
  2644  	var wg sync.WaitGroup
  2645  	isLen1 := len(v) == 1
  2646  	if !isLen1 {
  2647  		wg.Add(len(v))
  2648  	}
  2649  	for i := range v {
  2650  		i := i
  2651  		fc := &graphql.FieldContext{
  2652  			Index:  &i,
  2653  			Result: &v[i],
  2654  		}
  2655  		ctx := graphql.WithFieldContext(ctx, fc)
  2656  		f := func(i int) {
  2657  			defer func() {
  2658  				if r := recover(); r != nil {
  2659  					ec.Error(ctx, ec.Recover(ctx, r))
  2660  					ret = nil
  2661  				}
  2662  			}()
  2663  			if !isLen1 {
  2664  				defer wg.Done()
  2665  			}
  2666  			ret[i] = ec.marshalOProduct2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx, sel, v[i])
  2667  		}
  2668  		if isLen1 {
  2669  			f(i)
  2670  		} else {
  2671  			go f(i)
  2672  		}
  2673  
  2674  	}
  2675  	wg.Wait()
  2676  	return ret
  2677  }
  2678  
  2679  func (ec *executionContext) marshalOProduct2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋfederationᚋproductsᚋgraphᚋmodelᚐProduct(ctx context.Context, sel ast.SelectionSet, v *model.Product) graphql.Marshaler {
  2680  	if v == nil {
  2681  		return graphql.Null
  2682  	}
  2683  	return ec._Product(ctx, sel, v)
  2684  }
  2685  
  2686  func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) {
  2687  	return graphql.UnmarshalString(v)
  2688  }
  2689  
  2690  func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
  2691  	return graphql.MarshalString(v)
  2692  }
  2693  
  2694  func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) {
  2695  	if v == nil {
  2696  		return nil, nil
  2697  	}
  2698  	res, err := ec.unmarshalOString2string(ctx, v)
  2699  	return &res, err
  2700  }
  2701  
  2702  func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
  2703  	if v == nil {
  2704  		return graphql.Null
  2705  	}
  2706  	return ec.marshalOString2string(ctx, sel, *v)
  2707  }
  2708  
  2709  func (ec *executionContext) marshalO_Entity2githubᚗcomᚋ99designsᚋgqlgenᚋpluginᚋfederationᚋfedruntimeᚐEntity(ctx context.Context, sel ast.SelectionSet, v fedruntime.Entity) graphql.Marshaler {
  2710  	if v == nil {
  2711  		return graphql.Null
  2712  	}
  2713  	return ec.__Entity(ctx, sel, v)
  2714  }
  2715  
  2716  func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler {
  2717  	if v == nil {
  2718  		return graphql.Null
  2719  	}
  2720  	ret := make(graphql.Array, len(v))
  2721  	var wg sync.WaitGroup
  2722  	isLen1 := len(v) == 1
  2723  	if !isLen1 {
  2724  		wg.Add(len(v))
  2725  	}
  2726  	for i := range v {
  2727  		i := i
  2728  		fc := &graphql.FieldContext{
  2729  			Index:  &i,
  2730  			Result: &v[i],
  2731  		}
  2732  		ctx := graphql.WithFieldContext(ctx, fc)
  2733  		f := func(i int) {
  2734  			defer func() {
  2735  				if r := recover(); r != nil {
  2736  					ec.Error(ctx, ec.Recover(ctx, r))
  2737  					ret = nil
  2738  				}
  2739  			}()
  2740  			if !isLen1 {
  2741  				defer wg.Done()
  2742  			}
  2743  			ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i])
  2744  		}
  2745  		if isLen1 {
  2746  			f(i)
  2747  		} else {
  2748  			go f(i)
  2749  		}
  2750  
  2751  	}
  2752  	wg.Wait()
  2753  	return ret
  2754  }
  2755  
  2756  func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler {
  2757  	if v == nil {
  2758  		return graphql.Null
  2759  	}
  2760  	ret := make(graphql.Array, len(v))
  2761  	var wg sync.WaitGroup
  2762  	isLen1 := len(v) == 1
  2763  	if !isLen1 {
  2764  		wg.Add(len(v))
  2765  	}
  2766  	for i := range v {
  2767  		i := i
  2768  		fc := &graphql.FieldContext{
  2769  			Index:  &i,
  2770  			Result: &v[i],
  2771  		}
  2772  		ctx := graphql.WithFieldContext(ctx, fc)
  2773  		f := func(i int) {
  2774  			defer func() {
  2775  				if r := recover(); r != nil {
  2776  					ec.Error(ctx, ec.Recover(ctx, r))
  2777  					ret = nil
  2778  				}
  2779  			}()
  2780  			if !isLen1 {
  2781  				defer wg.Done()
  2782  			}
  2783  			ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i])
  2784  		}
  2785  		if isLen1 {
  2786  			f(i)
  2787  		} else {
  2788  			go f(i)
  2789  		}
  2790  
  2791  	}
  2792  	wg.Wait()
  2793  	return ret
  2794  }
  2795  
  2796  func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
  2797  	if v == nil {
  2798  		return graphql.Null
  2799  	}
  2800  	ret := make(graphql.Array, len(v))
  2801  	var wg sync.WaitGroup
  2802  	isLen1 := len(v) == 1
  2803  	if !isLen1 {
  2804  		wg.Add(len(v))
  2805  	}
  2806  	for i := range v {
  2807  		i := i
  2808  		fc := &graphql.FieldContext{
  2809  			Index:  &i,
  2810  			Result: &v[i],
  2811  		}
  2812  		ctx := graphql.WithFieldContext(ctx, fc)
  2813  		f := func(i int) {
  2814  			defer func() {
  2815  				if r := recover(); r != nil {
  2816  					ec.Error(ctx, ec.Recover(ctx, r))
  2817  					ret = nil
  2818  				}
  2819  			}()
  2820  			if !isLen1 {
  2821  				defer wg.Done()
  2822  			}
  2823  			ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
  2824  		}
  2825  		if isLen1 {
  2826  			f(i)
  2827  		} else {
  2828  			go f(i)
  2829  		}
  2830  
  2831  	}
  2832  	wg.Wait()
  2833  	return ret
  2834  }
  2835  
  2836  func (ec *executionContext) marshalO__Schema2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v introspection.Schema) graphql.Marshaler {
  2837  	return ec.___Schema(ctx, sel, &v)
  2838  }
  2839  
  2840  func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler {
  2841  	if v == nil {
  2842  		return graphql.Null
  2843  	}
  2844  	return ec.___Schema(ctx, sel, v)
  2845  }
  2846  
  2847  func (ec *executionContext) marshalO__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
  2848  	return ec.___Type(ctx, sel, &v)
  2849  }
  2850  
  2851  func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
  2852  	if v == nil {
  2853  		return graphql.Null
  2854  	}
  2855  	ret := make(graphql.Array, len(v))
  2856  	var wg sync.WaitGroup
  2857  	isLen1 := len(v) == 1
  2858  	if !isLen1 {
  2859  		wg.Add(len(v))
  2860  	}
  2861  	for i := range v {
  2862  		i := i
  2863  		fc := &graphql.FieldContext{
  2864  			Index:  &i,
  2865  			Result: &v[i],
  2866  		}
  2867  		ctx := graphql.WithFieldContext(ctx, fc)
  2868  		f := func(i int) {
  2869  			defer func() {
  2870  				if r := recover(); r != nil {
  2871  					ec.Error(ctx, ec.Recover(ctx, r))
  2872  					ret = nil
  2873  				}
  2874  			}()
  2875  			if !isLen1 {
  2876  				defer wg.Done()
  2877  			}
  2878  			ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
  2879  		}
  2880  		if isLen1 {
  2881  			f(i)
  2882  		} else {
  2883  			go f(i)
  2884  		}
  2885  
  2886  	}
  2887  	wg.Wait()
  2888  	return ret
  2889  }
  2890  
  2891  func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
  2892  	if v == nil {
  2893  		return graphql.Null
  2894  	}
  2895  	return ec.___Type(ctx, sel, v)
  2896  }
  2897  
  2898  // endregion ***************************** type.gotpl *****************************