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