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