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