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