github.com/Go-GraphQL-Group/GraphQL-Service@v0.0.0-20181226133140-0967350219a7/graphql/generated.go (about) 1 // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. 2 3 package graphql 4 5 import ( 6 "bytes" 7 "context" 8 "errors" 9 "strconv" 10 "sync" 11 12 "github.com/99designs/gqlgen/graphql" 13 "github.com/99designs/gqlgen/graphql/introspection" 14 "github.com/Go-GraphQL-Group/GraphQL-Service/model" 15 "github.com/vektah/gqlparser" 16 "github.com/vektah/gqlparser/ast" 17 ) 18 19 // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. 20 func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { 21 return &executableSchema{ 22 resolvers: cfg.Resolvers, 23 directives: cfg.Directives, 24 complexity: cfg.Complexity, 25 } 26 } 27 28 type Config struct { 29 Resolvers ResolverRoot 30 Directives DirectiveRoot 31 Complexity ComplexityRoot 32 } 33 34 type ResolverRoot interface { 35 Query() QueryResolver 36 } 37 38 type DirectiveRoot struct { 39 } 40 41 type ComplexityRoot struct { 42 Film struct { 43 Id func(childComplexity int) int 44 Title func(childComplexity int) int 45 EpisodeId func(childComplexity int) int 46 OpeningCrawl func(childComplexity int) int 47 Director func(childComplexity int) int 48 Producer func(childComplexity int) int 49 ReleaseDate func(childComplexity int) int 50 Species func(childComplexity int) int 51 Starships func(childComplexity int) int 52 Vehicles func(childComplexity int) int 53 Characters func(childComplexity int) int 54 Planets func(childComplexity int) int 55 } 56 57 FilmConnection struct { 58 PageInfo func(childComplexity int) int 59 Edges func(childComplexity int) int 60 TotalCount func(childComplexity int) int 61 } 62 63 FilmEdge struct { 64 Node func(childComplexity int) int 65 Cursor func(childComplexity int) int 66 } 67 68 PageInfo struct { 69 HasNextPage func(childComplexity int) int 70 HasPreviousPage func(childComplexity int) int 71 StartCursor func(childComplexity int) int 72 EndCursor func(childComplexity int) int 73 } 74 75 People struct { 76 Id func(childComplexity int) int 77 Name func(childComplexity int) int 78 BirthYear func(childComplexity int) int 79 EyeColor func(childComplexity int) int 80 Gender func(childComplexity int) int 81 HairColor func(childComplexity int) int 82 Height func(childComplexity int) int 83 Mass func(childComplexity int) int 84 SkinColor func(childComplexity int) int 85 Homeworld func(childComplexity int) int 86 Films func(childComplexity int) int 87 Species func(childComplexity int) int 88 Starships func(childComplexity int) int 89 Vehicles func(childComplexity int) int 90 } 91 92 PeopleConnection struct { 93 PageInfo func(childComplexity int) int 94 Edges func(childComplexity int) int 95 TotalCount func(childComplexity int) int 96 } 97 98 PeopleEdge struct { 99 Node func(childComplexity int) int 100 Cursor func(childComplexity int) int 101 } 102 103 Planet struct { 104 Id func(childComplexity int) int 105 Name func(childComplexity int) int 106 Diameter func(childComplexity int) int 107 RotationPeriod func(childComplexity int) int 108 OrbitalPeriod func(childComplexity int) int 109 Gravity func(childComplexity int) int 110 Population func(childComplexity int) int 111 Climate func(childComplexity int) int 112 Terrain func(childComplexity int) int 113 SurfaceWater func(childComplexity int) int 114 Residents func(childComplexity int) int 115 Films func(childComplexity int) int 116 } 117 118 PlanetConnection struct { 119 PageInfo func(childComplexity int) int 120 Edges func(childComplexity int) int 121 TotalCount func(childComplexity int) int 122 } 123 124 PlanetEdge struct { 125 Node func(childComplexity int) int 126 Cursor func(childComplexity int) int 127 } 128 129 Query struct { 130 People func(childComplexity int, id string) int 131 Film func(childComplexity int, id string) int 132 Starship func(childComplexity int, id string) int 133 Vehicle func(childComplexity int, id string) int 134 Specie func(childComplexity int, id string) int 135 Planet func(childComplexity int, id string) int 136 Peoples func(childComplexity int, first *int, after *string) int 137 Films func(childComplexity int, first *int, after *string) int 138 Starships func(childComplexity int, first *int, after *string) int 139 Vehicles func(childComplexity int, first *int, after *string) int 140 Species func(childComplexity int, first *int, after *string) int 141 Planets func(childComplexity int, first *int, after *string) int 142 PeopleSearch func(childComplexity int, search string, first *int, after *string) int 143 FilmsSearch func(childComplexity int, search string, first *int, after *string) int 144 StarshipsSearch func(childComplexity int, search string, first *int, after *string) int 145 VehiclesSearch func(childComplexity int, search string, first *int, after *string) int 146 SpeciesSearch func(childComplexity int, search string, first *int, after *string) int 147 PlanetsSearch func(childComplexity int, search string, first *int, after *string) int 148 } 149 150 Specie struct { 151 Id func(childComplexity int) int 152 Name func(childComplexity int) int 153 Classification func(childComplexity int) int 154 Designation func(childComplexity int) int 155 AverageHeight func(childComplexity int) int 156 AverageLifespan func(childComplexity int) int 157 EyeColors func(childComplexity int) int 158 HairColors func(childComplexity int) int 159 SkinColors func(childComplexity int) int 160 Language func(childComplexity int) int 161 Homeworld func(childComplexity int) int 162 Vehicle func(childComplexity int) int 163 Films func(childComplexity int) int 164 People func(childComplexity int) int 165 } 166 167 SpecieConnection struct { 168 PageInfo func(childComplexity int) int 169 Edges func(childComplexity int) int 170 TotalCount func(childComplexity int) int 171 } 172 173 SpecieEdge struct { 174 Node func(childComplexity int) int 175 Cursor func(childComplexity int) int 176 } 177 178 Starship struct { 179 Id func(childComplexity int) int 180 Name func(childComplexity int) int 181 Model func(childComplexity int) int 182 StarshipClass func(childComplexity int) int 183 Manufacturer func(childComplexity int) int 184 CostInCredits func(childComplexity int) int 185 Length func(childComplexity int) int 186 Crew func(childComplexity int) int 187 Passengers func(childComplexity int) int 188 MaxAtmospheringSpeed func(childComplexity int) int 189 HyperdriveRating func(childComplexity int) int 190 Mglt func(childComplexity int) int 191 CargoCapacity func(childComplexity int) int 192 Consumables func(childComplexity int) int 193 Films func(childComplexity int) int 194 Pilots func(childComplexity int) int 195 } 196 197 StarshipConnection struct { 198 PageInfo func(childComplexity int) int 199 Edges func(childComplexity int) int 200 TotalCount func(childComplexity int) int 201 } 202 203 StarshipEdge struct { 204 Node func(childComplexity int) int 205 Cursor func(childComplexity int) int 206 } 207 208 Vehicle struct { 209 Id func(childComplexity int) int 210 Name func(childComplexity int) int 211 Model func(childComplexity int) int 212 VehicleClass func(childComplexity int) int 213 Manufacturer func(childComplexity int) int 214 Length func(childComplexity int) int 215 CostInCredits func(childComplexity int) int 216 Crew func(childComplexity int) int 217 Passengers func(childComplexity int) int 218 MaxAtmospheringSpeed func(childComplexity int) int 219 CargoCapacity func(childComplexity int) int 220 Consumables func(childComplexity int) int 221 Films func(childComplexity int) int 222 Pilots func(childComplexity int) int 223 } 224 225 VehicleConnection struct { 226 PageInfo func(childComplexity int) int 227 Edges func(childComplexity int) int 228 TotalCount func(childComplexity int) int 229 } 230 231 VehicleEdge struct { 232 Node func(childComplexity int) int 233 Cursor func(childComplexity int) int 234 } 235 } 236 237 type QueryResolver interface { 238 People(ctx context.Context, id string) (*model.People, error) 239 Film(ctx context.Context, id string) (*model.Film, error) 240 Starship(ctx context.Context, id string) (*model.Starship, error) 241 Vehicle(ctx context.Context, id string) (*model.Vehicle, error) 242 Specie(ctx context.Context, id string) (*model.Specie, error) 243 Planet(ctx context.Context, id string) (*model.Planet, error) 244 Peoples(ctx context.Context, first *int, after *string) (model.PeopleConnection, error) 245 Films(ctx context.Context, first *int, after *string) (model.FilmConnection, error) 246 Starships(ctx context.Context, first *int, after *string) (model.StarshipConnection, error) 247 Vehicles(ctx context.Context, first *int, after *string) (model.VehicleConnection, error) 248 Species(ctx context.Context, first *int, after *string) (model.SpecieConnection, error) 249 Planets(ctx context.Context, first *int, after *string) (model.PlanetConnection, error) 250 PeopleSearch(ctx context.Context, search string, first *int, after *string) (*model.PeopleConnection, error) 251 FilmsSearch(ctx context.Context, search string, first *int, after *string) (*model.FilmConnection, error) 252 StarshipsSearch(ctx context.Context, search string, first *int, after *string) (*model.StarshipConnection, error) 253 VehiclesSearch(ctx context.Context, search string, first *int, after *string) (*model.VehicleConnection, error) 254 SpeciesSearch(ctx context.Context, search string, first *int, after *string) (*model.SpecieConnection, error) 255 PlanetsSearch(ctx context.Context, search string, first *int, after *string) (*model.PlanetConnection, error) 256 } 257 258 func field_Query_people_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 259 args := map[string]interface{}{} 260 var arg0 string 261 if tmp, ok := rawArgs["id"]; ok { 262 var err error 263 arg0, err = graphql.UnmarshalID(tmp) 264 if err != nil { 265 return nil, err 266 } 267 } 268 args["id"] = arg0 269 return args, nil 270 271 } 272 273 func field_Query_film_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 274 args := map[string]interface{}{} 275 var arg0 string 276 if tmp, ok := rawArgs["id"]; ok { 277 var err error 278 arg0, err = graphql.UnmarshalID(tmp) 279 if err != nil { 280 return nil, err 281 } 282 } 283 args["id"] = arg0 284 return args, nil 285 286 } 287 288 func field_Query_starship_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 289 args := map[string]interface{}{} 290 var arg0 string 291 if tmp, ok := rawArgs["id"]; ok { 292 var err error 293 arg0, err = graphql.UnmarshalID(tmp) 294 if err != nil { 295 return nil, err 296 } 297 } 298 args["id"] = arg0 299 return args, nil 300 301 } 302 303 func field_Query_vehicle_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 304 args := map[string]interface{}{} 305 var arg0 string 306 if tmp, ok := rawArgs["id"]; ok { 307 var err error 308 arg0, err = graphql.UnmarshalID(tmp) 309 if err != nil { 310 return nil, err 311 } 312 } 313 args["id"] = arg0 314 return args, nil 315 316 } 317 318 func field_Query_specie_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 319 args := map[string]interface{}{} 320 var arg0 string 321 if tmp, ok := rawArgs["id"]; ok { 322 var err error 323 arg0, err = graphql.UnmarshalID(tmp) 324 if err != nil { 325 return nil, err 326 } 327 } 328 args["id"] = arg0 329 return args, nil 330 331 } 332 333 func field_Query_planet_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 334 args := map[string]interface{}{} 335 var arg0 string 336 if tmp, ok := rawArgs["id"]; ok { 337 var err error 338 arg0, err = graphql.UnmarshalID(tmp) 339 if err != nil { 340 return nil, err 341 } 342 } 343 args["id"] = arg0 344 return args, nil 345 346 } 347 348 func field_Query_peoples_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 349 args := map[string]interface{}{} 350 var arg0 *int 351 if tmp, ok := rawArgs["first"]; ok { 352 var err error 353 var ptr1 int 354 if tmp != nil { 355 ptr1, err = graphql.UnmarshalInt(tmp) 356 arg0 = &ptr1 357 } 358 359 if err != nil { 360 return nil, err 361 } 362 } 363 args["first"] = arg0 364 var arg1 *string 365 if tmp, ok := rawArgs["after"]; ok { 366 var err error 367 var ptr1 string 368 if tmp != nil { 369 ptr1, err = graphql.UnmarshalID(tmp) 370 arg1 = &ptr1 371 } 372 373 if err != nil { 374 return nil, err 375 } 376 } 377 args["after"] = arg1 378 return args, nil 379 380 } 381 382 func field_Query_films_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 383 args := map[string]interface{}{} 384 var arg0 *int 385 if tmp, ok := rawArgs["first"]; ok { 386 var err error 387 var ptr1 int 388 if tmp != nil { 389 ptr1, err = graphql.UnmarshalInt(tmp) 390 arg0 = &ptr1 391 } 392 393 if err != nil { 394 return nil, err 395 } 396 } 397 args["first"] = arg0 398 var arg1 *string 399 if tmp, ok := rawArgs["after"]; ok { 400 var err error 401 var ptr1 string 402 if tmp != nil { 403 ptr1, err = graphql.UnmarshalID(tmp) 404 arg1 = &ptr1 405 } 406 407 if err != nil { 408 return nil, err 409 } 410 } 411 args["after"] = arg1 412 return args, nil 413 414 } 415 416 func field_Query_starships_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 417 args := map[string]interface{}{} 418 var arg0 *int 419 if tmp, ok := rawArgs["first"]; ok { 420 var err error 421 var ptr1 int 422 if tmp != nil { 423 ptr1, err = graphql.UnmarshalInt(tmp) 424 arg0 = &ptr1 425 } 426 427 if err != nil { 428 return nil, err 429 } 430 } 431 args["first"] = arg0 432 var arg1 *string 433 if tmp, ok := rawArgs["after"]; ok { 434 var err error 435 var ptr1 string 436 if tmp != nil { 437 ptr1, err = graphql.UnmarshalID(tmp) 438 arg1 = &ptr1 439 } 440 441 if err != nil { 442 return nil, err 443 } 444 } 445 args["after"] = arg1 446 return args, nil 447 448 } 449 450 func field_Query_vehicles_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 451 args := map[string]interface{}{} 452 var arg0 *int 453 if tmp, ok := rawArgs["first"]; ok { 454 var err error 455 var ptr1 int 456 if tmp != nil { 457 ptr1, err = graphql.UnmarshalInt(tmp) 458 arg0 = &ptr1 459 } 460 461 if err != nil { 462 return nil, err 463 } 464 } 465 args["first"] = arg0 466 var arg1 *string 467 if tmp, ok := rawArgs["after"]; ok { 468 var err error 469 var ptr1 string 470 if tmp != nil { 471 ptr1, err = graphql.UnmarshalID(tmp) 472 arg1 = &ptr1 473 } 474 475 if err != nil { 476 return nil, err 477 } 478 } 479 args["after"] = arg1 480 return args, nil 481 482 } 483 484 func field_Query_species_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 485 args := map[string]interface{}{} 486 var arg0 *int 487 if tmp, ok := rawArgs["first"]; ok { 488 var err error 489 var ptr1 int 490 if tmp != nil { 491 ptr1, err = graphql.UnmarshalInt(tmp) 492 arg0 = &ptr1 493 } 494 495 if err != nil { 496 return nil, err 497 } 498 } 499 args["first"] = arg0 500 var arg1 *string 501 if tmp, ok := rawArgs["after"]; ok { 502 var err error 503 var ptr1 string 504 if tmp != nil { 505 ptr1, err = graphql.UnmarshalID(tmp) 506 arg1 = &ptr1 507 } 508 509 if err != nil { 510 return nil, err 511 } 512 } 513 args["after"] = arg1 514 return args, nil 515 516 } 517 518 func field_Query_planets_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 519 args := map[string]interface{}{} 520 var arg0 *int 521 if tmp, ok := rawArgs["first"]; ok { 522 var err error 523 var ptr1 int 524 if tmp != nil { 525 ptr1, err = graphql.UnmarshalInt(tmp) 526 arg0 = &ptr1 527 } 528 529 if err != nil { 530 return nil, err 531 } 532 } 533 args["first"] = arg0 534 var arg1 *string 535 if tmp, ok := rawArgs["after"]; ok { 536 var err error 537 var ptr1 string 538 if tmp != nil { 539 ptr1, err = graphql.UnmarshalID(tmp) 540 arg1 = &ptr1 541 } 542 543 if err != nil { 544 return nil, err 545 } 546 } 547 args["after"] = arg1 548 return args, nil 549 550 } 551 552 func field_Query_peopleSearch_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 553 args := map[string]interface{}{} 554 var arg0 string 555 if tmp, ok := rawArgs["search"]; ok { 556 var err error 557 arg0, err = graphql.UnmarshalString(tmp) 558 if err != nil { 559 return nil, err 560 } 561 } 562 args["search"] = arg0 563 var arg1 *int 564 if tmp, ok := rawArgs["first"]; ok { 565 var err error 566 var ptr1 int 567 if tmp != nil { 568 ptr1, err = graphql.UnmarshalInt(tmp) 569 arg1 = &ptr1 570 } 571 572 if err != nil { 573 return nil, err 574 } 575 } 576 args["first"] = arg1 577 var arg2 *string 578 if tmp, ok := rawArgs["after"]; ok { 579 var err error 580 var ptr1 string 581 if tmp != nil { 582 ptr1, err = graphql.UnmarshalID(tmp) 583 arg2 = &ptr1 584 } 585 586 if err != nil { 587 return nil, err 588 } 589 } 590 args["after"] = arg2 591 return args, nil 592 593 } 594 595 func field_Query_filmsSearch_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 596 args := map[string]interface{}{} 597 var arg0 string 598 if tmp, ok := rawArgs["search"]; ok { 599 var err error 600 arg0, err = graphql.UnmarshalString(tmp) 601 if err != nil { 602 return nil, err 603 } 604 } 605 args["search"] = arg0 606 var arg1 *int 607 if tmp, ok := rawArgs["first"]; ok { 608 var err error 609 var ptr1 int 610 if tmp != nil { 611 ptr1, err = graphql.UnmarshalInt(tmp) 612 arg1 = &ptr1 613 } 614 615 if err != nil { 616 return nil, err 617 } 618 } 619 args["first"] = arg1 620 var arg2 *string 621 if tmp, ok := rawArgs["after"]; ok { 622 var err error 623 var ptr1 string 624 if tmp != nil { 625 ptr1, err = graphql.UnmarshalID(tmp) 626 arg2 = &ptr1 627 } 628 629 if err != nil { 630 return nil, err 631 } 632 } 633 args["after"] = arg2 634 return args, nil 635 636 } 637 638 func field_Query_starshipsSearch_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 639 args := map[string]interface{}{} 640 var arg0 string 641 if tmp, ok := rawArgs["search"]; ok { 642 var err error 643 arg0, err = graphql.UnmarshalString(tmp) 644 if err != nil { 645 return nil, err 646 } 647 } 648 args["search"] = arg0 649 var arg1 *int 650 if tmp, ok := rawArgs["first"]; ok { 651 var err error 652 var ptr1 int 653 if tmp != nil { 654 ptr1, err = graphql.UnmarshalInt(tmp) 655 arg1 = &ptr1 656 } 657 658 if err != nil { 659 return nil, err 660 } 661 } 662 args["first"] = arg1 663 var arg2 *string 664 if tmp, ok := rawArgs["after"]; ok { 665 var err error 666 var ptr1 string 667 if tmp != nil { 668 ptr1, err = graphql.UnmarshalID(tmp) 669 arg2 = &ptr1 670 } 671 672 if err != nil { 673 return nil, err 674 } 675 } 676 args["after"] = arg2 677 return args, nil 678 679 } 680 681 func field_Query_vehiclesSearch_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 682 args := map[string]interface{}{} 683 var arg0 string 684 if tmp, ok := rawArgs["search"]; ok { 685 var err error 686 arg0, err = graphql.UnmarshalString(tmp) 687 if err != nil { 688 return nil, err 689 } 690 } 691 args["search"] = arg0 692 var arg1 *int 693 if tmp, ok := rawArgs["first"]; ok { 694 var err error 695 var ptr1 int 696 if tmp != nil { 697 ptr1, err = graphql.UnmarshalInt(tmp) 698 arg1 = &ptr1 699 } 700 701 if err != nil { 702 return nil, err 703 } 704 } 705 args["first"] = arg1 706 var arg2 *string 707 if tmp, ok := rawArgs["after"]; ok { 708 var err error 709 var ptr1 string 710 if tmp != nil { 711 ptr1, err = graphql.UnmarshalID(tmp) 712 arg2 = &ptr1 713 } 714 715 if err != nil { 716 return nil, err 717 } 718 } 719 args["after"] = arg2 720 return args, nil 721 722 } 723 724 func field_Query_speciesSearch_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 725 args := map[string]interface{}{} 726 var arg0 string 727 if tmp, ok := rawArgs["search"]; ok { 728 var err error 729 arg0, err = graphql.UnmarshalString(tmp) 730 if err != nil { 731 return nil, err 732 } 733 } 734 args["search"] = arg0 735 var arg1 *int 736 if tmp, ok := rawArgs["first"]; ok { 737 var err error 738 var ptr1 int 739 if tmp != nil { 740 ptr1, err = graphql.UnmarshalInt(tmp) 741 arg1 = &ptr1 742 } 743 744 if err != nil { 745 return nil, err 746 } 747 } 748 args["first"] = arg1 749 var arg2 *string 750 if tmp, ok := rawArgs["after"]; ok { 751 var err error 752 var ptr1 string 753 if tmp != nil { 754 ptr1, err = graphql.UnmarshalID(tmp) 755 arg2 = &ptr1 756 } 757 758 if err != nil { 759 return nil, err 760 } 761 } 762 args["after"] = arg2 763 return args, nil 764 765 } 766 767 func field_Query_planetsSearch_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 768 args := map[string]interface{}{} 769 var arg0 string 770 if tmp, ok := rawArgs["search"]; ok { 771 var err error 772 arg0, err = graphql.UnmarshalString(tmp) 773 if err != nil { 774 return nil, err 775 } 776 } 777 args["search"] = arg0 778 var arg1 *int 779 if tmp, ok := rawArgs["first"]; ok { 780 var err error 781 var ptr1 int 782 if tmp != nil { 783 ptr1, err = graphql.UnmarshalInt(tmp) 784 arg1 = &ptr1 785 } 786 787 if err != nil { 788 return nil, err 789 } 790 } 791 args["first"] = arg1 792 var arg2 *string 793 if tmp, ok := rawArgs["after"]; ok { 794 var err error 795 var ptr1 string 796 if tmp != nil { 797 ptr1, err = graphql.UnmarshalID(tmp) 798 arg2 = &ptr1 799 } 800 801 if err != nil { 802 return nil, err 803 } 804 } 805 args["after"] = arg2 806 return args, nil 807 808 } 809 810 func field_Query___type_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 811 args := map[string]interface{}{} 812 var arg0 string 813 if tmp, ok := rawArgs["name"]; ok { 814 var err error 815 arg0, err = graphql.UnmarshalString(tmp) 816 if err != nil { 817 return nil, err 818 } 819 } 820 args["name"] = arg0 821 return args, nil 822 823 } 824 825 func field___Type_fields_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 826 args := map[string]interface{}{} 827 var arg0 bool 828 if tmp, ok := rawArgs["includeDeprecated"]; ok { 829 var err error 830 arg0, err = graphql.UnmarshalBoolean(tmp) 831 if err != nil { 832 return nil, err 833 } 834 } 835 args["includeDeprecated"] = arg0 836 return args, nil 837 838 } 839 840 func field___Type_enumValues_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 841 args := map[string]interface{}{} 842 var arg0 bool 843 if tmp, ok := rawArgs["includeDeprecated"]; ok { 844 var err error 845 arg0, err = graphql.UnmarshalBoolean(tmp) 846 if err != nil { 847 return nil, err 848 } 849 } 850 args["includeDeprecated"] = arg0 851 return args, nil 852 853 } 854 855 type executableSchema struct { 856 resolvers ResolverRoot 857 directives DirectiveRoot 858 complexity ComplexityRoot 859 } 860 861 func (e *executableSchema) Schema() *ast.Schema { 862 return parsedSchema 863 } 864 865 func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { 866 switch typeName + "." + field { 867 868 case "Film.id": 869 if e.complexity.Film.Id == nil { 870 break 871 } 872 873 return e.complexity.Film.Id(childComplexity), true 874 875 case "Film.title": 876 if e.complexity.Film.Title == nil { 877 break 878 } 879 880 return e.complexity.Film.Title(childComplexity), true 881 882 case "Film.episode_id": 883 if e.complexity.Film.EpisodeId == nil { 884 break 885 } 886 887 return e.complexity.Film.EpisodeId(childComplexity), true 888 889 case "Film.opening_crawl": 890 if e.complexity.Film.OpeningCrawl == nil { 891 break 892 } 893 894 return e.complexity.Film.OpeningCrawl(childComplexity), true 895 896 case "Film.director": 897 if e.complexity.Film.Director == nil { 898 break 899 } 900 901 return e.complexity.Film.Director(childComplexity), true 902 903 case "Film.producer": 904 if e.complexity.Film.Producer == nil { 905 break 906 } 907 908 return e.complexity.Film.Producer(childComplexity), true 909 910 case "Film.release_date": 911 if e.complexity.Film.ReleaseDate == nil { 912 break 913 } 914 915 return e.complexity.Film.ReleaseDate(childComplexity), true 916 917 case "Film.species": 918 if e.complexity.Film.Species == nil { 919 break 920 } 921 922 return e.complexity.Film.Species(childComplexity), true 923 924 case "Film.starships": 925 if e.complexity.Film.Starships == nil { 926 break 927 } 928 929 return e.complexity.Film.Starships(childComplexity), true 930 931 case "Film.vehicles": 932 if e.complexity.Film.Vehicles == nil { 933 break 934 } 935 936 return e.complexity.Film.Vehicles(childComplexity), true 937 938 case "Film.characters": 939 if e.complexity.Film.Characters == nil { 940 break 941 } 942 943 return e.complexity.Film.Characters(childComplexity), true 944 945 case "Film.planets": 946 if e.complexity.Film.Planets == nil { 947 break 948 } 949 950 return e.complexity.Film.Planets(childComplexity), true 951 952 case "FilmConnection.pageInfo": 953 if e.complexity.FilmConnection.PageInfo == nil { 954 break 955 } 956 957 return e.complexity.FilmConnection.PageInfo(childComplexity), true 958 959 case "FilmConnection.edges": 960 if e.complexity.FilmConnection.Edges == nil { 961 break 962 } 963 964 return e.complexity.FilmConnection.Edges(childComplexity), true 965 966 case "FilmConnection.totalCount": 967 if e.complexity.FilmConnection.TotalCount == nil { 968 break 969 } 970 971 return e.complexity.FilmConnection.TotalCount(childComplexity), true 972 973 case "FilmEdge.node": 974 if e.complexity.FilmEdge.Node == nil { 975 break 976 } 977 978 return e.complexity.FilmEdge.Node(childComplexity), true 979 980 case "FilmEdge.cursor": 981 if e.complexity.FilmEdge.Cursor == nil { 982 break 983 } 984 985 return e.complexity.FilmEdge.Cursor(childComplexity), true 986 987 case "PageInfo.hasNextPage": 988 if e.complexity.PageInfo.HasNextPage == nil { 989 break 990 } 991 992 return e.complexity.PageInfo.HasNextPage(childComplexity), true 993 994 case "PageInfo.hasPreviousPage": 995 if e.complexity.PageInfo.HasPreviousPage == nil { 996 break 997 } 998 999 return e.complexity.PageInfo.HasPreviousPage(childComplexity), true 1000 1001 case "PageInfo.startCursor": 1002 if e.complexity.PageInfo.StartCursor == nil { 1003 break 1004 } 1005 1006 return e.complexity.PageInfo.StartCursor(childComplexity), true 1007 1008 case "PageInfo.endCursor": 1009 if e.complexity.PageInfo.EndCursor == nil { 1010 break 1011 } 1012 1013 return e.complexity.PageInfo.EndCursor(childComplexity), true 1014 1015 case "People.id": 1016 if e.complexity.People.Id == nil { 1017 break 1018 } 1019 1020 return e.complexity.People.Id(childComplexity), true 1021 1022 case "People.name": 1023 if e.complexity.People.Name == nil { 1024 break 1025 } 1026 1027 return e.complexity.People.Name(childComplexity), true 1028 1029 case "People.birth_year": 1030 if e.complexity.People.BirthYear == nil { 1031 break 1032 } 1033 1034 return e.complexity.People.BirthYear(childComplexity), true 1035 1036 case "People.eye_color": 1037 if e.complexity.People.EyeColor == nil { 1038 break 1039 } 1040 1041 return e.complexity.People.EyeColor(childComplexity), true 1042 1043 case "People.gender": 1044 if e.complexity.People.Gender == nil { 1045 break 1046 } 1047 1048 return e.complexity.People.Gender(childComplexity), true 1049 1050 case "People.hair_color": 1051 if e.complexity.People.HairColor == nil { 1052 break 1053 } 1054 1055 return e.complexity.People.HairColor(childComplexity), true 1056 1057 case "People.height": 1058 if e.complexity.People.Height == nil { 1059 break 1060 } 1061 1062 return e.complexity.People.Height(childComplexity), true 1063 1064 case "People.mass": 1065 if e.complexity.People.Mass == nil { 1066 break 1067 } 1068 1069 return e.complexity.People.Mass(childComplexity), true 1070 1071 case "People.skin_color": 1072 if e.complexity.People.SkinColor == nil { 1073 break 1074 } 1075 1076 return e.complexity.People.SkinColor(childComplexity), true 1077 1078 case "People.homeworld": 1079 if e.complexity.People.Homeworld == nil { 1080 break 1081 } 1082 1083 return e.complexity.People.Homeworld(childComplexity), true 1084 1085 case "People.films": 1086 if e.complexity.People.Films == nil { 1087 break 1088 } 1089 1090 return e.complexity.People.Films(childComplexity), true 1091 1092 case "People.species": 1093 if e.complexity.People.Species == nil { 1094 break 1095 } 1096 1097 return e.complexity.People.Species(childComplexity), true 1098 1099 case "People.starships": 1100 if e.complexity.People.Starships == nil { 1101 break 1102 } 1103 1104 return e.complexity.People.Starships(childComplexity), true 1105 1106 case "People.vehicles": 1107 if e.complexity.People.Vehicles == nil { 1108 break 1109 } 1110 1111 return e.complexity.People.Vehicles(childComplexity), true 1112 1113 case "PeopleConnection.pageInfo": 1114 if e.complexity.PeopleConnection.PageInfo == nil { 1115 break 1116 } 1117 1118 return e.complexity.PeopleConnection.PageInfo(childComplexity), true 1119 1120 case "PeopleConnection.edges": 1121 if e.complexity.PeopleConnection.Edges == nil { 1122 break 1123 } 1124 1125 return e.complexity.PeopleConnection.Edges(childComplexity), true 1126 1127 case "PeopleConnection.totalCount": 1128 if e.complexity.PeopleConnection.TotalCount == nil { 1129 break 1130 } 1131 1132 return e.complexity.PeopleConnection.TotalCount(childComplexity), true 1133 1134 case "PeopleEdge.node": 1135 if e.complexity.PeopleEdge.Node == nil { 1136 break 1137 } 1138 1139 return e.complexity.PeopleEdge.Node(childComplexity), true 1140 1141 case "PeopleEdge.cursor": 1142 if e.complexity.PeopleEdge.Cursor == nil { 1143 break 1144 } 1145 1146 return e.complexity.PeopleEdge.Cursor(childComplexity), true 1147 1148 case "Planet.id": 1149 if e.complexity.Planet.Id == nil { 1150 break 1151 } 1152 1153 return e.complexity.Planet.Id(childComplexity), true 1154 1155 case "Planet.name": 1156 if e.complexity.Planet.Name == nil { 1157 break 1158 } 1159 1160 return e.complexity.Planet.Name(childComplexity), true 1161 1162 case "Planet.diameter": 1163 if e.complexity.Planet.Diameter == nil { 1164 break 1165 } 1166 1167 return e.complexity.Planet.Diameter(childComplexity), true 1168 1169 case "Planet.rotation_period": 1170 if e.complexity.Planet.RotationPeriod == nil { 1171 break 1172 } 1173 1174 return e.complexity.Planet.RotationPeriod(childComplexity), true 1175 1176 case "Planet.orbital_period": 1177 if e.complexity.Planet.OrbitalPeriod == nil { 1178 break 1179 } 1180 1181 return e.complexity.Planet.OrbitalPeriod(childComplexity), true 1182 1183 case "Planet.gravity": 1184 if e.complexity.Planet.Gravity == nil { 1185 break 1186 } 1187 1188 return e.complexity.Planet.Gravity(childComplexity), true 1189 1190 case "Planet.population": 1191 if e.complexity.Planet.Population == nil { 1192 break 1193 } 1194 1195 return e.complexity.Planet.Population(childComplexity), true 1196 1197 case "Planet.climate": 1198 if e.complexity.Planet.Climate == nil { 1199 break 1200 } 1201 1202 return e.complexity.Planet.Climate(childComplexity), true 1203 1204 case "Planet.terrain": 1205 if e.complexity.Planet.Terrain == nil { 1206 break 1207 } 1208 1209 return e.complexity.Planet.Terrain(childComplexity), true 1210 1211 case "Planet.surface_water": 1212 if e.complexity.Planet.SurfaceWater == nil { 1213 break 1214 } 1215 1216 return e.complexity.Planet.SurfaceWater(childComplexity), true 1217 1218 case "Planet.residents": 1219 if e.complexity.Planet.Residents == nil { 1220 break 1221 } 1222 1223 return e.complexity.Planet.Residents(childComplexity), true 1224 1225 case "Planet.films": 1226 if e.complexity.Planet.Films == nil { 1227 break 1228 } 1229 1230 return e.complexity.Planet.Films(childComplexity), true 1231 1232 case "PlanetConnection.pageInfo": 1233 if e.complexity.PlanetConnection.PageInfo == nil { 1234 break 1235 } 1236 1237 return e.complexity.PlanetConnection.PageInfo(childComplexity), true 1238 1239 case "PlanetConnection.edges": 1240 if e.complexity.PlanetConnection.Edges == nil { 1241 break 1242 } 1243 1244 return e.complexity.PlanetConnection.Edges(childComplexity), true 1245 1246 case "PlanetConnection.totalCount": 1247 if e.complexity.PlanetConnection.TotalCount == nil { 1248 break 1249 } 1250 1251 return e.complexity.PlanetConnection.TotalCount(childComplexity), true 1252 1253 case "PlanetEdge.node": 1254 if e.complexity.PlanetEdge.Node == nil { 1255 break 1256 } 1257 1258 return e.complexity.PlanetEdge.Node(childComplexity), true 1259 1260 case "PlanetEdge.cursor": 1261 if e.complexity.PlanetEdge.Cursor == nil { 1262 break 1263 } 1264 1265 return e.complexity.PlanetEdge.Cursor(childComplexity), true 1266 1267 case "Query.people": 1268 if e.complexity.Query.People == nil { 1269 break 1270 } 1271 1272 args, err := field_Query_people_args(rawArgs) 1273 if err != nil { 1274 return 0, false 1275 } 1276 1277 return e.complexity.Query.People(childComplexity, args["id"].(string)), true 1278 1279 case "Query.film": 1280 if e.complexity.Query.Film == nil { 1281 break 1282 } 1283 1284 args, err := field_Query_film_args(rawArgs) 1285 if err != nil { 1286 return 0, false 1287 } 1288 1289 return e.complexity.Query.Film(childComplexity, args["id"].(string)), true 1290 1291 case "Query.starship": 1292 if e.complexity.Query.Starship == nil { 1293 break 1294 } 1295 1296 args, err := field_Query_starship_args(rawArgs) 1297 if err != nil { 1298 return 0, false 1299 } 1300 1301 return e.complexity.Query.Starship(childComplexity, args["id"].(string)), true 1302 1303 case "Query.vehicle": 1304 if e.complexity.Query.Vehicle == nil { 1305 break 1306 } 1307 1308 args, err := field_Query_vehicle_args(rawArgs) 1309 if err != nil { 1310 return 0, false 1311 } 1312 1313 return e.complexity.Query.Vehicle(childComplexity, args["id"].(string)), true 1314 1315 case "Query.specie": 1316 if e.complexity.Query.Specie == nil { 1317 break 1318 } 1319 1320 args, err := field_Query_specie_args(rawArgs) 1321 if err != nil { 1322 return 0, false 1323 } 1324 1325 return e.complexity.Query.Specie(childComplexity, args["id"].(string)), true 1326 1327 case "Query.planet": 1328 if e.complexity.Query.Planet == nil { 1329 break 1330 } 1331 1332 args, err := field_Query_planet_args(rawArgs) 1333 if err != nil { 1334 return 0, false 1335 } 1336 1337 return e.complexity.Query.Planet(childComplexity, args["id"].(string)), true 1338 1339 case "Query.peoples": 1340 if e.complexity.Query.Peoples == nil { 1341 break 1342 } 1343 1344 args, err := field_Query_peoples_args(rawArgs) 1345 if err != nil { 1346 return 0, false 1347 } 1348 1349 return e.complexity.Query.Peoples(childComplexity, args["first"].(*int), args["after"].(*string)), true 1350 1351 case "Query.films": 1352 if e.complexity.Query.Films == nil { 1353 break 1354 } 1355 1356 args, err := field_Query_films_args(rawArgs) 1357 if err != nil { 1358 return 0, false 1359 } 1360 1361 return e.complexity.Query.Films(childComplexity, args["first"].(*int), args["after"].(*string)), true 1362 1363 case "Query.starships": 1364 if e.complexity.Query.Starships == nil { 1365 break 1366 } 1367 1368 args, err := field_Query_starships_args(rawArgs) 1369 if err != nil { 1370 return 0, false 1371 } 1372 1373 return e.complexity.Query.Starships(childComplexity, args["first"].(*int), args["after"].(*string)), true 1374 1375 case "Query.vehicles": 1376 if e.complexity.Query.Vehicles == nil { 1377 break 1378 } 1379 1380 args, err := field_Query_vehicles_args(rawArgs) 1381 if err != nil { 1382 return 0, false 1383 } 1384 1385 return e.complexity.Query.Vehicles(childComplexity, args["first"].(*int), args["after"].(*string)), true 1386 1387 case "Query.species": 1388 if e.complexity.Query.Species == nil { 1389 break 1390 } 1391 1392 args, err := field_Query_species_args(rawArgs) 1393 if err != nil { 1394 return 0, false 1395 } 1396 1397 return e.complexity.Query.Species(childComplexity, args["first"].(*int), args["after"].(*string)), true 1398 1399 case "Query.planets": 1400 if e.complexity.Query.Planets == nil { 1401 break 1402 } 1403 1404 args, err := field_Query_planets_args(rawArgs) 1405 if err != nil { 1406 return 0, false 1407 } 1408 1409 return e.complexity.Query.Planets(childComplexity, args["first"].(*int), args["after"].(*string)), true 1410 1411 case "Query.peopleSearch": 1412 if e.complexity.Query.PeopleSearch == nil { 1413 break 1414 } 1415 1416 args, err := field_Query_peopleSearch_args(rawArgs) 1417 if err != nil { 1418 return 0, false 1419 } 1420 1421 return e.complexity.Query.PeopleSearch(childComplexity, args["search"].(string), args["first"].(*int), args["after"].(*string)), true 1422 1423 case "Query.filmsSearch": 1424 if e.complexity.Query.FilmsSearch == nil { 1425 break 1426 } 1427 1428 args, err := field_Query_filmsSearch_args(rawArgs) 1429 if err != nil { 1430 return 0, false 1431 } 1432 1433 return e.complexity.Query.FilmsSearch(childComplexity, args["search"].(string), args["first"].(*int), args["after"].(*string)), true 1434 1435 case "Query.starshipsSearch": 1436 if e.complexity.Query.StarshipsSearch == nil { 1437 break 1438 } 1439 1440 args, err := field_Query_starshipsSearch_args(rawArgs) 1441 if err != nil { 1442 return 0, false 1443 } 1444 1445 return e.complexity.Query.StarshipsSearch(childComplexity, args["search"].(string), args["first"].(*int), args["after"].(*string)), true 1446 1447 case "Query.vehiclesSearch": 1448 if e.complexity.Query.VehiclesSearch == nil { 1449 break 1450 } 1451 1452 args, err := field_Query_vehiclesSearch_args(rawArgs) 1453 if err != nil { 1454 return 0, false 1455 } 1456 1457 return e.complexity.Query.VehiclesSearch(childComplexity, args["search"].(string), args["first"].(*int), args["after"].(*string)), true 1458 1459 case "Query.speciesSearch": 1460 if e.complexity.Query.SpeciesSearch == nil { 1461 break 1462 } 1463 1464 args, err := field_Query_speciesSearch_args(rawArgs) 1465 if err != nil { 1466 return 0, false 1467 } 1468 1469 return e.complexity.Query.SpeciesSearch(childComplexity, args["search"].(string), args["first"].(*int), args["after"].(*string)), true 1470 1471 case "Query.planetsSearch": 1472 if e.complexity.Query.PlanetsSearch == nil { 1473 break 1474 } 1475 1476 args, err := field_Query_planetsSearch_args(rawArgs) 1477 if err != nil { 1478 return 0, false 1479 } 1480 1481 return e.complexity.Query.PlanetsSearch(childComplexity, args["search"].(string), args["first"].(*int), args["after"].(*string)), true 1482 1483 case "Specie.id": 1484 if e.complexity.Specie.Id == nil { 1485 break 1486 } 1487 1488 return e.complexity.Specie.Id(childComplexity), true 1489 1490 case "Specie.name": 1491 if e.complexity.Specie.Name == nil { 1492 break 1493 } 1494 1495 return e.complexity.Specie.Name(childComplexity), true 1496 1497 case "Specie.classification": 1498 if e.complexity.Specie.Classification == nil { 1499 break 1500 } 1501 1502 return e.complexity.Specie.Classification(childComplexity), true 1503 1504 case "Specie.designation": 1505 if e.complexity.Specie.Designation == nil { 1506 break 1507 } 1508 1509 return e.complexity.Specie.Designation(childComplexity), true 1510 1511 case "Specie.average_height": 1512 if e.complexity.Specie.AverageHeight == nil { 1513 break 1514 } 1515 1516 return e.complexity.Specie.AverageHeight(childComplexity), true 1517 1518 case "Specie.average_lifespan": 1519 if e.complexity.Specie.AverageLifespan == nil { 1520 break 1521 } 1522 1523 return e.complexity.Specie.AverageLifespan(childComplexity), true 1524 1525 case "Specie.eye_colors": 1526 if e.complexity.Specie.EyeColors == nil { 1527 break 1528 } 1529 1530 return e.complexity.Specie.EyeColors(childComplexity), true 1531 1532 case "Specie.hair_colors": 1533 if e.complexity.Specie.HairColors == nil { 1534 break 1535 } 1536 1537 return e.complexity.Specie.HairColors(childComplexity), true 1538 1539 case "Specie.skin_colors": 1540 if e.complexity.Specie.SkinColors == nil { 1541 break 1542 } 1543 1544 return e.complexity.Specie.SkinColors(childComplexity), true 1545 1546 case "Specie.language": 1547 if e.complexity.Specie.Language == nil { 1548 break 1549 } 1550 1551 return e.complexity.Specie.Language(childComplexity), true 1552 1553 case "Specie.homeworld": 1554 if e.complexity.Specie.Homeworld == nil { 1555 break 1556 } 1557 1558 return e.complexity.Specie.Homeworld(childComplexity), true 1559 1560 case "Specie.Vehicle": 1561 if e.complexity.Specie.Vehicle == nil { 1562 break 1563 } 1564 1565 return e.complexity.Specie.Vehicle(childComplexity), true 1566 1567 case "Specie.films": 1568 if e.complexity.Specie.Films == nil { 1569 break 1570 } 1571 1572 return e.complexity.Specie.Films(childComplexity), true 1573 1574 case "Specie.People": 1575 if e.complexity.Specie.People == nil { 1576 break 1577 } 1578 1579 return e.complexity.Specie.People(childComplexity), true 1580 1581 case "SpecieConnection.pageInfo": 1582 if e.complexity.SpecieConnection.PageInfo == nil { 1583 break 1584 } 1585 1586 return e.complexity.SpecieConnection.PageInfo(childComplexity), true 1587 1588 case "SpecieConnection.edges": 1589 if e.complexity.SpecieConnection.Edges == nil { 1590 break 1591 } 1592 1593 return e.complexity.SpecieConnection.Edges(childComplexity), true 1594 1595 case "SpecieConnection.totalCount": 1596 if e.complexity.SpecieConnection.TotalCount == nil { 1597 break 1598 } 1599 1600 return e.complexity.SpecieConnection.TotalCount(childComplexity), true 1601 1602 case "SpecieEdge.node": 1603 if e.complexity.SpecieEdge.Node == nil { 1604 break 1605 } 1606 1607 return e.complexity.SpecieEdge.Node(childComplexity), true 1608 1609 case "SpecieEdge.cursor": 1610 if e.complexity.SpecieEdge.Cursor == nil { 1611 break 1612 } 1613 1614 return e.complexity.SpecieEdge.Cursor(childComplexity), true 1615 1616 case "Starship.id": 1617 if e.complexity.Starship.Id == nil { 1618 break 1619 } 1620 1621 return e.complexity.Starship.Id(childComplexity), true 1622 1623 case "Starship.name": 1624 if e.complexity.Starship.Name == nil { 1625 break 1626 } 1627 1628 return e.complexity.Starship.Name(childComplexity), true 1629 1630 case "Starship.model": 1631 if e.complexity.Starship.Model == nil { 1632 break 1633 } 1634 1635 return e.complexity.Starship.Model(childComplexity), true 1636 1637 case "Starship.starship_class": 1638 if e.complexity.Starship.StarshipClass == nil { 1639 break 1640 } 1641 1642 return e.complexity.Starship.StarshipClass(childComplexity), true 1643 1644 case "Starship.manufacturer": 1645 if e.complexity.Starship.Manufacturer == nil { 1646 break 1647 } 1648 1649 return e.complexity.Starship.Manufacturer(childComplexity), true 1650 1651 case "Starship.cost_in_credits": 1652 if e.complexity.Starship.CostInCredits == nil { 1653 break 1654 } 1655 1656 return e.complexity.Starship.CostInCredits(childComplexity), true 1657 1658 case "Starship.length": 1659 if e.complexity.Starship.Length == nil { 1660 break 1661 } 1662 1663 return e.complexity.Starship.Length(childComplexity), true 1664 1665 case "Starship.crew": 1666 if e.complexity.Starship.Crew == nil { 1667 break 1668 } 1669 1670 return e.complexity.Starship.Crew(childComplexity), true 1671 1672 case "Starship.passengers": 1673 if e.complexity.Starship.Passengers == nil { 1674 break 1675 } 1676 1677 return e.complexity.Starship.Passengers(childComplexity), true 1678 1679 case "Starship.max_atmosphering_speed": 1680 if e.complexity.Starship.MaxAtmospheringSpeed == nil { 1681 break 1682 } 1683 1684 return e.complexity.Starship.MaxAtmospheringSpeed(childComplexity), true 1685 1686 case "Starship.hyperdrive_rating": 1687 if e.complexity.Starship.HyperdriveRating == nil { 1688 break 1689 } 1690 1691 return e.complexity.Starship.HyperdriveRating(childComplexity), true 1692 1693 case "Starship.MGLT": 1694 if e.complexity.Starship.Mglt == nil { 1695 break 1696 } 1697 1698 return e.complexity.Starship.Mglt(childComplexity), true 1699 1700 case "Starship.cargo_capacity": 1701 if e.complexity.Starship.CargoCapacity == nil { 1702 break 1703 } 1704 1705 return e.complexity.Starship.CargoCapacity(childComplexity), true 1706 1707 case "Starship.consumables": 1708 if e.complexity.Starship.Consumables == nil { 1709 break 1710 } 1711 1712 return e.complexity.Starship.Consumables(childComplexity), true 1713 1714 case "Starship.films": 1715 if e.complexity.Starship.Films == nil { 1716 break 1717 } 1718 1719 return e.complexity.Starship.Films(childComplexity), true 1720 1721 case "Starship.pilots": 1722 if e.complexity.Starship.Pilots == nil { 1723 break 1724 } 1725 1726 return e.complexity.Starship.Pilots(childComplexity), true 1727 1728 case "StarshipConnection.pageInfo": 1729 if e.complexity.StarshipConnection.PageInfo == nil { 1730 break 1731 } 1732 1733 return e.complexity.StarshipConnection.PageInfo(childComplexity), true 1734 1735 case "StarshipConnection.edges": 1736 if e.complexity.StarshipConnection.Edges == nil { 1737 break 1738 } 1739 1740 return e.complexity.StarshipConnection.Edges(childComplexity), true 1741 1742 case "StarshipConnection.totalCount": 1743 if e.complexity.StarshipConnection.TotalCount == nil { 1744 break 1745 } 1746 1747 return e.complexity.StarshipConnection.TotalCount(childComplexity), true 1748 1749 case "StarshipEdge.node": 1750 if e.complexity.StarshipEdge.Node == nil { 1751 break 1752 } 1753 1754 return e.complexity.StarshipEdge.Node(childComplexity), true 1755 1756 case "StarshipEdge.cursor": 1757 if e.complexity.StarshipEdge.Cursor == nil { 1758 break 1759 } 1760 1761 return e.complexity.StarshipEdge.Cursor(childComplexity), true 1762 1763 case "Vehicle.id": 1764 if e.complexity.Vehicle.Id == nil { 1765 break 1766 } 1767 1768 return e.complexity.Vehicle.Id(childComplexity), true 1769 1770 case "Vehicle.name": 1771 if e.complexity.Vehicle.Name == nil { 1772 break 1773 } 1774 1775 return e.complexity.Vehicle.Name(childComplexity), true 1776 1777 case "Vehicle.model": 1778 if e.complexity.Vehicle.Model == nil { 1779 break 1780 } 1781 1782 return e.complexity.Vehicle.Model(childComplexity), true 1783 1784 case "Vehicle.vehicle_class": 1785 if e.complexity.Vehicle.VehicleClass == nil { 1786 break 1787 } 1788 1789 return e.complexity.Vehicle.VehicleClass(childComplexity), true 1790 1791 case "Vehicle.manufacturer": 1792 if e.complexity.Vehicle.Manufacturer == nil { 1793 break 1794 } 1795 1796 return e.complexity.Vehicle.Manufacturer(childComplexity), true 1797 1798 case "Vehicle.length": 1799 if e.complexity.Vehicle.Length == nil { 1800 break 1801 } 1802 1803 return e.complexity.Vehicle.Length(childComplexity), true 1804 1805 case "Vehicle.cost_in_credits": 1806 if e.complexity.Vehicle.CostInCredits == nil { 1807 break 1808 } 1809 1810 return e.complexity.Vehicle.CostInCredits(childComplexity), true 1811 1812 case "Vehicle.crew": 1813 if e.complexity.Vehicle.Crew == nil { 1814 break 1815 } 1816 1817 return e.complexity.Vehicle.Crew(childComplexity), true 1818 1819 case "Vehicle.passengers": 1820 if e.complexity.Vehicle.Passengers == nil { 1821 break 1822 } 1823 1824 return e.complexity.Vehicle.Passengers(childComplexity), true 1825 1826 case "Vehicle.max_atmosphering_speed": 1827 if e.complexity.Vehicle.MaxAtmospheringSpeed == nil { 1828 break 1829 } 1830 1831 return e.complexity.Vehicle.MaxAtmospheringSpeed(childComplexity), true 1832 1833 case "Vehicle.cargo_capacity": 1834 if e.complexity.Vehicle.CargoCapacity == nil { 1835 break 1836 } 1837 1838 return e.complexity.Vehicle.CargoCapacity(childComplexity), true 1839 1840 case "Vehicle.consumables": 1841 if e.complexity.Vehicle.Consumables == nil { 1842 break 1843 } 1844 1845 return e.complexity.Vehicle.Consumables(childComplexity), true 1846 1847 case "Vehicle.films": 1848 if e.complexity.Vehicle.Films == nil { 1849 break 1850 } 1851 1852 return e.complexity.Vehicle.Films(childComplexity), true 1853 1854 case "Vehicle.pilots": 1855 if e.complexity.Vehicle.Pilots == nil { 1856 break 1857 } 1858 1859 return e.complexity.Vehicle.Pilots(childComplexity), true 1860 1861 case "VehicleConnection.pageInfo": 1862 if e.complexity.VehicleConnection.PageInfo == nil { 1863 break 1864 } 1865 1866 return e.complexity.VehicleConnection.PageInfo(childComplexity), true 1867 1868 case "VehicleConnection.edges": 1869 if e.complexity.VehicleConnection.Edges == nil { 1870 break 1871 } 1872 1873 return e.complexity.VehicleConnection.Edges(childComplexity), true 1874 1875 case "VehicleConnection.totalCount": 1876 if e.complexity.VehicleConnection.TotalCount == nil { 1877 break 1878 } 1879 1880 return e.complexity.VehicleConnection.TotalCount(childComplexity), true 1881 1882 case "VehicleEdge.node": 1883 if e.complexity.VehicleEdge.Node == nil { 1884 break 1885 } 1886 1887 return e.complexity.VehicleEdge.Node(childComplexity), true 1888 1889 case "VehicleEdge.cursor": 1890 if e.complexity.VehicleEdge.Cursor == nil { 1891 break 1892 } 1893 1894 return e.complexity.VehicleEdge.Cursor(childComplexity), true 1895 1896 } 1897 return 0, false 1898 } 1899 1900 func (e *executableSchema) Query(ctx context.Context, op *ast.OperationDefinition) *graphql.Response { 1901 ec := executionContext{graphql.GetRequestContext(ctx), e} 1902 1903 buf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte { 1904 data := ec._Query(ctx, op.SelectionSet) 1905 var buf bytes.Buffer 1906 data.MarshalGQL(&buf) 1907 return buf.Bytes() 1908 }) 1909 1910 return &graphql.Response{ 1911 Data: buf, 1912 Errors: ec.Errors, 1913 Extensions: ec.Extensions} 1914 } 1915 1916 func (e *executableSchema) Mutation(ctx context.Context, op *ast.OperationDefinition) *graphql.Response { 1917 return graphql.ErrorResponse(ctx, "mutations are not supported") 1918 } 1919 1920 func (e *executableSchema) Subscription(ctx context.Context, op *ast.OperationDefinition) func() *graphql.Response { 1921 return graphql.OneShot(graphql.ErrorResponse(ctx, "subscriptions are not supported")) 1922 } 1923 1924 type executionContext struct { 1925 *graphql.RequestContext 1926 *executableSchema 1927 } 1928 1929 var filmImplementors = []string{"Film"} 1930 1931 // nolint: gocyclo, errcheck, gas, goconst 1932 func (ec *executionContext) _Film(ctx context.Context, sel ast.SelectionSet, obj *model.Film) graphql.Marshaler { 1933 fields := graphql.CollectFields(ctx, sel, filmImplementors) 1934 1935 out := graphql.NewOrderedMap(len(fields)) 1936 invalid := false 1937 for i, field := range fields { 1938 out.Keys[i] = field.Alias 1939 1940 switch field.Name { 1941 case "__typename": 1942 out.Values[i] = graphql.MarshalString("Film") 1943 case "id": 1944 out.Values[i] = ec._Film_id(ctx, field, obj) 1945 if out.Values[i] == graphql.Null { 1946 invalid = true 1947 } 1948 case "title": 1949 out.Values[i] = ec._Film_title(ctx, field, obj) 1950 if out.Values[i] == graphql.Null { 1951 invalid = true 1952 } 1953 case "episode_id": 1954 out.Values[i] = ec._Film_episode_id(ctx, field, obj) 1955 case "opening_crawl": 1956 out.Values[i] = ec._Film_opening_crawl(ctx, field, obj) 1957 case "director": 1958 out.Values[i] = ec._Film_director(ctx, field, obj) 1959 case "producer": 1960 out.Values[i] = ec._Film_producer(ctx, field, obj) 1961 case "release_date": 1962 out.Values[i] = ec._Film_release_date(ctx, field, obj) 1963 case "species": 1964 out.Values[i] = ec._Film_species(ctx, field, obj) 1965 case "starships": 1966 out.Values[i] = ec._Film_starships(ctx, field, obj) 1967 case "vehicles": 1968 out.Values[i] = ec._Film_vehicles(ctx, field, obj) 1969 case "characters": 1970 out.Values[i] = ec._Film_characters(ctx, field, obj) 1971 case "planets": 1972 out.Values[i] = ec._Film_planets(ctx, field, obj) 1973 default: 1974 panic("unknown field " + strconv.Quote(field.Name)) 1975 } 1976 } 1977 1978 if invalid { 1979 return graphql.Null 1980 } 1981 return out 1982 } 1983 1984 // nolint: vetshadow 1985 func (ec *executionContext) _Film_id(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 1986 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1987 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1988 rctx := &graphql.ResolverContext{ 1989 Object: "Film", 1990 Args: nil, 1991 Field: field, 1992 } 1993 ctx = graphql.WithResolverContext(ctx, rctx) 1994 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1995 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1996 ctx = rctx // use context from middleware stack in children 1997 return obj.ID, nil 1998 }) 1999 if resTmp == nil { 2000 if !ec.HasError(rctx) { 2001 ec.Errorf(ctx, "must not be null") 2002 } 2003 return graphql.Null 2004 } 2005 res := resTmp.(string) 2006 rctx.Result = res 2007 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2008 return graphql.MarshalID(res) 2009 } 2010 2011 // nolint: vetshadow 2012 func (ec *executionContext) _Film_title(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2013 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2014 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2015 rctx := &graphql.ResolverContext{ 2016 Object: "Film", 2017 Args: nil, 2018 Field: field, 2019 } 2020 ctx = graphql.WithResolverContext(ctx, rctx) 2021 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2022 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2023 ctx = rctx // use context from middleware stack in children 2024 return obj.Title, nil 2025 }) 2026 if resTmp == nil { 2027 if !ec.HasError(rctx) { 2028 ec.Errorf(ctx, "must not be null") 2029 } 2030 return graphql.Null 2031 } 2032 res := resTmp.(string) 2033 rctx.Result = res 2034 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2035 return graphql.MarshalString(res) 2036 } 2037 2038 // nolint: vetshadow 2039 func (ec *executionContext) _Film_episode_id(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2040 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2041 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2042 rctx := &graphql.ResolverContext{ 2043 Object: "Film", 2044 Args: nil, 2045 Field: field, 2046 } 2047 ctx = graphql.WithResolverContext(ctx, rctx) 2048 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2049 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2050 ctx = rctx // use context from middleware stack in children 2051 return obj.EpisodeID, nil 2052 }) 2053 if resTmp == nil { 2054 return graphql.Null 2055 } 2056 res := resTmp.(*int) 2057 rctx.Result = res 2058 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2059 2060 if res == nil { 2061 return graphql.Null 2062 } 2063 return graphql.MarshalInt(*res) 2064 } 2065 2066 // nolint: vetshadow 2067 func (ec *executionContext) _Film_opening_crawl(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2068 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2069 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2070 rctx := &graphql.ResolverContext{ 2071 Object: "Film", 2072 Args: nil, 2073 Field: field, 2074 } 2075 ctx = graphql.WithResolverContext(ctx, rctx) 2076 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2077 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2078 ctx = rctx // use context from middleware stack in children 2079 return obj.OpeningCrawl, nil 2080 }) 2081 if resTmp == nil { 2082 return graphql.Null 2083 } 2084 res := resTmp.(*string) 2085 rctx.Result = res 2086 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2087 2088 if res == nil { 2089 return graphql.Null 2090 } 2091 return graphql.MarshalString(*res) 2092 } 2093 2094 // nolint: vetshadow 2095 func (ec *executionContext) _Film_director(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2096 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2097 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2098 rctx := &graphql.ResolverContext{ 2099 Object: "Film", 2100 Args: nil, 2101 Field: field, 2102 } 2103 ctx = graphql.WithResolverContext(ctx, rctx) 2104 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2105 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2106 ctx = rctx // use context from middleware stack in children 2107 return obj.Director, nil 2108 }) 2109 if resTmp == nil { 2110 return graphql.Null 2111 } 2112 res := resTmp.(*string) 2113 rctx.Result = res 2114 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2115 2116 if res == nil { 2117 return graphql.Null 2118 } 2119 return graphql.MarshalString(*res) 2120 } 2121 2122 // nolint: vetshadow 2123 func (ec *executionContext) _Film_producer(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2124 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2125 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2126 rctx := &graphql.ResolverContext{ 2127 Object: "Film", 2128 Args: nil, 2129 Field: field, 2130 } 2131 ctx = graphql.WithResolverContext(ctx, rctx) 2132 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2133 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2134 ctx = rctx // use context from middleware stack in children 2135 return obj.Producer, nil 2136 }) 2137 if resTmp == nil { 2138 return graphql.Null 2139 } 2140 res := resTmp.(*string) 2141 rctx.Result = res 2142 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2143 2144 if res == nil { 2145 return graphql.Null 2146 } 2147 return graphql.MarshalString(*res) 2148 } 2149 2150 // nolint: vetshadow 2151 func (ec *executionContext) _Film_release_date(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2152 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2153 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2154 rctx := &graphql.ResolverContext{ 2155 Object: "Film", 2156 Args: nil, 2157 Field: field, 2158 } 2159 ctx = graphql.WithResolverContext(ctx, rctx) 2160 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2161 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2162 ctx = rctx // use context from middleware stack in children 2163 return obj.ReleaseDate, nil 2164 }) 2165 if resTmp == nil { 2166 return graphql.Null 2167 } 2168 res := resTmp.(*string) 2169 rctx.Result = res 2170 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2171 2172 if res == nil { 2173 return graphql.Null 2174 } 2175 return graphql.MarshalString(*res) 2176 } 2177 2178 // nolint: vetshadow 2179 func (ec *executionContext) _Film_species(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2180 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2181 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2182 rctx := &graphql.ResolverContext{ 2183 Object: "Film", 2184 Args: nil, 2185 Field: field, 2186 } 2187 ctx = graphql.WithResolverContext(ctx, rctx) 2188 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2189 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2190 ctx = rctx // use context from middleware stack in children 2191 return obj.Species, nil 2192 }) 2193 if resTmp == nil { 2194 return graphql.Null 2195 } 2196 res := resTmp.([]*model.Specie) 2197 rctx.Result = res 2198 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2199 2200 arr1 := make(graphql.Array, len(res)) 2201 var wg sync.WaitGroup 2202 2203 isLen1 := len(res) == 1 2204 if !isLen1 { 2205 wg.Add(len(res)) 2206 } 2207 2208 for idx1 := range res { 2209 idx1 := idx1 2210 rctx := &graphql.ResolverContext{ 2211 Index: &idx1, 2212 Result: res[idx1], 2213 } 2214 ctx := graphql.WithResolverContext(ctx, rctx) 2215 f := func(idx1 int) { 2216 if !isLen1 { 2217 defer wg.Done() 2218 } 2219 arr1[idx1] = func() graphql.Marshaler { 2220 2221 if res[idx1] == nil { 2222 return graphql.Null 2223 } 2224 2225 return ec._Specie(ctx, field.Selections, res[idx1]) 2226 }() 2227 } 2228 if isLen1 { 2229 f(idx1) 2230 } else { 2231 go f(idx1) 2232 } 2233 2234 } 2235 wg.Wait() 2236 return arr1 2237 } 2238 2239 // nolint: vetshadow 2240 func (ec *executionContext) _Film_starships(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2241 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2242 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2243 rctx := &graphql.ResolverContext{ 2244 Object: "Film", 2245 Args: nil, 2246 Field: field, 2247 } 2248 ctx = graphql.WithResolverContext(ctx, rctx) 2249 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2250 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2251 ctx = rctx // use context from middleware stack in children 2252 return obj.Starships, nil 2253 }) 2254 if resTmp == nil { 2255 return graphql.Null 2256 } 2257 res := resTmp.([]*model.Starship) 2258 rctx.Result = res 2259 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2260 2261 arr1 := make(graphql.Array, len(res)) 2262 var wg sync.WaitGroup 2263 2264 isLen1 := len(res) == 1 2265 if !isLen1 { 2266 wg.Add(len(res)) 2267 } 2268 2269 for idx1 := range res { 2270 idx1 := idx1 2271 rctx := &graphql.ResolverContext{ 2272 Index: &idx1, 2273 Result: res[idx1], 2274 } 2275 ctx := graphql.WithResolverContext(ctx, rctx) 2276 f := func(idx1 int) { 2277 if !isLen1 { 2278 defer wg.Done() 2279 } 2280 arr1[idx1] = func() graphql.Marshaler { 2281 2282 if res[idx1] == nil { 2283 return graphql.Null 2284 } 2285 2286 return ec._Starship(ctx, field.Selections, res[idx1]) 2287 }() 2288 } 2289 if isLen1 { 2290 f(idx1) 2291 } else { 2292 go f(idx1) 2293 } 2294 2295 } 2296 wg.Wait() 2297 return arr1 2298 } 2299 2300 // nolint: vetshadow 2301 func (ec *executionContext) _Film_vehicles(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2302 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2303 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2304 rctx := &graphql.ResolverContext{ 2305 Object: "Film", 2306 Args: nil, 2307 Field: field, 2308 } 2309 ctx = graphql.WithResolverContext(ctx, rctx) 2310 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2311 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2312 ctx = rctx // use context from middleware stack in children 2313 return obj.Vehicles, nil 2314 }) 2315 if resTmp == nil { 2316 return graphql.Null 2317 } 2318 res := resTmp.([]*model.Vehicle) 2319 rctx.Result = res 2320 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2321 2322 arr1 := make(graphql.Array, len(res)) 2323 var wg sync.WaitGroup 2324 2325 isLen1 := len(res) == 1 2326 if !isLen1 { 2327 wg.Add(len(res)) 2328 } 2329 2330 for idx1 := range res { 2331 idx1 := idx1 2332 rctx := &graphql.ResolverContext{ 2333 Index: &idx1, 2334 Result: res[idx1], 2335 } 2336 ctx := graphql.WithResolverContext(ctx, rctx) 2337 f := func(idx1 int) { 2338 if !isLen1 { 2339 defer wg.Done() 2340 } 2341 arr1[idx1] = func() graphql.Marshaler { 2342 2343 if res[idx1] == nil { 2344 return graphql.Null 2345 } 2346 2347 return ec._Vehicle(ctx, field.Selections, res[idx1]) 2348 }() 2349 } 2350 if isLen1 { 2351 f(idx1) 2352 } else { 2353 go f(idx1) 2354 } 2355 2356 } 2357 wg.Wait() 2358 return arr1 2359 } 2360 2361 // nolint: vetshadow 2362 func (ec *executionContext) _Film_characters(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2363 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2364 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2365 rctx := &graphql.ResolverContext{ 2366 Object: "Film", 2367 Args: nil, 2368 Field: field, 2369 } 2370 ctx = graphql.WithResolverContext(ctx, rctx) 2371 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2372 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2373 ctx = rctx // use context from middleware stack in children 2374 return obj.Characters, nil 2375 }) 2376 if resTmp == nil { 2377 return graphql.Null 2378 } 2379 res := resTmp.([]*model.People) 2380 rctx.Result = res 2381 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2382 2383 arr1 := make(graphql.Array, len(res)) 2384 var wg sync.WaitGroup 2385 2386 isLen1 := len(res) == 1 2387 if !isLen1 { 2388 wg.Add(len(res)) 2389 } 2390 2391 for idx1 := range res { 2392 idx1 := idx1 2393 rctx := &graphql.ResolverContext{ 2394 Index: &idx1, 2395 Result: res[idx1], 2396 } 2397 ctx := graphql.WithResolverContext(ctx, rctx) 2398 f := func(idx1 int) { 2399 if !isLen1 { 2400 defer wg.Done() 2401 } 2402 arr1[idx1] = func() graphql.Marshaler { 2403 2404 if res[idx1] == nil { 2405 return graphql.Null 2406 } 2407 2408 return ec._People(ctx, field.Selections, res[idx1]) 2409 }() 2410 } 2411 if isLen1 { 2412 f(idx1) 2413 } else { 2414 go f(idx1) 2415 } 2416 2417 } 2418 wg.Wait() 2419 return arr1 2420 } 2421 2422 // nolint: vetshadow 2423 func (ec *executionContext) _Film_planets(ctx context.Context, field graphql.CollectedField, obj *model.Film) graphql.Marshaler { 2424 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2425 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2426 rctx := &graphql.ResolverContext{ 2427 Object: "Film", 2428 Args: nil, 2429 Field: field, 2430 } 2431 ctx = graphql.WithResolverContext(ctx, rctx) 2432 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2433 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2434 ctx = rctx // use context from middleware stack in children 2435 return obj.Planets, nil 2436 }) 2437 if resTmp == nil { 2438 return graphql.Null 2439 } 2440 res := resTmp.([]*model.Planet) 2441 rctx.Result = res 2442 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2443 2444 arr1 := make(graphql.Array, len(res)) 2445 var wg sync.WaitGroup 2446 2447 isLen1 := len(res) == 1 2448 if !isLen1 { 2449 wg.Add(len(res)) 2450 } 2451 2452 for idx1 := range res { 2453 idx1 := idx1 2454 rctx := &graphql.ResolverContext{ 2455 Index: &idx1, 2456 Result: res[idx1], 2457 } 2458 ctx := graphql.WithResolverContext(ctx, rctx) 2459 f := func(idx1 int) { 2460 if !isLen1 { 2461 defer wg.Done() 2462 } 2463 arr1[idx1] = func() graphql.Marshaler { 2464 2465 if res[idx1] == nil { 2466 return graphql.Null 2467 } 2468 2469 return ec._Planet(ctx, field.Selections, res[idx1]) 2470 }() 2471 } 2472 if isLen1 { 2473 f(idx1) 2474 } else { 2475 go f(idx1) 2476 } 2477 2478 } 2479 wg.Wait() 2480 return arr1 2481 } 2482 2483 var filmConnectionImplementors = []string{"FilmConnection"} 2484 2485 // nolint: gocyclo, errcheck, gas, goconst 2486 func (ec *executionContext) _FilmConnection(ctx context.Context, sel ast.SelectionSet, obj *model.FilmConnection) graphql.Marshaler { 2487 fields := graphql.CollectFields(ctx, sel, filmConnectionImplementors) 2488 2489 out := graphql.NewOrderedMap(len(fields)) 2490 invalid := false 2491 for i, field := range fields { 2492 out.Keys[i] = field.Alias 2493 2494 switch field.Name { 2495 case "__typename": 2496 out.Values[i] = graphql.MarshalString("FilmConnection") 2497 case "pageInfo": 2498 out.Values[i] = ec._FilmConnection_pageInfo(ctx, field, obj) 2499 if out.Values[i] == graphql.Null { 2500 invalid = true 2501 } 2502 case "edges": 2503 out.Values[i] = ec._FilmConnection_edges(ctx, field, obj) 2504 case "totalCount": 2505 out.Values[i] = ec._FilmConnection_totalCount(ctx, field, obj) 2506 if out.Values[i] == graphql.Null { 2507 invalid = true 2508 } 2509 default: 2510 panic("unknown field " + strconv.Quote(field.Name)) 2511 } 2512 } 2513 2514 if invalid { 2515 return graphql.Null 2516 } 2517 return out 2518 } 2519 2520 // nolint: vetshadow 2521 func (ec *executionContext) _FilmConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.FilmConnection) graphql.Marshaler { 2522 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2523 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2524 rctx := &graphql.ResolverContext{ 2525 Object: "FilmConnection", 2526 Args: nil, 2527 Field: field, 2528 } 2529 ctx = graphql.WithResolverContext(ctx, rctx) 2530 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2531 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2532 ctx = rctx // use context from middleware stack in children 2533 return obj.PageInfo, nil 2534 }) 2535 if resTmp == nil { 2536 if !ec.HasError(rctx) { 2537 ec.Errorf(ctx, "must not be null") 2538 } 2539 return graphql.Null 2540 } 2541 res := resTmp.(model.PageInfo) 2542 rctx.Result = res 2543 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2544 2545 return ec._PageInfo(ctx, field.Selections, &res) 2546 } 2547 2548 // nolint: vetshadow 2549 func (ec *executionContext) _FilmConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.FilmConnection) graphql.Marshaler { 2550 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2551 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2552 rctx := &graphql.ResolverContext{ 2553 Object: "FilmConnection", 2554 Args: nil, 2555 Field: field, 2556 } 2557 ctx = graphql.WithResolverContext(ctx, rctx) 2558 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2559 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2560 ctx = rctx // use context from middleware stack in children 2561 return obj.Edges, nil 2562 }) 2563 if resTmp == nil { 2564 return graphql.Null 2565 } 2566 res := resTmp.([]model.FilmEdge) 2567 rctx.Result = res 2568 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2569 2570 arr1 := make(graphql.Array, len(res)) 2571 var wg sync.WaitGroup 2572 2573 isLen1 := len(res) == 1 2574 if !isLen1 { 2575 wg.Add(len(res)) 2576 } 2577 2578 for idx1 := range res { 2579 idx1 := idx1 2580 rctx := &graphql.ResolverContext{ 2581 Index: &idx1, 2582 Result: &res[idx1], 2583 } 2584 ctx := graphql.WithResolverContext(ctx, rctx) 2585 f := func(idx1 int) { 2586 if !isLen1 { 2587 defer wg.Done() 2588 } 2589 arr1[idx1] = func() graphql.Marshaler { 2590 2591 return ec._FilmEdge(ctx, field.Selections, &res[idx1]) 2592 }() 2593 } 2594 if isLen1 { 2595 f(idx1) 2596 } else { 2597 go f(idx1) 2598 } 2599 2600 } 2601 wg.Wait() 2602 return arr1 2603 } 2604 2605 // nolint: vetshadow 2606 func (ec *executionContext) _FilmConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.FilmConnection) graphql.Marshaler { 2607 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2608 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2609 rctx := &graphql.ResolverContext{ 2610 Object: "FilmConnection", 2611 Args: nil, 2612 Field: field, 2613 } 2614 ctx = graphql.WithResolverContext(ctx, rctx) 2615 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2616 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2617 ctx = rctx // use context from middleware stack in children 2618 return obj.TotalCount, nil 2619 }) 2620 if resTmp == nil { 2621 if !ec.HasError(rctx) { 2622 ec.Errorf(ctx, "must not be null") 2623 } 2624 return graphql.Null 2625 } 2626 res := resTmp.(int) 2627 rctx.Result = res 2628 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2629 return graphql.MarshalInt(res) 2630 } 2631 2632 var filmEdgeImplementors = []string{"FilmEdge"} 2633 2634 // nolint: gocyclo, errcheck, gas, goconst 2635 func (ec *executionContext) _FilmEdge(ctx context.Context, sel ast.SelectionSet, obj *model.FilmEdge) graphql.Marshaler { 2636 fields := graphql.CollectFields(ctx, sel, filmEdgeImplementors) 2637 2638 out := graphql.NewOrderedMap(len(fields)) 2639 invalid := false 2640 for i, field := range fields { 2641 out.Keys[i] = field.Alias 2642 2643 switch field.Name { 2644 case "__typename": 2645 out.Values[i] = graphql.MarshalString("FilmEdge") 2646 case "node": 2647 out.Values[i] = ec._FilmEdge_node(ctx, field, obj) 2648 case "cursor": 2649 out.Values[i] = ec._FilmEdge_cursor(ctx, field, obj) 2650 if out.Values[i] == graphql.Null { 2651 invalid = true 2652 } 2653 default: 2654 panic("unknown field " + strconv.Quote(field.Name)) 2655 } 2656 } 2657 2658 if invalid { 2659 return graphql.Null 2660 } 2661 return out 2662 } 2663 2664 // nolint: vetshadow 2665 func (ec *executionContext) _FilmEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.FilmEdge) graphql.Marshaler { 2666 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2667 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2668 rctx := &graphql.ResolverContext{ 2669 Object: "FilmEdge", 2670 Args: nil, 2671 Field: field, 2672 } 2673 ctx = graphql.WithResolverContext(ctx, rctx) 2674 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2675 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2676 ctx = rctx // use context from middleware stack in children 2677 return obj.Node, nil 2678 }) 2679 if resTmp == nil { 2680 return graphql.Null 2681 } 2682 res := resTmp.(*model.Film) 2683 rctx.Result = res 2684 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2685 2686 if res == nil { 2687 return graphql.Null 2688 } 2689 2690 return ec._Film(ctx, field.Selections, res) 2691 } 2692 2693 // nolint: vetshadow 2694 func (ec *executionContext) _FilmEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.FilmEdge) graphql.Marshaler { 2695 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2696 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2697 rctx := &graphql.ResolverContext{ 2698 Object: "FilmEdge", 2699 Args: nil, 2700 Field: field, 2701 } 2702 ctx = graphql.WithResolverContext(ctx, rctx) 2703 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2704 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2705 ctx = rctx // use context from middleware stack in children 2706 return obj.Cursor, nil 2707 }) 2708 if resTmp == nil { 2709 if !ec.HasError(rctx) { 2710 ec.Errorf(ctx, "must not be null") 2711 } 2712 return graphql.Null 2713 } 2714 res := resTmp.(string) 2715 rctx.Result = res 2716 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2717 return graphql.MarshalID(res) 2718 } 2719 2720 var pageInfoImplementors = []string{"PageInfo"} 2721 2722 // nolint: gocyclo, errcheck, gas, goconst 2723 func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler { 2724 fields := graphql.CollectFields(ctx, sel, pageInfoImplementors) 2725 2726 out := graphql.NewOrderedMap(len(fields)) 2727 invalid := false 2728 for i, field := range fields { 2729 out.Keys[i] = field.Alias 2730 2731 switch field.Name { 2732 case "__typename": 2733 out.Values[i] = graphql.MarshalString("PageInfo") 2734 case "hasNextPage": 2735 out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) 2736 if out.Values[i] == graphql.Null { 2737 invalid = true 2738 } 2739 case "hasPreviousPage": 2740 out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) 2741 if out.Values[i] == graphql.Null { 2742 invalid = true 2743 } 2744 case "startCursor": 2745 out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) 2746 if out.Values[i] == graphql.Null { 2747 invalid = true 2748 } 2749 case "endCursor": 2750 out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) 2751 if out.Values[i] == graphql.Null { 2752 invalid = true 2753 } 2754 default: 2755 panic("unknown field " + strconv.Quote(field.Name)) 2756 } 2757 } 2758 2759 if invalid { 2760 return graphql.Null 2761 } 2762 return out 2763 } 2764 2765 // nolint: vetshadow 2766 func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) graphql.Marshaler { 2767 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2768 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2769 rctx := &graphql.ResolverContext{ 2770 Object: "PageInfo", 2771 Args: nil, 2772 Field: field, 2773 } 2774 ctx = graphql.WithResolverContext(ctx, rctx) 2775 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2776 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2777 ctx = rctx // use context from middleware stack in children 2778 return obj.HasNextPage, nil 2779 }) 2780 if resTmp == nil { 2781 if !ec.HasError(rctx) { 2782 ec.Errorf(ctx, "must not be null") 2783 } 2784 return graphql.Null 2785 } 2786 res := resTmp.(bool) 2787 rctx.Result = res 2788 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2789 return graphql.MarshalBoolean(res) 2790 } 2791 2792 // nolint: vetshadow 2793 func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) graphql.Marshaler { 2794 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2795 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2796 rctx := &graphql.ResolverContext{ 2797 Object: "PageInfo", 2798 Args: nil, 2799 Field: field, 2800 } 2801 ctx = graphql.WithResolverContext(ctx, rctx) 2802 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2803 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2804 ctx = rctx // use context from middleware stack in children 2805 return obj.HasPreviousPage, nil 2806 }) 2807 if resTmp == nil { 2808 if !ec.HasError(rctx) { 2809 ec.Errorf(ctx, "must not be null") 2810 } 2811 return graphql.Null 2812 } 2813 res := resTmp.(bool) 2814 rctx.Result = res 2815 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2816 return graphql.MarshalBoolean(res) 2817 } 2818 2819 // nolint: vetshadow 2820 func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) graphql.Marshaler { 2821 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2822 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2823 rctx := &graphql.ResolverContext{ 2824 Object: "PageInfo", 2825 Args: nil, 2826 Field: field, 2827 } 2828 ctx = graphql.WithResolverContext(ctx, rctx) 2829 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2830 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2831 ctx = rctx // use context from middleware stack in children 2832 return obj.StartCursor, nil 2833 }) 2834 if resTmp == nil { 2835 if !ec.HasError(rctx) { 2836 ec.Errorf(ctx, "must not be null") 2837 } 2838 return graphql.Null 2839 } 2840 res := resTmp.(string) 2841 rctx.Result = res 2842 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2843 return graphql.MarshalID(res) 2844 } 2845 2846 // nolint: vetshadow 2847 func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) graphql.Marshaler { 2848 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2849 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2850 rctx := &graphql.ResolverContext{ 2851 Object: "PageInfo", 2852 Args: nil, 2853 Field: field, 2854 } 2855 ctx = graphql.WithResolverContext(ctx, rctx) 2856 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2857 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2858 ctx = rctx // use context from middleware stack in children 2859 return obj.EndCursor, nil 2860 }) 2861 if resTmp == nil { 2862 if !ec.HasError(rctx) { 2863 ec.Errorf(ctx, "must not be null") 2864 } 2865 return graphql.Null 2866 } 2867 res := resTmp.(string) 2868 rctx.Result = res 2869 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2870 return graphql.MarshalID(res) 2871 } 2872 2873 var peopleImplementors = []string{"People"} 2874 2875 // nolint: gocyclo, errcheck, gas, goconst 2876 func (ec *executionContext) _People(ctx context.Context, sel ast.SelectionSet, obj *model.People) graphql.Marshaler { 2877 fields := graphql.CollectFields(ctx, sel, peopleImplementors) 2878 2879 out := graphql.NewOrderedMap(len(fields)) 2880 invalid := false 2881 for i, field := range fields { 2882 out.Keys[i] = field.Alias 2883 2884 switch field.Name { 2885 case "__typename": 2886 out.Values[i] = graphql.MarshalString("People") 2887 case "id": 2888 out.Values[i] = ec._People_id(ctx, field, obj) 2889 if out.Values[i] == graphql.Null { 2890 invalid = true 2891 } 2892 case "name": 2893 out.Values[i] = ec._People_name(ctx, field, obj) 2894 if out.Values[i] == graphql.Null { 2895 invalid = true 2896 } 2897 case "birth_year": 2898 out.Values[i] = ec._People_birth_year(ctx, field, obj) 2899 case "eye_color": 2900 out.Values[i] = ec._People_eye_color(ctx, field, obj) 2901 case "gender": 2902 out.Values[i] = ec._People_gender(ctx, field, obj) 2903 case "hair_color": 2904 out.Values[i] = ec._People_hair_color(ctx, field, obj) 2905 case "height": 2906 out.Values[i] = ec._People_height(ctx, field, obj) 2907 case "mass": 2908 out.Values[i] = ec._People_mass(ctx, field, obj) 2909 case "skin_color": 2910 out.Values[i] = ec._People_skin_color(ctx, field, obj) 2911 case "homeworld": 2912 out.Values[i] = ec._People_homeworld(ctx, field, obj) 2913 case "films": 2914 out.Values[i] = ec._People_films(ctx, field, obj) 2915 case "species": 2916 out.Values[i] = ec._People_species(ctx, field, obj) 2917 case "starships": 2918 out.Values[i] = ec._People_starships(ctx, field, obj) 2919 case "vehicles": 2920 out.Values[i] = ec._People_vehicles(ctx, field, obj) 2921 default: 2922 panic("unknown field " + strconv.Quote(field.Name)) 2923 } 2924 } 2925 2926 if invalid { 2927 return graphql.Null 2928 } 2929 return out 2930 } 2931 2932 // nolint: vetshadow 2933 func (ec *executionContext) _People_id(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 2934 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2935 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2936 rctx := &graphql.ResolverContext{ 2937 Object: "People", 2938 Args: nil, 2939 Field: field, 2940 } 2941 ctx = graphql.WithResolverContext(ctx, rctx) 2942 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2943 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2944 ctx = rctx // use context from middleware stack in children 2945 return obj.ID, nil 2946 }) 2947 if resTmp == nil { 2948 if !ec.HasError(rctx) { 2949 ec.Errorf(ctx, "must not be null") 2950 } 2951 return graphql.Null 2952 } 2953 res := resTmp.(string) 2954 rctx.Result = res 2955 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2956 return graphql.MarshalID(res) 2957 } 2958 2959 // nolint: vetshadow 2960 func (ec *executionContext) _People_name(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 2961 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2962 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2963 rctx := &graphql.ResolverContext{ 2964 Object: "People", 2965 Args: nil, 2966 Field: field, 2967 } 2968 ctx = graphql.WithResolverContext(ctx, rctx) 2969 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2970 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2971 ctx = rctx // use context from middleware stack in children 2972 return obj.Name, nil 2973 }) 2974 if resTmp == nil { 2975 if !ec.HasError(rctx) { 2976 ec.Errorf(ctx, "must not be null") 2977 } 2978 return graphql.Null 2979 } 2980 res := resTmp.(string) 2981 rctx.Result = res 2982 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2983 return graphql.MarshalString(res) 2984 } 2985 2986 // nolint: vetshadow 2987 func (ec *executionContext) _People_birth_year(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 2988 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2989 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2990 rctx := &graphql.ResolverContext{ 2991 Object: "People", 2992 Args: nil, 2993 Field: field, 2994 } 2995 ctx = graphql.WithResolverContext(ctx, rctx) 2996 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2997 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2998 ctx = rctx // use context from middleware stack in children 2999 return obj.BirthYear, nil 3000 }) 3001 if resTmp == nil { 3002 return graphql.Null 3003 } 3004 res := resTmp.(*string) 3005 rctx.Result = res 3006 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3007 3008 if res == nil { 3009 return graphql.Null 3010 } 3011 return graphql.MarshalString(*res) 3012 } 3013 3014 // nolint: vetshadow 3015 func (ec *executionContext) _People_eye_color(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3016 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3017 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3018 rctx := &graphql.ResolverContext{ 3019 Object: "People", 3020 Args: nil, 3021 Field: field, 3022 } 3023 ctx = graphql.WithResolverContext(ctx, rctx) 3024 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3025 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3026 ctx = rctx // use context from middleware stack in children 3027 return obj.EyeColor, nil 3028 }) 3029 if resTmp == nil { 3030 return graphql.Null 3031 } 3032 res := resTmp.(*string) 3033 rctx.Result = res 3034 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3035 3036 if res == nil { 3037 return graphql.Null 3038 } 3039 return graphql.MarshalString(*res) 3040 } 3041 3042 // nolint: vetshadow 3043 func (ec *executionContext) _People_gender(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3044 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3045 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3046 rctx := &graphql.ResolverContext{ 3047 Object: "People", 3048 Args: nil, 3049 Field: field, 3050 } 3051 ctx = graphql.WithResolverContext(ctx, rctx) 3052 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3053 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3054 ctx = rctx // use context from middleware stack in children 3055 return obj.Gender, nil 3056 }) 3057 if resTmp == nil { 3058 return graphql.Null 3059 } 3060 res := resTmp.(*string) 3061 rctx.Result = res 3062 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3063 3064 if res == nil { 3065 return graphql.Null 3066 } 3067 return graphql.MarshalString(*res) 3068 } 3069 3070 // nolint: vetshadow 3071 func (ec *executionContext) _People_hair_color(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3072 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3073 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3074 rctx := &graphql.ResolverContext{ 3075 Object: "People", 3076 Args: nil, 3077 Field: field, 3078 } 3079 ctx = graphql.WithResolverContext(ctx, rctx) 3080 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3081 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3082 ctx = rctx // use context from middleware stack in children 3083 return obj.HairColor, nil 3084 }) 3085 if resTmp == nil { 3086 return graphql.Null 3087 } 3088 res := resTmp.(*string) 3089 rctx.Result = res 3090 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3091 3092 if res == nil { 3093 return graphql.Null 3094 } 3095 return graphql.MarshalString(*res) 3096 } 3097 3098 // nolint: vetshadow 3099 func (ec *executionContext) _People_height(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3100 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3101 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3102 rctx := &graphql.ResolverContext{ 3103 Object: "People", 3104 Args: nil, 3105 Field: field, 3106 } 3107 ctx = graphql.WithResolverContext(ctx, rctx) 3108 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3109 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3110 ctx = rctx // use context from middleware stack in children 3111 return obj.Height, nil 3112 }) 3113 if resTmp == nil { 3114 return graphql.Null 3115 } 3116 res := resTmp.(*string) 3117 rctx.Result = res 3118 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3119 3120 if res == nil { 3121 return graphql.Null 3122 } 3123 return graphql.MarshalString(*res) 3124 } 3125 3126 // nolint: vetshadow 3127 func (ec *executionContext) _People_mass(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3128 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3129 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3130 rctx := &graphql.ResolverContext{ 3131 Object: "People", 3132 Args: nil, 3133 Field: field, 3134 } 3135 ctx = graphql.WithResolverContext(ctx, rctx) 3136 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3137 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3138 ctx = rctx // use context from middleware stack in children 3139 return obj.Mass, nil 3140 }) 3141 if resTmp == nil { 3142 return graphql.Null 3143 } 3144 res := resTmp.(*string) 3145 rctx.Result = res 3146 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3147 3148 if res == nil { 3149 return graphql.Null 3150 } 3151 return graphql.MarshalString(*res) 3152 } 3153 3154 // nolint: vetshadow 3155 func (ec *executionContext) _People_skin_color(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3156 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3157 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3158 rctx := &graphql.ResolverContext{ 3159 Object: "People", 3160 Args: nil, 3161 Field: field, 3162 } 3163 ctx = graphql.WithResolverContext(ctx, rctx) 3164 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3165 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3166 ctx = rctx // use context from middleware stack in children 3167 return obj.SkinColor, nil 3168 }) 3169 if resTmp == nil { 3170 return graphql.Null 3171 } 3172 res := resTmp.(*string) 3173 rctx.Result = res 3174 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3175 3176 if res == nil { 3177 return graphql.Null 3178 } 3179 return graphql.MarshalString(*res) 3180 } 3181 3182 // nolint: vetshadow 3183 func (ec *executionContext) _People_homeworld(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3184 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3185 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3186 rctx := &graphql.ResolverContext{ 3187 Object: "People", 3188 Args: nil, 3189 Field: field, 3190 } 3191 ctx = graphql.WithResolverContext(ctx, rctx) 3192 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3193 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3194 ctx = rctx // use context from middleware stack in children 3195 return obj.Homeworld, nil 3196 }) 3197 if resTmp == nil { 3198 return graphql.Null 3199 } 3200 res := resTmp.(*model.Planet) 3201 rctx.Result = res 3202 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3203 3204 if res == nil { 3205 return graphql.Null 3206 } 3207 3208 return ec._Planet(ctx, field.Selections, res) 3209 } 3210 3211 // nolint: vetshadow 3212 func (ec *executionContext) _People_films(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3213 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3214 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3215 rctx := &graphql.ResolverContext{ 3216 Object: "People", 3217 Args: nil, 3218 Field: field, 3219 } 3220 ctx = graphql.WithResolverContext(ctx, rctx) 3221 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3222 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3223 ctx = rctx // use context from middleware stack in children 3224 return obj.Films, nil 3225 }) 3226 if resTmp == nil { 3227 return graphql.Null 3228 } 3229 res := resTmp.([]*model.Film) 3230 rctx.Result = res 3231 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3232 3233 arr1 := make(graphql.Array, len(res)) 3234 var wg sync.WaitGroup 3235 3236 isLen1 := len(res) == 1 3237 if !isLen1 { 3238 wg.Add(len(res)) 3239 } 3240 3241 for idx1 := range res { 3242 idx1 := idx1 3243 rctx := &graphql.ResolverContext{ 3244 Index: &idx1, 3245 Result: res[idx1], 3246 } 3247 ctx := graphql.WithResolverContext(ctx, rctx) 3248 f := func(idx1 int) { 3249 if !isLen1 { 3250 defer wg.Done() 3251 } 3252 arr1[idx1] = func() graphql.Marshaler { 3253 3254 if res[idx1] == nil { 3255 return graphql.Null 3256 } 3257 3258 return ec._Film(ctx, field.Selections, res[idx1]) 3259 }() 3260 } 3261 if isLen1 { 3262 f(idx1) 3263 } else { 3264 go f(idx1) 3265 } 3266 3267 } 3268 wg.Wait() 3269 return arr1 3270 } 3271 3272 // nolint: vetshadow 3273 func (ec *executionContext) _People_species(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3274 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3275 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3276 rctx := &graphql.ResolverContext{ 3277 Object: "People", 3278 Args: nil, 3279 Field: field, 3280 } 3281 ctx = graphql.WithResolverContext(ctx, rctx) 3282 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3283 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3284 ctx = rctx // use context from middleware stack in children 3285 return obj.Species, nil 3286 }) 3287 if resTmp == nil { 3288 return graphql.Null 3289 } 3290 res := resTmp.([]*model.Specie) 3291 rctx.Result = res 3292 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3293 3294 arr1 := make(graphql.Array, len(res)) 3295 var wg sync.WaitGroup 3296 3297 isLen1 := len(res) == 1 3298 if !isLen1 { 3299 wg.Add(len(res)) 3300 } 3301 3302 for idx1 := range res { 3303 idx1 := idx1 3304 rctx := &graphql.ResolverContext{ 3305 Index: &idx1, 3306 Result: res[idx1], 3307 } 3308 ctx := graphql.WithResolverContext(ctx, rctx) 3309 f := func(idx1 int) { 3310 if !isLen1 { 3311 defer wg.Done() 3312 } 3313 arr1[idx1] = func() graphql.Marshaler { 3314 3315 if res[idx1] == nil { 3316 return graphql.Null 3317 } 3318 3319 return ec._Specie(ctx, field.Selections, res[idx1]) 3320 }() 3321 } 3322 if isLen1 { 3323 f(idx1) 3324 } else { 3325 go f(idx1) 3326 } 3327 3328 } 3329 wg.Wait() 3330 return arr1 3331 } 3332 3333 // nolint: vetshadow 3334 func (ec *executionContext) _People_starships(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3335 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3336 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3337 rctx := &graphql.ResolverContext{ 3338 Object: "People", 3339 Args: nil, 3340 Field: field, 3341 } 3342 ctx = graphql.WithResolverContext(ctx, rctx) 3343 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3344 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3345 ctx = rctx // use context from middleware stack in children 3346 return obj.Starships, nil 3347 }) 3348 if resTmp == nil { 3349 return graphql.Null 3350 } 3351 res := resTmp.([]*model.Starship) 3352 rctx.Result = res 3353 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3354 3355 arr1 := make(graphql.Array, len(res)) 3356 var wg sync.WaitGroup 3357 3358 isLen1 := len(res) == 1 3359 if !isLen1 { 3360 wg.Add(len(res)) 3361 } 3362 3363 for idx1 := range res { 3364 idx1 := idx1 3365 rctx := &graphql.ResolverContext{ 3366 Index: &idx1, 3367 Result: res[idx1], 3368 } 3369 ctx := graphql.WithResolverContext(ctx, rctx) 3370 f := func(idx1 int) { 3371 if !isLen1 { 3372 defer wg.Done() 3373 } 3374 arr1[idx1] = func() graphql.Marshaler { 3375 3376 if res[idx1] == nil { 3377 return graphql.Null 3378 } 3379 3380 return ec._Starship(ctx, field.Selections, res[idx1]) 3381 }() 3382 } 3383 if isLen1 { 3384 f(idx1) 3385 } else { 3386 go f(idx1) 3387 } 3388 3389 } 3390 wg.Wait() 3391 return arr1 3392 } 3393 3394 // nolint: vetshadow 3395 func (ec *executionContext) _People_vehicles(ctx context.Context, field graphql.CollectedField, obj *model.People) graphql.Marshaler { 3396 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3397 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3398 rctx := &graphql.ResolverContext{ 3399 Object: "People", 3400 Args: nil, 3401 Field: field, 3402 } 3403 ctx = graphql.WithResolverContext(ctx, rctx) 3404 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3405 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3406 ctx = rctx // use context from middleware stack in children 3407 return obj.Vehicles, nil 3408 }) 3409 if resTmp == nil { 3410 return graphql.Null 3411 } 3412 res := resTmp.([]*model.Vehicle) 3413 rctx.Result = res 3414 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3415 3416 arr1 := make(graphql.Array, len(res)) 3417 var wg sync.WaitGroup 3418 3419 isLen1 := len(res) == 1 3420 if !isLen1 { 3421 wg.Add(len(res)) 3422 } 3423 3424 for idx1 := range res { 3425 idx1 := idx1 3426 rctx := &graphql.ResolverContext{ 3427 Index: &idx1, 3428 Result: res[idx1], 3429 } 3430 ctx := graphql.WithResolverContext(ctx, rctx) 3431 f := func(idx1 int) { 3432 if !isLen1 { 3433 defer wg.Done() 3434 } 3435 arr1[idx1] = func() graphql.Marshaler { 3436 3437 if res[idx1] == nil { 3438 return graphql.Null 3439 } 3440 3441 return ec._Vehicle(ctx, field.Selections, res[idx1]) 3442 }() 3443 } 3444 if isLen1 { 3445 f(idx1) 3446 } else { 3447 go f(idx1) 3448 } 3449 3450 } 3451 wg.Wait() 3452 return arr1 3453 } 3454 3455 var peopleConnectionImplementors = []string{"PeopleConnection"} 3456 3457 // nolint: gocyclo, errcheck, gas, goconst 3458 func (ec *executionContext) _PeopleConnection(ctx context.Context, sel ast.SelectionSet, obj *model.PeopleConnection) graphql.Marshaler { 3459 fields := graphql.CollectFields(ctx, sel, peopleConnectionImplementors) 3460 3461 out := graphql.NewOrderedMap(len(fields)) 3462 invalid := false 3463 for i, field := range fields { 3464 out.Keys[i] = field.Alias 3465 3466 switch field.Name { 3467 case "__typename": 3468 out.Values[i] = graphql.MarshalString("PeopleConnection") 3469 case "pageInfo": 3470 out.Values[i] = ec._PeopleConnection_pageInfo(ctx, field, obj) 3471 if out.Values[i] == graphql.Null { 3472 invalid = true 3473 } 3474 case "edges": 3475 out.Values[i] = ec._PeopleConnection_edges(ctx, field, obj) 3476 case "totalCount": 3477 out.Values[i] = ec._PeopleConnection_totalCount(ctx, field, obj) 3478 if out.Values[i] == graphql.Null { 3479 invalid = true 3480 } 3481 default: 3482 panic("unknown field " + strconv.Quote(field.Name)) 3483 } 3484 } 3485 3486 if invalid { 3487 return graphql.Null 3488 } 3489 return out 3490 } 3491 3492 // nolint: vetshadow 3493 func (ec *executionContext) _PeopleConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.PeopleConnection) graphql.Marshaler { 3494 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3495 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3496 rctx := &graphql.ResolverContext{ 3497 Object: "PeopleConnection", 3498 Args: nil, 3499 Field: field, 3500 } 3501 ctx = graphql.WithResolverContext(ctx, rctx) 3502 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3503 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3504 ctx = rctx // use context from middleware stack in children 3505 return obj.PageInfo, nil 3506 }) 3507 if resTmp == nil { 3508 if !ec.HasError(rctx) { 3509 ec.Errorf(ctx, "must not be null") 3510 } 3511 return graphql.Null 3512 } 3513 res := resTmp.(model.PageInfo) 3514 rctx.Result = res 3515 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3516 3517 return ec._PageInfo(ctx, field.Selections, &res) 3518 } 3519 3520 // nolint: vetshadow 3521 func (ec *executionContext) _PeopleConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.PeopleConnection) graphql.Marshaler { 3522 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3523 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3524 rctx := &graphql.ResolverContext{ 3525 Object: "PeopleConnection", 3526 Args: nil, 3527 Field: field, 3528 } 3529 ctx = graphql.WithResolverContext(ctx, rctx) 3530 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3531 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3532 ctx = rctx // use context from middleware stack in children 3533 return obj.Edges, nil 3534 }) 3535 if resTmp == nil { 3536 return graphql.Null 3537 } 3538 res := resTmp.([]model.PeopleEdge) 3539 rctx.Result = res 3540 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3541 3542 arr1 := make(graphql.Array, len(res)) 3543 var wg sync.WaitGroup 3544 3545 isLen1 := len(res) == 1 3546 if !isLen1 { 3547 wg.Add(len(res)) 3548 } 3549 3550 for idx1 := range res { 3551 idx1 := idx1 3552 rctx := &graphql.ResolverContext{ 3553 Index: &idx1, 3554 Result: &res[idx1], 3555 } 3556 ctx := graphql.WithResolverContext(ctx, rctx) 3557 f := func(idx1 int) { 3558 if !isLen1 { 3559 defer wg.Done() 3560 } 3561 arr1[idx1] = func() graphql.Marshaler { 3562 3563 return ec._PeopleEdge(ctx, field.Selections, &res[idx1]) 3564 }() 3565 } 3566 if isLen1 { 3567 f(idx1) 3568 } else { 3569 go f(idx1) 3570 } 3571 3572 } 3573 wg.Wait() 3574 return arr1 3575 } 3576 3577 // nolint: vetshadow 3578 func (ec *executionContext) _PeopleConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.PeopleConnection) graphql.Marshaler { 3579 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3580 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3581 rctx := &graphql.ResolverContext{ 3582 Object: "PeopleConnection", 3583 Args: nil, 3584 Field: field, 3585 } 3586 ctx = graphql.WithResolverContext(ctx, rctx) 3587 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3588 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3589 ctx = rctx // use context from middleware stack in children 3590 return obj.TotalCount, nil 3591 }) 3592 if resTmp == nil { 3593 if !ec.HasError(rctx) { 3594 ec.Errorf(ctx, "must not be null") 3595 } 3596 return graphql.Null 3597 } 3598 res := resTmp.(int) 3599 rctx.Result = res 3600 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3601 return graphql.MarshalInt(res) 3602 } 3603 3604 var peopleEdgeImplementors = []string{"PeopleEdge"} 3605 3606 // nolint: gocyclo, errcheck, gas, goconst 3607 func (ec *executionContext) _PeopleEdge(ctx context.Context, sel ast.SelectionSet, obj *model.PeopleEdge) graphql.Marshaler { 3608 fields := graphql.CollectFields(ctx, sel, peopleEdgeImplementors) 3609 3610 out := graphql.NewOrderedMap(len(fields)) 3611 invalid := false 3612 for i, field := range fields { 3613 out.Keys[i] = field.Alias 3614 3615 switch field.Name { 3616 case "__typename": 3617 out.Values[i] = graphql.MarshalString("PeopleEdge") 3618 case "node": 3619 out.Values[i] = ec._PeopleEdge_node(ctx, field, obj) 3620 case "cursor": 3621 out.Values[i] = ec._PeopleEdge_cursor(ctx, field, obj) 3622 if out.Values[i] == graphql.Null { 3623 invalid = true 3624 } 3625 default: 3626 panic("unknown field " + strconv.Quote(field.Name)) 3627 } 3628 } 3629 3630 if invalid { 3631 return graphql.Null 3632 } 3633 return out 3634 } 3635 3636 // nolint: vetshadow 3637 func (ec *executionContext) _PeopleEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.PeopleEdge) graphql.Marshaler { 3638 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3639 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3640 rctx := &graphql.ResolverContext{ 3641 Object: "PeopleEdge", 3642 Args: nil, 3643 Field: field, 3644 } 3645 ctx = graphql.WithResolverContext(ctx, rctx) 3646 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3647 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3648 ctx = rctx // use context from middleware stack in children 3649 return obj.Node, nil 3650 }) 3651 if resTmp == nil { 3652 return graphql.Null 3653 } 3654 res := resTmp.(*model.People) 3655 rctx.Result = res 3656 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3657 3658 if res == nil { 3659 return graphql.Null 3660 } 3661 3662 return ec._People(ctx, field.Selections, res) 3663 } 3664 3665 // nolint: vetshadow 3666 func (ec *executionContext) _PeopleEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.PeopleEdge) graphql.Marshaler { 3667 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3668 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3669 rctx := &graphql.ResolverContext{ 3670 Object: "PeopleEdge", 3671 Args: nil, 3672 Field: field, 3673 } 3674 ctx = graphql.WithResolverContext(ctx, rctx) 3675 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3676 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3677 ctx = rctx // use context from middleware stack in children 3678 return obj.Cursor, nil 3679 }) 3680 if resTmp == nil { 3681 if !ec.HasError(rctx) { 3682 ec.Errorf(ctx, "must not be null") 3683 } 3684 return graphql.Null 3685 } 3686 res := resTmp.(string) 3687 rctx.Result = res 3688 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3689 return graphql.MarshalID(res) 3690 } 3691 3692 var planetImplementors = []string{"Planet"} 3693 3694 // nolint: gocyclo, errcheck, gas, goconst 3695 func (ec *executionContext) _Planet(ctx context.Context, sel ast.SelectionSet, obj *model.Planet) graphql.Marshaler { 3696 fields := graphql.CollectFields(ctx, sel, planetImplementors) 3697 3698 out := graphql.NewOrderedMap(len(fields)) 3699 invalid := false 3700 for i, field := range fields { 3701 out.Keys[i] = field.Alias 3702 3703 switch field.Name { 3704 case "__typename": 3705 out.Values[i] = graphql.MarshalString("Planet") 3706 case "id": 3707 out.Values[i] = ec._Planet_id(ctx, field, obj) 3708 if out.Values[i] == graphql.Null { 3709 invalid = true 3710 } 3711 case "name": 3712 out.Values[i] = ec._Planet_name(ctx, field, obj) 3713 if out.Values[i] == graphql.Null { 3714 invalid = true 3715 } 3716 case "diameter": 3717 out.Values[i] = ec._Planet_diameter(ctx, field, obj) 3718 case "rotation_period": 3719 out.Values[i] = ec._Planet_rotation_period(ctx, field, obj) 3720 case "orbital_period": 3721 out.Values[i] = ec._Planet_orbital_period(ctx, field, obj) 3722 case "gravity": 3723 out.Values[i] = ec._Planet_gravity(ctx, field, obj) 3724 case "population": 3725 out.Values[i] = ec._Planet_population(ctx, field, obj) 3726 case "climate": 3727 out.Values[i] = ec._Planet_climate(ctx, field, obj) 3728 case "terrain": 3729 out.Values[i] = ec._Planet_terrain(ctx, field, obj) 3730 case "surface_water": 3731 out.Values[i] = ec._Planet_surface_water(ctx, field, obj) 3732 case "residents": 3733 out.Values[i] = ec._Planet_residents(ctx, field, obj) 3734 case "films": 3735 out.Values[i] = ec._Planet_films(ctx, field, obj) 3736 default: 3737 panic("unknown field " + strconv.Quote(field.Name)) 3738 } 3739 } 3740 3741 if invalid { 3742 return graphql.Null 3743 } 3744 return out 3745 } 3746 3747 // nolint: vetshadow 3748 func (ec *executionContext) _Planet_id(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3749 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3750 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3751 rctx := &graphql.ResolverContext{ 3752 Object: "Planet", 3753 Args: nil, 3754 Field: field, 3755 } 3756 ctx = graphql.WithResolverContext(ctx, rctx) 3757 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3758 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3759 ctx = rctx // use context from middleware stack in children 3760 return obj.ID, nil 3761 }) 3762 if resTmp == nil { 3763 if !ec.HasError(rctx) { 3764 ec.Errorf(ctx, "must not be null") 3765 } 3766 return graphql.Null 3767 } 3768 res := resTmp.(string) 3769 rctx.Result = res 3770 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3771 return graphql.MarshalID(res) 3772 } 3773 3774 // nolint: vetshadow 3775 func (ec *executionContext) _Planet_name(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3776 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3777 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3778 rctx := &graphql.ResolverContext{ 3779 Object: "Planet", 3780 Args: nil, 3781 Field: field, 3782 } 3783 ctx = graphql.WithResolverContext(ctx, rctx) 3784 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3785 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3786 ctx = rctx // use context from middleware stack in children 3787 return obj.Name, nil 3788 }) 3789 if resTmp == nil { 3790 if !ec.HasError(rctx) { 3791 ec.Errorf(ctx, "must not be null") 3792 } 3793 return graphql.Null 3794 } 3795 res := resTmp.(string) 3796 rctx.Result = res 3797 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3798 return graphql.MarshalString(res) 3799 } 3800 3801 // nolint: vetshadow 3802 func (ec *executionContext) _Planet_diameter(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3803 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3804 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3805 rctx := &graphql.ResolverContext{ 3806 Object: "Planet", 3807 Args: nil, 3808 Field: field, 3809 } 3810 ctx = graphql.WithResolverContext(ctx, rctx) 3811 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3812 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3813 ctx = rctx // use context from middleware stack in children 3814 return obj.Diameter, nil 3815 }) 3816 if resTmp == nil { 3817 return graphql.Null 3818 } 3819 res := resTmp.(*string) 3820 rctx.Result = res 3821 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3822 3823 if res == nil { 3824 return graphql.Null 3825 } 3826 return graphql.MarshalString(*res) 3827 } 3828 3829 // nolint: vetshadow 3830 func (ec *executionContext) _Planet_rotation_period(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3831 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3832 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3833 rctx := &graphql.ResolverContext{ 3834 Object: "Planet", 3835 Args: nil, 3836 Field: field, 3837 } 3838 ctx = graphql.WithResolverContext(ctx, rctx) 3839 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3840 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3841 ctx = rctx // use context from middleware stack in children 3842 return obj.RotationPeriod, nil 3843 }) 3844 if resTmp == nil { 3845 return graphql.Null 3846 } 3847 res := resTmp.(*string) 3848 rctx.Result = res 3849 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3850 3851 if res == nil { 3852 return graphql.Null 3853 } 3854 return graphql.MarshalString(*res) 3855 } 3856 3857 // nolint: vetshadow 3858 func (ec *executionContext) _Planet_orbital_period(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3859 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3860 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3861 rctx := &graphql.ResolverContext{ 3862 Object: "Planet", 3863 Args: nil, 3864 Field: field, 3865 } 3866 ctx = graphql.WithResolverContext(ctx, rctx) 3867 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3868 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3869 ctx = rctx // use context from middleware stack in children 3870 return obj.OrbitalPeriod, nil 3871 }) 3872 if resTmp == nil { 3873 return graphql.Null 3874 } 3875 res := resTmp.(*string) 3876 rctx.Result = res 3877 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3878 3879 if res == nil { 3880 return graphql.Null 3881 } 3882 return graphql.MarshalString(*res) 3883 } 3884 3885 // nolint: vetshadow 3886 func (ec *executionContext) _Planet_gravity(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3887 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3888 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3889 rctx := &graphql.ResolverContext{ 3890 Object: "Planet", 3891 Args: nil, 3892 Field: field, 3893 } 3894 ctx = graphql.WithResolverContext(ctx, rctx) 3895 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3896 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3897 ctx = rctx // use context from middleware stack in children 3898 return obj.Gravity, nil 3899 }) 3900 if resTmp == nil { 3901 return graphql.Null 3902 } 3903 res := resTmp.(*string) 3904 rctx.Result = res 3905 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3906 3907 if res == nil { 3908 return graphql.Null 3909 } 3910 return graphql.MarshalString(*res) 3911 } 3912 3913 // nolint: vetshadow 3914 func (ec *executionContext) _Planet_population(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3915 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3916 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3917 rctx := &graphql.ResolverContext{ 3918 Object: "Planet", 3919 Args: nil, 3920 Field: field, 3921 } 3922 ctx = graphql.WithResolverContext(ctx, rctx) 3923 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3924 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3925 ctx = rctx // use context from middleware stack in children 3926 return obj.Population, nil 3927 }) 3928 if resTmp == nil { 3929 return graphql.Null 3930 } 3931 res := resTmp.(*string) 3932 rctx.Result = res 3933 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3934 3935 if res == nil { 3936 return graphql.Null 3937 } 3938 return graphql.MarshalString(*res) 3939 } 3940 3941 // nolint: vetshadow 3942 func (ec *executionContext) _Planet_climate(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3943 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3944 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3945 rctx := &graphql.ResolverContext{ 3946 Object: "Planet", 3947 Args: nil, 3948 Field: field, 3949 } 3950 ctx = graphql.WithResolverContext(ctx, rctx) 3951 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3952 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3953 ctx = rctx // use context from middleware stack in children 3954 return obj.Climate, nil 3955 }) 3956 if resTmp == nil { 3957 return graphql.Null 3958 } 3959 res := resTmp.(*string) 3960 rctx.Result = res 3961 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3962 3963 if res == nil { 3964 return graphql.Null 3965 } 3966 return graphql.MarshalString(*res) 3967 } 3968 3969 // nolint: vetshadow 3970 func (ec *executionContext) _Planet_terrain(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3971 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3972 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3973 rctx := &graphql.ResolverContext{ 3974 Object: "Planet", 3975 Args: nil, 3976 Field: field, 3977 } 3978 ctx = graphql.WithResolverContext(ctx, rctx) 3979 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3980 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3981 ctx = rctx // use context from middleware stack in children 3982 return obj.Terrain, nil 3983 }) 3984 if resTmp == nil { 3985 return graphql.Null 3986 } 3987 res := resTmp.(*string) 3988 rctx.Result = res 3989 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3990 3991 if res == nil { 3992 return graphql.Null 3993 } 3994 return graphql.MarshalString(*res) 3995 } 3996 3997 // nolint: vetshadow 3998 func (ec *executionContext) _Planet_surface_water(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 3999 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4000 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4001 rctx := &graphql.ResolverContext{ 4002 Object: "Planet", 4003 Args: nil, 4004 Field: field, 4005 } 4006 ctx = graphql.WithResolverContext(ctx, rctx) 4007 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4008 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4009 ctx = rctx // use context from middleware stack in children 4010 return obj.SurfaceWater, nil 4011 }) 4012 if resTmp == nil { 4013 return graphql.Null 4014 } 4015 res := resTmp.(*string) 4016 rctx.Result = res 4017 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4018 4019 if res == nil { 4020 return graphql.Null 4021 } 4022 return graphql.MarshalString(*res) 4023 } 4024 4025 // nolint: vetshadow 4026 func (ec *executionContext) _Planet_residents(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 4027 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4028 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4029 rctx := &graphql.ResolverContext{ 4030 Object: "Planet", 4031 Args: nil, 4032 Field: field, 4033 } 4034 ctx = graphql.WithResolverContext(ctx, rctx) 4035 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4036 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4037 ctx = rctx // use context from middleware stack in children 4038 return obj.Residents, nil 4039 }) 4040 if resTmp == nil { 4041 return graphql.Null 4042 } 4043 res := resTmp.([]*model.People) 4044 rctx.Result = res 4045 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4046 4047 arr1 := make(graphql.Array, len(res)) 4048 var wg sync.WaitGroup 4049 4050 isLen1 := len(res) == 1 4051 if !isLen1 { 4052 wg.Add(len(res)) 4053 } 4054 4055 for idx1 := range res { 4056 idx1 := idx1 4057 rctx := &graphql.ResolverContext{ 4058 Index: &idx1, 4059 Result: res[idx1], 4060 } 4061 ctx := graphql.WithResolverContext(ctx, rctx) 4062 f := func(idx1 int) { 4063 if !isLen1 { 4064 defer wg.Done() 4065 } 4066 arr1[idx1] = func() graphql.Marshaler { 4067 4068 if res[idx1] == nil { 4069 return graphql.Null 4070 } 4071 4072 return ec._People(ctx, field.Selections, res[idx1]) 4073 }() 4074 } 4075 if isLen1 { 4076 f(idx1) 4077 } else { 4078 go f(idx1) 4079 } 4080 4081 } 4082 wg.Wait() 4083 return arr1 4084 } 4085 4086 // nolint: vetshadow 4087 func (ec *executionContext) _Planet_films(ctx context.Context, field graphql.CollectedField, obj *model.Planet) graphql.Marshaler { 4088 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4089 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4090 rctx := &graphql.ResolverContext{ 4091 Object: "Planet", 4092 Args: nil, 4093 Field: field, 4094 } 4095 ctx = graphql.WithResolverContext(ctx, rctx) 4096 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4097 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4098 ctx = rctx // use context from middleware stack in children 4099 return obj.Films, nil 4100 }) 4101 if resTmp == nil { 4102 return graphql.Null 4103 } 4104 res := resTmp.([]*model.Film) 4105 rctx.Result = res 4106 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4107 4108 arr1 := make(graphql.Array, len(res)) 4109 var wg sync.WaitGroup 4110 4111 isLen1 := len(res) == 1 4112 if !isLen1 { 4113 wg.Add(len(res)) 4114 } 4115 4116 for idx1 := range res { 4117 idx1 := idx1 4118 rctx := &graphql.ResolverContext{ 4119 Index: &idx1, 4120 Result: res[idx1], 4121 } 4122 ctx := graphql.WithResolverContext(ctx, rctx) 4123 f := func(idx1 int) { 4124 if !isLen1 { 4125 defer wg.Done() 4126 } 4127 arr1[idx1] = func() graphql.Marshaler { 4128 4129 if res[idx1] == nil { 4130 return graphql.Null 4131 } 4132 4133 return ec._Film(ctx, field.Selections, res[idx1]) 4134 }() 4135 } 4136 if isLen1 { 4137 f(idx1) 4138 } else { 4139 go f(idx1) 4140 } 4141 4142 } 4143 wg.Wait() 4144 return arr1 4145 } 4146 4147 var planetConnectionImplementors = []string{"PlanetConnection"} 4148 4149 // nolint: gocyclo, errcheck, gas, goconst 4150 func (ec *executionContext) _PlanetConnection(ctx context.Context, sel ast.SelectionSet, obj *model.PlanetConnection) graphql.Marshaler { 4151 fields := graphql.CollectFields(ctx, sel, planetConnectionImplementors) 4152 4153 out := graphql.NewOrderedMap(len(fields)) 4154 invalid := false 4155 for i, field := range fields { 4156 out.Keys[i] = field.Alias 4157 4158 switch field.Name { 4159 case "__typename": 4160 out.Values[i] = graphql.MarshalString("PlanetConnection") 4161 case "pageInfo": 4162 out.Values[i] = ec._PlanetConnection_pageInfo(ctx, field, obj) 4163 if out.Values[i] == graphql.Null { 4164 invalid = true 4165 } 4166 case "edges": 4167 out.Values[i] = ec._PlanetConnection_edges(ctx, field, obj) 4168 case "totalCount": 4169 out.Values[i] = ec._PlanetConnection_totalCount(ctx, field, obj) 4170 if out.Values[i] == graphql.Null { 4171 invalid = true 4172 } 4173 default: 4174 panic("unknown field " + strconv.Quote(field.Name)) 4175 } 4176 } 4177 4178 if invalid { 4179 return graphql.Null 4180 } 4181 return out 4182 } 4183 4184 // nolint: vetshadow 4185 func (ec *executionContext) _PlanetConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.PlanetConnection) graphql.Marshaler { 4186 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4187 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4188 rctx := &graphql.ResolverContext{ 4189 Object: "PlanetConnection", 4190 Args: nil, 4191 Field: field, 4192 } 4193 ctx = graphql.WithResolverContext(ctx, rctx) 4194 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4195 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4196 ctx = rctx // use context from middleware stack in children 4197 return obj.PageInfo, nil 4198 }) 4199 if resTmp == nil { 4200 if !ec.HasError(rctx) { 4201 ec.Errorf(ctx, "must not be null") 4202 } 4203 return graphql.Null 4204 } 4205 res := resTmp.(model.PageInfo) 4206 rctx.Result = res 4207 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4208 4209 return ec._PageInfo(ctx, field.Selections, &res) 4210 } 4211 4212 // nolint: vetshadow 4213 func (ec *executionContext) _PlanetConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.PlanetConnection) graphql.Marshaler { 4214 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4215 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4216 rctx := &graphql.ResolverContext{ 4217 Object: "PlanetConnection", 4218 Args: nil, 4219 Field: field, 4220 } 4221 ctx = graphql.WithResolverContext(ctx, rctx) 4222 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4223 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4224 ctx = rctx // use context from middleware stack in children 4225 return obj.Edges, nil 4226 }) 4227 if resTmp == nil { 4228 return graphql.Null 4229 } 4230 res := resTmp.([]model.PlanetEdge) 4231 rctx.Result = res 4232 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4233 4234 arr1 := make(graphql.Array, len(res)) 4235 var wg sync.WaitGroup 4236 4237 isLen1 := len(res) == 1 4238 if !isLen1 { 4239 wg.Add(len(res)) 4240 } 4241 4242 for idx1 := range res { 4243 idx1 := idx1 4244 rctx := &graphql.ResolverContext{ 4245 Index: &idx1, 4246 Result: &res[idx1], 4247 } 4248 ctx := graphql.WithResolverContext(ctx, rctx) 4249 f := func(idx1 int) { 4250 if !isLen1 { 4251 defer wg.Done() 4252 } 4253 arr1[idx1] = func() graphql.Marshaler { 4254 4255 return ec._PlanetEdge(ctx, field.Selections, &res[idx1]) 4256 }() 4257 } 4258 if isLen1 { 4259 f(idx1) 4260 } else { 4261 go f(idx1) 4262 } 4263 4264 } 4265 wg.Wait() 4266 return arr1 4267 } 4268 4269 // nolint: vetshadow 4270 func (ec *executionContext) _PlanetConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.PlanetConnection) graphql.Marshaler { 4271 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4272 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4273 rctx := &graphql.ResolverContext{ 4274 Object: "PlanetConnection", 4275 Args: nil, 4276 Field: field, 4277 } 4278 ctx = graphql.WithResolverContext(ctx, rctx) 4279 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4280 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4281 ctx = rctx // use context from middleware stack in children 4282 return obj.TotalCount, nil 4283 }) 4284 if resTmp == nil { 4285 if !ec.HasError(rctx) { 4286 ec.Errorf(ctx, "must not be null") 4287 } 4288 return graphql.Null 4289 } 4290 res := resTmp.(int) 4291 rctx.Result = res 4292 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4293 return graphql.MarshalInt(res) 4294 } 4295 4296 var planetEdgeImplementors = []string{"PlanetEdge"} 4297 4298 // nolint: gocyclo, errcheck, gas, goconst 4299 func (ec *executionContext) _PlanetEdge(ctx context.Context, sel ast.SelectionSet, obj *model.PlanetEdge) graphql.Marshaler { 4300 fields := graphql.CollectFields(ctx, sel, planetEdgeImplementors) 4301 4302 out := graphql.NewOrderedMap(len(fields)) 4303 invalid := false 4304 for i, field := range fields { 4305 out.Keys[i] = field.Alias 4306 4307 switch field.Name { 4308 case "__typename": 4309 out.Values[i] = graphql.MarshalString("PlanetEdge") 4310 case "node": 4311 out.Values[i] = ec._PlanetEdge_node(ctx, field, obj) 4312 case "cursor": 4313 out.Values[i] = ec._PlanetEdge_cursor(ctx, field, obj) 4314 if out.Values[i] == graphql.Null { 4315 invalid = true 4316 } 4317 default: 4318 panic("unknown field " + strconv.Quote(field.Name)) 4319 } 4320 } 4321 4322 if invalid { 4323 return graphql.Null 4324 } 4325 return out 4326 } 4327 4328 // nolint: vetshadow 4329 func (ec *executionContext) _PlanetEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.PlanetEdge) graphql.Marshaler { 4330 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4331 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4332 rctx := &graphql.ResolverContext{ 4333 Object: "PlanetEdge", 4334 Args: nil, 4335 Field: field, 4336 } 4337 ctx = graphql.WithResolverContext(ctx, rctx) 4338 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4339 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4340 ctx = rctx // use context from middleware stack in children 4341 return obj.Node, nil 4342 }) 4343 if resTmp == nil { 4344 return graphql.Null 4345 } 4346 res := resTmp.(*model.Planet) 4347 rctx.Result = res 4348 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4349 4350 if res == nil { 4351 return graphql.Null 4352 } 4353 4354 return ec._Planet(ctx, field.Selections, res) 4355 } 4356 4357 // nolint: vetshadow 4358 func (ec *executionContext) _PlanetEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.PlanetEdge) graphql.Marshaler { 4359 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4360 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4361 rctx := &graphql.ResolverContext{ 4362 Object: "PlanetEdge", 4363 Args: nil, 4364 Field: field, 4365 } 4366 ctx = graphql.WithResolverContext(ctx, rctx) 4367 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4368 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4369 ctx = rctx // use context from middleware stack in children 4370 return obj.Cursor, nil 4371 }) 4372 if resTmp == nil { 4373 if !ec.HasError(rctx) { 4374 ec.Errorf(ctx, "must not be null") 4375 } 4376 return graphql.Null 4377 } 4378 res := resTmp.(string) 4379 rctx.Result = res 4380 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4381 return graphql.MarshalID(res) 4382 } 4383 4384 var queryImplementors = []string{"Query"} 4385 4386 // nolint: gocyclo, errcheck, gas, goconst 4387 func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 4388 fields := graphql.CollectFields(ctx, sel, queryImplementors) 4389 4390 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ 4391 Object: "Query", 4392 }) 4393 4394 var wg sync.WaitGroup 4395 out := graphql.NewOrderedMap(len(fields)) 4396 invalid := false 4397 for i, field := range fields { 4398 out.Keys[i] = field.Alias 4399 4400 switch field.Name { 4401 case "__typename": 4402 out.Values[i] = graphql.MarshalString("Query") 4403 case "people": 4404 wg.Add(1) 4405 go func(i int, field graphql.CollectedField) { 4406 out.Values[i] = ec._Query_people(ctx, field) 4407 wg.Done() 4408 }(i, field) 4409 case "film": 4410 wg.Add(1) 4411 go func(i int, field graphql.CollectedField) { 4412 out.Values[i] = ec._Query_film(ctx, field) 4413 wg.Done() 4414 }(i, field) 4415 case "starship": 4416 wg.Add(1) 4417 go func(i int, field graphql.CollectedField) { 4418 out.Values[i] = ec._Query_starship(ctx, field) 4419 wg.Done() 4420 }(i, field) 4421 case "vehicle": 4422 wg.Add(1) 4423 go func(i int, field graphql.CollectedField) { 4424 out.Values[i] = ec._Query_vehicle(ctx, field) 4425 wg.Done() 4426 }(i, field) 4427 case "specie": 4428 wg.Add(1) 4429 go func(i int, field graphql.CollectedField) { 4430 out.Values[i] = ec._Query_specie(ctx, field) 4431 wg.Done() 4432 }(i, field) 4433 case "planet": 4434 wg.Add(1) 4435 go func(i int, field graphql.CollectedField) { 4436 out.Values[i] = ec._Query_planet(ctx, field) 4437 wg.Done() 4438 }(i, field) 4439 case "peoples": 4440 wg.Add(1) 4441 go func(i int, field graphql.CollectedField) { 4442 out.Values[i] = ec._Query_peoples(ctx, field) 4443 if out.Values[i] == graphql.Null { 4444 invalid = true 4445 } 4446 wg.Done() 4447 }(i, field) 4448 case "films": 4449 wg.Add(1) 4450 go func(i int, field graphql.CollectedField) { 4451 out.Values[i] = ec._Query_films(ctx, field) 4452 if out.Values[i] == graphql.Null { 4453 invalid = true 4454 } 4455 wg.Done() 4456 }(i, field) 4457 case "starships": 4458 wg.Add(1) 4459 go func(i int, field graphql.CollectedField) { 4460 out.Values[i] = ec._Query_starships(ctx, field) 4461 if out.Values[i] == graphql.Null { 4462 invalid = true 4463 } 4464 wg.Done() 4465 }(i, field) 4466 case "vehicles": 4467 wg.Add(1) 4468 go func(i int, field graphql.CollectedField) { 4469 out.Values[i] = ec._Query_vehicles(ctx, field) 4470 if out.Values[i] == graphql.Null { 4471 invalid = true 4472 } 4473 wg.Done() 4474 }(i, field) 4475 case "species": 4476 wg.Add(1) 4477 go func(i int, field graphql.CollectedField) { 4478 out.Values[i] = ec._Query_species(ctx, field) 4479 if out.Values[i] == graphql.Null { 4480 invalid = true 4481 } 4482 wg.Done() 4483 }(i, field) 4484 case "planets": 4485 wg.Add(1) 4486 go func(i int, field graphql.CollectedField) { 4487 out.Values[i] = ec._Query_planets(ctx, field) 4488 if out.Values[i] == graphql.Null { 4489 invalid = true 4490 } 4491 wg.Done() 4492 }(i, field) 4493 case "peopleSearch": 4494 wg.Add(1) 4495 go func(i int, field graphql.CollectedField) { 4496 out.Values[i] = ec._Query_peopleSearch(ctx, field) 4497 wg.Done() 4498 }(i, field) 4499 case "filmsSearch": 4500 wg.Add(1) 4501 go func(i int, field graphql.CollectedField) { 4502 out.Values[i] = ec._Query_filmsSearch(ctx, field) 4503 wg.Done() 4504 }(i, field) 4505 case "starshipsSearch": 4506 wg.Add(1) 4507 go func(i int, field graphql.CollectedField) { 4508 out.Values[i] = ec._Query_starshipsSearch(ctx, field) 4509 wg.Done() 4510 }(i, field) 4511 case "vehiclesSearch": 4512 wg.Add(1) 4513 go func(i int, field graphql.CollectedField) { 4514 out.Values[i] = ec._Query_vehiclesSearch(ctx, field) 4515 wg.Done() 4516 }(i, field) 4517 case "speciesSearch": 4518 wg.Add(1) 4519 go func(i int, field graphql.CollectedField) { 4520 out.Values[i] = ec._Query_speciesSearch(ctx, field) 4521 wg.Done() 4522 }(i, field) 4523 case "planetsSearch": 4524 wg.Add(1) 4525 go func(i int, field graphql.CollectedField) { 4526 out.Values[i] = ec._Query_planetsSearch(ctx, field) 4527 wg.Done() 4528 }(i, field) 4529 case "__type": 4530 out.Values[i] = ec._Query___type(ctx, field) 4531 case "__schema": 4532 out.Values[i] = ec._Query___schema(ctx, field) 4533 default: 4534 panic("unknown field " + strconv.Quote(field.Name)) 4535 } 4536 } 4537 wg.Wait() 4538 if invalid { 4539 return graphql.Null 4540 } 4541 return out 4542 } 4543 4544 // nolint: vetshadow 4545 func (ec *executionContext) _Query_people(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4546 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4547 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4548 rawArgs := field.ArgumentMap(ec.Variables) 4549 args, err := field_Query_people_args(rawArgs) 4550 if err != nil { 4551 ec.Error(ctx, err) 4552 return graphql.Null 4553 } 4554 rctx := &graphql.ResolverContext{ 4555 Object: "Query", 4556 Args: args, 4557 Field: field, 4558 } 4559 ctx = graphql.WithResolverContext(ctx, rctx) 4560 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4561 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4562 ctx = rctx // use context from middleware stack in children 4563 return ec.resolvers.Query().People(rctx, args["id"].(string)) 4564 }) 4565 if resTmp == nil { 4566 return graphql.Null 4567 } 4568 res := resTmp.(*model.People) 4569 rctx.Result = res 4570 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4571 4572 if res == nil { 4573 return graphql.Null 4574 } 4575 4576 return ec._People(ctx, field.Selections, res) 4577 } 4578 4579 // nolint: vetshadow 4580 func (ec *executionContext) _Query_film(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4581 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4582 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4583 rawArgs := field.ArgumentMap(ec.Variables) 4584 args, err := field_Query_film_args(rawArgs) 4585 if err != nil { 4586 ec.Error(ctx, err) 4587 return graphql.Null 4588 } 4589 rctx := &graphql.ResolverContext{ 4590 Object: "Query", 4591 Args: args, 4592 Field: field, 4593 } 4594 ctx = graphql.WithResolverContext(ctx, rctx) 4595 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4596 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4597 ctx = rctx // use context from middleware stack in children 4598 return ec.resolvers.Query().Film(rctx, args["id"].(string)) 4599 }) 4600 if resTmp == nil { 4601 return graphql.Null 4602 } 4603 res := resTmp.(*model.Film) 4604 rctx.Result = res 4605 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4606 4607 if res == nil { 4608 return graphql.Null 4609 } 4610 4611 return ec._Film(ctx, field.Selections, res) 4612 } 4613 4614 // nolint: vetshadow 4615 func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4616 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4617 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4618 rawArgs := field.ArgumentMap(ec.Variables) 4619 args, err := field_Query_starship_args(rawArgs) 4620 if err != nil { 4621 ec.Error(ctx, err) 4622 return graphql.Null 4623 } 4624 rctx := &graphql.ResolverContext{ 4625 Object: "Query", 4626 Args: args, 4627 Field: field, 4628 } 4629 ctx = graphql.WithResolverContext(ctx, rctx) 4630 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4631 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4632 ctx = rctx // use context from middleware stack in children 4633 return ec.resolvers.Query().Starship(rctx, args["id"].(string)) 4634 }) 4635 if resTmp == nil { 4636 return graphql.Null 4637 } 4638 res := resTmp.(*model.Starship) 4639 rctx.Result = res 4640 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4641 4642 if res == nil { 4643 return graphql.Null 4644 } 4645 4646 return ec._Starship(ctx, field.Selections, res) 4647 } 4648 4649 // nolint: vetshadow 4650 func (ec *executionContext) _Query_vehicle(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4651 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4652 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4653 rawArgs := field.ArgumentMap(ec.Variables) 4654 args, err := field_Query_vehicle_args(rawArgs) 4655 if err != nil { 4656 ec.Error(ctx, err) 4657 return graphql.Null 4658 } 4659 rctx := &graphql.ResolverContext{ 4660 Object: "Query", 4661 Args: args, 4662 Field: field, 4663 } 4664 ctx = graphql.WithResolverContext(ctx, rctx) 4665 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4666 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4667 ctx = rctx // use context from middleware stack in children 4668 return ec.resolvers.Query().Vehicle(rctx, args["id"].(string)) 4669 }) 4670 if resTmp == nil { 4671 return graphql.Null 4672 } 4673 res := resTmp.(*model.Vehicle) 4674 rctx.Result = res 4675 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4676 4677 if res == nil { 4678 return graphql.Null 4679 } 4680 4681 return ec._Vehicle(ctx, field.Selections, res) 4682 } 4683 4684 // nolint: vetshadow 4685 func (ec *executionContext) _Query_specie(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4686 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4687 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4688 rawArgs := field.ArgumentMap(ec.Variables) 4689 args, err := field_Query_specie_args(rawArgs) 4690 if err != nil { 4691 ec.Error(ctx, err) 4692 return graphql.Null 4693 } 4694 rctx := &graphql.ResolverContext{ 4695 Object: "Query", 4696 Args: args, 4697 Field: field, 4698 } 4699 ctx = graphql.WithResolverContext(ctx, rctx) 4700 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4701 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4702 ctx = rctx // use context from middleware stack in children 4703 return ec.resolvers.Query().Specie(rctx, args["id"].(string)) 4704 }) 4705 if resTmp == nil { 4706 return graphql.Null 4707 } 4708 res := resTmp.(*model.Specie) 4709 rctx.Result = res 4710 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4711 4712 if res == nil { 4713 return graphql.Null 4714 } 4715 4716 return ec._Specie(ctx, field.Selections, res) 4717 } 4718 4719 // nolint: vetshadow 4720 func (ec *executionContext) _Query_planet(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4721 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4722 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4723 rawArgs := field.ArgumentMap(ec.Variables) 4724 args, err := field_Query_planet_args(rawArgs) 4725 if err != nil { 4726 ec.Error(ctx, err) 4727 return graphql.Null 4728 } 4729 rctx := &graphql.ResolverContext{ 4730 Object: "Query", 4731 Args: args, 4732 Field: field, 4733 } 4734 ctx = graphql.WithResolverContext(ctx, rctx) 4735 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4736 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4737 ctx = rctx // use context from middleware stack in children 4738 return ec.resolvers.Query().Planet(rctx, args["id"].(string)) 4739 }) 4740 if resTmp == nil { 4741 return graphql.Null 4742 } 4743 res := resTmp.(*model.Planet) 4744 rctx.Result = res 4745 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4746 4747 if res == nil { 4748 return graphql.Null 4749 } 4750 4751 return ec._Planet(ctx, field.Selections, res) 4752 } 4753 4754 // nolint: vetshadow 4755 func (ec *executionContext) _Query_peoples(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4756 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4757 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4758 rawArgs := field.ArgumentMap(ec.Variables) 4759 args, err := field_Query_peoples_args(rawArgs) 4760 if err != nil { 4761 ec.Error(ctx, err) 4762 return graphql.Null 4763 } 4764 rctx := &graphql.ResolverContext{ 4765 Object: "Query", 4766 Args: args, 4767 Field: field, 4768 } 4769 ctx = graphql.WithResolverContext(ctx, rctx) 4770 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4771 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4772 ctx = rctx // use context from middleware stack in children 4773 return ec.resolvers.Query().Peoples(rctx, args["first"].(*int), args["after"].(*string)) 4774 }) 4775 if resTmp == nil { 4776 if !ec.HasError(rctx) { 4777 ec.Errorf(ctx, "must not be null") 4778 } 4779 return graphql.Null 4780 } 4781 res := resTmp.(model.PeopleConnection) 4782 rctx.Result = res 4783 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4784 4785 return ec._PeopleConnection(ctx, field.Selections, &res) 4786 } 4787 4788 // nolint: vetshadow 4789 func (ec *executionContext) _Query_films(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4790 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4791 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4792 rawArgs := field.ArgumentMap(ec.Variables) 4793 args, err := field_Query_films_args(rawArgs) 4794 if err != nil { 4795 ec.Error(ctx, err) 4796 return graphql.Null 4797 } 4798 rctx := &graphql.ResolverContext{ 4799 Object: "Query", 4800 Args: args, 4801 Field: field, 4802 } 4803 ctx = graphql.WithResolverContext(ctx, rctx) 4804 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4805 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4806 ctx = rctx // use context from middleware stack in children 4807 return ec.resolvers.Query().Films(rctx, args["first"].(*int), args["after"].(*string)) 4808 }) 4809 if resTmp == nil { 4810 if !ec.HasError(rctx) { 4811 ec.Errorf(ctx, "must not be null") 4812 } 4813 return graphql.Null 4814 } 4815 res := resTmp.(model.FilmConnection) 4816 rctx.Result = res 4817 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4818 4819 return ec._FilmConnection(ctx, field.Selections, &res) 4820 } 4821 4822 // nolint: vetshadow 4823 func (ec *executionContext) _Query_starships(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4824 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4825 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4826 rawArgs := field.ArgumentMap(ec.Variables) 4827 args, err := field_Query_starships_args(rawArgs) 4828 if err != nil { 4829 ec.Error(ctx, err) 4830 return graphql.Null 4831 } 4832 rctx := &graphql.ResolverContext{ 4833 Object: "Query", 4834 Args: args, 4835 Field: field, 4836 } 4837 ctx = graphql.WithResolverContext(ctx, rctx) 4838 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4839 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4840 ctx = rctx // use context from middleware stack in children 4841 return ec.resolvers.Query().Starships(rctx, args["first"].(*int), args["after"].(*string)) 4842 }) 4843 if resTmp == nil { 4844 if !ec.HasError(rctx) { 4845 ec.Errorf(ctx, "must not be null") 4846 } 4847 return graphql.Null 4848 } 4849 res := resTmp.(model.StarshipConnection) 4850 rctx.Result = res 4851 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4852 4853 return ec._StarshipConnection(ctx, field.Selections, &res) 4854 } 4855 4856 // nolint: vetshadow 4857 func (ec *executionContext) _Query_vehicles(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4858 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4859 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4860 rawArgs := field.ArgumentMap(ec.Variables) 4861 args, err := field_Query_vehicles_args(rawArgs) 4862 if err != nil { 4863 ec.Error(ctx, err) 4864 return graphql.Null 4865 } 4866 rctx := &graphql.ResolverContext{ 4867 Object: "Query", 4868 Args: args, 4869 Field: field, 4870 } 4871 ctx = graphql.WithResolverContext(ctx, rctx) 4872 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4873 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4874 ctx = rctx // use context from middleware stack in children 4875 return ec.resolvers.Query().Vehicles(rctx, args["first"].(*int), args["after"].(*string)) 4876 }) 4877 if resTmp == nil { 4878 if !ec.HasError(rctx) { 4879 ec.Errorf(ctx, "must not be null") 4880 } 4881 return graphql.Null 4882 } 4883 res := resTmp.(model.VehicleConnection) 4884 rctx.Result = res 4885 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4886 4887 return ec._VehicleConnection(ctx, field.Selections, &res) 4888 } 4889 4890 // nolint: vetshadow 4891 func (ec *executionContext) _Query_species(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4892 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4893 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4894 rawArgs := field.ArgumentMap(ec.Variables) 4895 args, err := field_Query_species_args(rawArgs) 4896 if err != nil { 4897 ec.Error(ctx, err) 4898 return graphql.Null 4899 } 4900 rctx := &graphql.ResolverContext{ 4901 Object: "Query", 4902 Args: args, 4903 Field: field, 4904 } 4905 ctx = graphql.WithResolverContext(ctx, rctx) 4906 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4907 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4908 ctx = rctx // use context from middleware stack in children 4909 return ec.resolvers.Query().Species(rctx, args["first"].(*int), args["after"].(*string)) 4910 }) 4911 if resTmp == nil { 4912 if !ec.HasError(rctx) { 4913 ec.Errorf(ctx, "must not be null") 4914 } 4915 return graphql.Null 4916 } 4917 res := resTmp.(model.SpecieConnection) 4918 rctx.Result = res 4919 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4920 4921 return ec._SpecieConnection(ctx, field.Selections, &res) 4922 } 4923 4924 // nolint: vetshadow 4925 func (ec *executionContext) _Query_planets(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4926 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4927 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4928 rawArgs := field.ArgumentMap(ec.Variables) 4929 args, err := field_Query_planets_args(rawArgs) 4930 if err != nil { 4931 ec.Error(ctx, err) 4932 return graphql.Null 4933 } 4934 rctx := &graphql.ResolverContext{ 4935 Object: "Query", 4936 Args: args, 4937 Field: field, 4938 } 4939 ctx = graphql.WithResolverContext(ctx, rctx) 4940 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4941 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4942 ctx = rctx // use context from middleware stack in children 4943 return ec.resolvers.Query().Planets(rctx, args["first"].(*int), args["after"].(*string)) 4944 }) 4945 if resTmp == nil { 4946 if !ec.HasError(rctx) { 4947 ec.Errorf(ctx, "must not be null") 4948 } 4949 return graphql.Null 4950 } 4951 res := resTmp.(model.PlanetConnection) 4952 rctx.Result = res 4953 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4954 4955 return ec._PlanetConnection(ctx, field.Selections, &res) 4956 } 4957 4958 // nolint: vetshadow 4959 func (ec *executionContext) _Query_peopleSearch(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4960 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4961 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4962 rawArgs := field.ArgumentMap(ec.Variables) 4963 args, err := field_Query_peopleSearch_args(rawArgs) 4964 if err != nil { 4965 ec.Error(ctx, err) 4966 return graphql.Null 4967 } 4968 rctx := &graphql.ResolverContext{ 4969 Object: "Query", 4970 Args: args, 4971 Field: field, 4972 } 4973 ctx = graphql.WithResolverContext(ctx, rctx) 4974 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4975 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 4976 ctx = rctx // use context from middleware stack in children 4977 return ec.resolvers.Query().PeopleSearch(rctx, args["search"].(string), args["first"].(*int), args["after"].(*string)) 4978 }) 4979 if resTmp == nil { 4980 return graphql.Null 4981 } 4982 res := resTmp.(*model.PeopleConnection) 4983 rctx.Result = res 4984 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4985 4986 if res == nil { 4987 return graphql.Null 4988 } 4989 4990 return ec._PeopleConnection(ctx, field.Selections, res) 4991 } 4992 4993 // nolint: vetshadow 4994 func (ec *executionContext) _Query_filmsSearch(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 4995 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4996 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4997 rawArgs := field.ArgumentMap(ec.Variables) 4998 args, err := field_Query_filmsSearch_args(rawArgs) 4999 if err != nil { 5000 ec.Error(ctx, err) 5001 return graphql.Null 5002 } 5003 rctx := &graphql.ResolverContext{ 5004 Object: "Query", 5005 Args: args, 5006 Field: field, 5007 } 5008 ctx = graphql.WithResolverContext(ctx, rctx) 5009 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5010 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 5011 ctx = rctx // use context from middleware stack in children 5012 return ec.resolvers.Query().FilmsSearch(rctx, args["search"].(string), args["first"].(*int), args["after"].(*string)) 5013 }) 5014 if resTmp == nil { 5015 return graphql.Null 5016 } 5017 res := resTmp.(*model.FilmConnection) 5018 rctx.Result = res 5019 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5020 5021 if res == nil { 5022 return graphql.Null 5023 } 5024 5025 return ec._FilmConnection(ctx, field.Selections, res) 5026 } 5027 5028 // nolint: vetshadow 5029 func (ec *executionContext) _Query_starshipsSearch(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 5030 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5031 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5032 rawArgs := field.ArgumentMap(ec.Variables) 5033 args, err := field_Query_starshipsSearch_args(rawArgs) 5034 if err != nil { 5035 ec.Error(ctx, err) 5036 return graphql.Null 5037 } 5038 rctx := &graphql.ResolverContext{ 5039 Object: "Query", 5040 Args: args, 5041 Field: field, 5042 } 5043 ctx = graphql.WithResolverContext(ctx, rctx) 5044 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5045 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 5046 ctx = rctx // use context from middleware stack in children 5047 return ec.resolvers.Query().StarshipsSearch(rctx, args["search"].(string), args["first"].(*int), args["after"].(*string)) 5048 }) 5049 if resTmp == nil { 5050 return graphql.Null 5051 } 5052 res := resTmp.(*model.StarshipConnection) 5053 rctx.Result = res 5054 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5055 5056 if res == nil { 5057 return graphql.Null 5058 } 5059 5060 return ec._StarshipConnection(ctx, field.Selections, res) 5061 } 5062 5063 // nolint: vetshadow 5064 func (ec *executionContext) _Query_vehiclesSearch(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 5065 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5066 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5067 rawArgs := field.ArgumentMap(ec.Variables) 5068 args, err := field_Query_vehiclesSearch_args(rawArgs) 5069 if err != nil { 5070 ec.Error(ctx, err) 5071 return graphql.Null 5072 } 5073 rctx := &graphql.ResolverContext{ 5074 Object: "Query", 5075 Args: args, 5076 Field: field, 5077 } 5078 ctx = graphql.WithResolverContext(ctx, rctx) 5079 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5080 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 5081 ctx = rctx // use context from middleware stack in children 5082 return ec.resolvers.Query().VehiclesSearch(rctx, args["search"].(string), args["first"].(*int), args["after"].(*string)) 5083 }) 5084 if resTmp == nil { 5085 return graphql.Null 5086 } 5087 res := resTmp.(*model.VehicleConnection) 5088 rctx.Result = res 5089 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5090 5091 if res == nil { 5092 return graphql.Null 5093 } 5094 5095 return ec._VehicleConnection(ctx, field.Selections, res) 5096 } 5097 5098 // nolint: vetshadow 5099 func (ec *executionContext) _Query_speciesSearch(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 5100 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5101 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5102 rawArgs := field.ArgumentMap(ec.Variables) 5103 args, err := field_Query_speciesSearch_args(rawArgs) 5104 if err != nil { 5105 ec.Error(ctx, err) 5106 return graphql.Null 5107 } 5108 rctx := &graphql.ResolverContext{ 5109 Object: "Query", 5110 Args: args, 5111 Field: field, 5112 } 5113 ctx = graphql.WithResolverContext(ctx, rctx) 5114 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5115 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 5116 ctx = rctx // use context from middleware stack in children 5117 return ec.resolvers.Query().SpeciesSearch(rctx, args["search"].(string), args["first"].(*int), args["after"].(*string)) 5118 }) 5119 if resTmp == nil { 5120 return graphql.Null 5121 } 5122 res := resTmp.(*model.SpecieConnection) 5123 rctx.Result = res 5124 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5125 5126 if res == nil { 5127 return graphql.Null 5128 } 5129 5130 return ec._SpecieConnection(ctx, field.Selections, res) 5131 } 5132 5133 // nolint: vetshadow 5134 func (ec *executionContext) _Query_planetsSearch(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 5135 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5136 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5137 rawArgs := field.ArgumentMap(ec.Variables) 5138 args, err := field_Query_planetsSearch_args(rawArgs) 5139 if err != nil { 5140 ec.Error(ctx, err) 5141 return graphql.Null 5142 } 5143 rctx := &graphql.ResolverContext{ 5144 Object: "Query", 5145 Args: args, 5146 Field: field, 5147 } 5148 ctx = graphql.WithResolverContext(ctx, rctx) 5149 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5150 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 5151 ctx = rctx // use context from middleware stack in children 5152 return ec.resolvers.Query().PlanetsSearch(rctx, args["search"].(string), args["first"].(*int), args["after"].(*string)) 5153 }) 5154 if resTmp == nil { 5155 return graphql.Null 5156 } 5157 res := resTmp.(*model.PlanetConnection) 5158 rctx.Result = res 5159 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5160 5161 if res == nil { 5162 return graphql.Null 5163 } 5164 5165 return ec._PlanetConnection(ctx, field.Selections, res) 5166 } 5167 5168 // nolint: vetshadow 5169 func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 5170 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5171 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5172 rawArgs := field.ArgumentMap(ec.Variables) 5173 args, err := field_Query___type_args(rawArgs) 5174 if err != nil { 5175 ec.Error(ctx, err) 5176 return graphql.Null 5177 } 5178 rctx := &graphql.ResolverContext{ 5179 Object: "Query", 5180 Args: args, 5181 Field: field, 5182 } 5183 ctx = graphql.WithResolverContext(ctx, rctx) 5184 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5185 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 5186 ctx = rctx // use context from middleware stack in children 5187 return ec.introspectType(args["name"].(string)) 5188 }) 5189 if resTmp == nil { 5190 return graphql.Null 5191 } 5192 res := resTmp.(*introspection.Type) 5193 rctx.Result = res 5194 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5195 5196 if res == nil { 5197 return graphql.Null 5198 } 5199 5200 return ec.___Type(ctx, field.Selections, res) 5201 } 5202 5203 // nolint: vetshadow 5204 func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 5205 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5206 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5207 rctx := &graphql.ResolverContext{ 5208 Object: "Query", 5209 Args: nil, 5210 Field: field, 5211 } 5212 ctx = graphql.WithResolverContext(ctx, rctx) 5213 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5214 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 5215 ctx = rctx // use context from middleware stack in children 5216 return ec.introspectSchema() 5217 }) 5218 if resTmp == nil { 5219 return graphql.Null 5220 } 5221 res := resTmp.(*introspection.Schema) 5222 rctx.Result = res 5223 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5224 5225 if res == nil { 5226 return graphql.Null 5227 } 5228 5229 return ec.___Schema(ctx, field.Selections, res) 5230 } 5231 5232 var specieImplementors = []string{"Specie"} 5233 5234 // nolint: gocyclo, errcheck, gas, goconst 5235 func (ec *executionContext) _Specie(ctx context.Context, sel ast.SelectionSet, obj *model.Specie) graphql.Marshaler { 5236 fields := graphql.CollectFields(ctx, sel, specieImplementors) 5237 5238 out := graphql.NewOrderedMap(len(fields)) 5239 invalid := false 5240 for i, field := range fields { 5241 out.Keys[i] = field.Alias 5242 5243 switch field.Name { 5244 case "__typename": 5245 out.Values[i] = graphql.MarshalString("Specie") 5246 case "id": 5247 out.Values[i] = ec._Specie_id(ctx, field, obj) 5248 if out.Values[i] == graphql.Null { 5249 invalid = true 5250 } 5251 case "name": 5252 out.Values[i] = ec._Specie_name(ctx, field, obj) 5253 if out.Values[i] == graphql.Null { 5254 invalid = true 5255 } 5256 case "classification": 5257 out.Values[i] = ec._Specie_classification(ctx, field, obj) 5258 case "designation": 5259 out.Values[i] = ec._Specie_designation(ctx, field, obj) 5260 case "average_height": 5261 out.Values[i] = ec._Specie_average_height(ctx, field, obj) 5262 case "average_lifespan": 5263 out.Values[i] = ec._Specie_average_lifespan(ctx, field, obj) 5264 case "eye_colors": 5265 out.Values[i] = ec._Specie_eye_colors(ctx, field, obj) 5266 case "hair_colors": 5267 out.Values[i] = ec._Specie_hair_colors(ctx, field, obj) 5268 case "skin_colors": 5269 out.Values[i] = ec._Specie_skin_colors(ctx, field, obj) 5270 case "language": 5271 out.Values[i] = ec._Specie_language(ctx, field, obj) 5272 case "homeworld": 5273 out.Values[i] = ec._Specie_homeworld(ctx, field, obj) 5274 case "Vehicle": 5275 out.Values[i] = ec._Specie_Vehicle(ctx, field, obj) 5276 case "films": 5277 out.Values[i] = ec._Specie_films(ctx, field, obj) 5278 case "People": 5279 out.Values[i] = ec._Specie_People(ctx, field, obj) 5280 default: 5281 panic("unknown field " + strconv.Quote(field.Name)) 5282 } 5283 } 5284 5285 if invalid { 5286 return graphql.Null 5287 } 5288 return out 5289 } 5290 5291 // nolint: vetshadow 5292 func (ec *executionContext) _Specie_id(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5293 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5294 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5295 rctx := &graphql.ResolverContext{ 5296 Object: "Specie", 5297 Args: nil, 5298 Field: field, 5299 } 5300 ctx = graphql.WithResolverContext(ctx, rctx) 5301 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5302 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5303 ctx = rctx // use context from middleware stack in children 5304 return obj.ID, nil 5305 }) 5306 if resTmp == nil { 5307 if !ec.HasError(rctx) { 5308 ec.Errorf(ctx, "must not be null") 5309 } 5310 return graphql.Null 5311 } 5312 res := resTmp.(string) 5313 rctx.Result = res 5314 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5315 return graphql.MarshalID(res) 5316 } 5317 5318 // nolint: vetshadow 5319 func (ec *executionContext) _Specie_name(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5320 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5321 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5322 rctx := &graphql.ResolverContext{ 5323 Object: "Specie", 5324 Args: nil, 5325 Field: field, 5326 } 5327 ctx = graphql.WithResolverContext(ctx, rctx) 5328 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5329 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5330 ctx = rctx // use context from middleware stack in children 5331 return obj.Name, nil 5332 }) 5333 if resTmp == nil { 5334 if !ec.HasError(rctx) { 5335 ec.Errorf(ctx, "must not be null") 5336 } 5337 return graphql.Null 5338 } 5339 res := resTmp.(string) 5340 rctx.Result = res 5341 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5342 return graphql.MarshalString(res) 5343 } 5344 5345 // nolint: vetshadow 5346 func (ec *executionContext) _Specie_classification(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5347 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5348 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5349 rctx := &graphql.ResolverContext{ 5350 Object: "Specie", 5351 Args: nil, 5352 Field: field, 5353 } 5354 ctx = graphql.WithResolverContext(ctx, rctx) 5355 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5356 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5357 ctx = rctx // use context from middleware stack in children 5358 return obj.Classification, nil 5359 }) 5360 if resTmp == nil { 5361 return graphql.Null 5362 } 5363 res := resTmp.(*string) 5364 rctx.Result = res 5365 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5366 5367 if res == nil { 5368 return graphql.Null 5369 } 5370 return graphql.MarshalString(*res) 5371 } 5372 5373 // nolint: vetshadow 5374 func (ec *executionContext) _Specie_designation(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5375 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5376 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5377 rctx := &graphql.ResolverContext{ 5378 Object: "Specie", 5379 Args: nil, 5380 Field: field, 5381 } 5382 ctx = graphql.WithResolverContext(ctx, rctx) 5383 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5384 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5385 ctx = rctx // use context from middleware stack in children 5386 return obj.Designation, nil 5387 }) 5388 if resTmp == nil { 5389 return graphql.Null 5390 } 5391 res := resTmp.(*string) 5392 rctx.Result = res 5393 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5394 5395 if res == nil { 5396 return graphql.Null 5397 } 5398 return graphql.MarshalString(*res) 5399 } 5400 5401 // nolint: vetshadow 5402 func (ec *executionContext) _Specie_average_height(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5403 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5404 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5405 rctx := &graphql.ResolverContext{ 5406 Object: "Specie", 5407 Args: nil, 5408 Field: field, 5409 } 5410 ctx = graphql.WithResolverContext(ctx, rctx) 5411 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5412 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5413 ctx = rctx // use context from middleware stack in children 5414 return obj.AverageHeight, nil 5415 }) 5416 if resTmp == nil { 5417 return graphql.Null 5418 } 5419 res := resTmp.(*string) 5420 rctx.Result = res 5421 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5422 5423 if res == nil { 5424 return graphql.Null 5425 } 5426 return graphql.MarshalString(*res) 5427 } 5428 5429 // nolint: vetshadow 5430 func (ec *executionContext) _Specie_average_lifespan(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5431 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5432 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5433 rctx := &graphql.ResolverContext{ 5434 Object: "Specie", 5435 Args: nil, 5436 Field: field, 5437 } 5438 ctx = graphql.WithResolverContext(ctx, rctx) 5439 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5440 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5441 ctx = rctx // use context from middleware stack in children 5442 return obj.AverageLifespan, nil 5443 }) 5444 if resTmp == nil { 5445 return graphql.Null 5446 } 5447 res := resTmp.(*string) 5448 rctx.Result = res 5449 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5450 5451 if res == nil { 5452 return graphql.Null 5453 } 5454 return graphql.MarshalString(*res) 5455 } 5456 5457 // nolint: vetshadow 5458 func (ec *executionContext) _Specie_eye_colors(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5459 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5460 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5461 rctx := &graphql.ResolverContext{ 5462 Object: "Specie", 5463 Args: nil, 5464 Field: field, 5465 } 5466 ctx = graphql.WithResolverContext(ctx, rctx) 5467 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5468 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5469 ctx = rctx // use context from middleware stack in children 5470 return obj.EyeColors, nil 5471 }) 5472 if resTmp == nil { 5473 return graphql.Null 5474 } 5475 res := resTmp.(*string) 5476 rctx.Result = res 5477 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5478 5479 if res == nil { 5480 return graphql.Null 5481 } 5482 return graphql.MarshalString(*res) 5483 } 5484 5485 // nolint: vetshadow 5486 func (ec *executionContext) _Specie_hair_colors(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5487 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5488 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5489 rctx := &graphql.ResolverContext{ 5490 Object: "Specie", 5491 Args: nil, 5492 Field: field, 5493 } 5494 ctx = graphql.WithResolverContext(ctx, rctx) 5495 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5496 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5497 ctx = rctx // use context from middleware stack in children 5498 return obj.HairColors, nil 5499 }) 5500 if resTmp == nil { 5501 return graphql.Null 5502 } 5503 res := resTmp.(*string) 5504 rctx.Result = res 5505 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5506 5507 if res == nil { 5508 return graphql.Null 5509 } 5510 return graphql.MarshalString(*res) 5511 } 5512 5513 // nolint: vetshadow 5514 func (ec *executionContext) _Specie_skin_colors(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5515 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5516 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5517 rctx := &graphql.ResolverContext{ 5518 Object: "Specie", 5519 Args: nil, 5520 Field: field, 5521 } 5522 ctx = graphql.WithResolverContext(ctx, rctx) 5523 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5524 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5525 ctx = rctx // use context from middleware stack in children 5526 return obj.SkinColors, nil 5527 }) 5528 if resTmp == nil { 5529 return graphql.Null 5530 } 5531 res := resTmp.(*string) 5532 rctx.Result = res 5533 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5534 5535 if res == nil { 5536 return graphql.Null 5537 } 5538 return graphql.MarshalString(*res) 5539 } 5540 5541 // nolint: vetshadow 5542 func (ec *executionContext) _Specie_language(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5543 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5544 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5545 rctx := &graphql.ResolverContext{ 5546 Object: "Specie", 5547 Args: nil, 5548 Field: field, 5549 } 5550 ctx = graphql.WithResolverContext(ctx, rctx) 5551 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5552 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5553 ctx = rctx // use context from middleware stack in children 5554 return obj.Language, nil 5555 }) 5556 if resTmp == nil { 5557 return graphql.Null 5558 } 5559 res := resTmp.(*string) 5560 rctx.Result = res 5561 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5562 5563 if res == nil { 5564 return graphql.Null 5565 } 5566 return graphql.MarshalString(*res) 5567 } 5568 5569 // nolint: vetshadow 5570 func (ec *executionContext) _Specie_homeworld(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5571 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5572 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5573 rctx := &graphql.ResolverContext{ 5574 Object: "Specie", 5575 Args: nil, 5576 Field: field, 5577 } 5578 ctx = graphql.WithResolverContext(ctx, rctx) 5579 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5580 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5581 ctx = rctx // use context from middleware stack in children 5582 return obj.Homeworld, nil 5583 }) 5584 if resTmp == nil { 5585 return graphql.Null 5586 } 5587 res := resTmp.(*model.Planet) 5588 rctx.Result = res 5589 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5590 5591 if res == nil { 5592 return graphql.Null 5593 } 5594 5595 return ec._Planet(ctx, field.Selections, res) 5596 } 5597 5598 // nolint: vetshadow 5599 func (ec *executionContext) _Specie_Vehicle(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5600 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5601 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5602 rctx := &graphql.ResolverContext{ 5603 Object: "Specie", 5604 Args: nil, 5605 Field: field, 5606 } 5607 ctx = graphql.WithResolverContext(ctx, rctx) 5608 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5609 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5610 ctx = rctx // use context from middleware stack in children 5611 return obj.Vehicle, nil 5612 }) 5613 if resTmp == nil { 5614 return graphql.Null 5615 } 5616 res := resTmp.([]*model.Vehicle) 5617 rctx.Result = res 5618 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5619 5620 arr1 := make(graphql.Array, len(res)) 5621 var wg sync.WaitGroup 5622 5623 isLen1 := len(res) == 1 5624 if !isLen1 { 5625 wg.Add(len(res)) 5626 } 5627 5628 for idx1 := range res { 5629 idx1 := idx1 5630 rctx := &graphql.ResolverContext{ 5631 Index: &idx1, 5632 Result: res[idx1], 5633 } 5634 ctx := graphql.WithResolverContext(ctx, rctx) 5635 f := func(idx1 int) { 5636 if !isLen1 { 5637 defer wg.Done() 5638 } 5639 arr1[idx1] = func() graphql.Marshaler { 5640 5641 if res[idx1] == nil { 5642 return graphql.Null 5643 } 5644 5645 return ec._Vehicle(ctx, field.Selections, res[idx1]) 5646 }() 5647 } 5648 if isLen1 { 5649 f(idx1) 5650 } else { 5651 go f(idx1) 5652 } 5653 5654 } 5655 wg.Wait() 5656 return arr1 5657 } 5658 5659 // nolint: vetshadow 5660 func (ec *executionContext) _Specie_films(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5661 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5662 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5663 rctx := &graphql.ResolverContext{ 5664 Object: "Specie", 5665 Args: nil, 5666 Field: field, 5667 } 5668 ctx = graphql.WithResolverContext(ctx, rctx) 5669 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5670 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5671 ctx = rctx // use context from middleware stack in children 5672 return obj.Films, nil 5673 }) 5674 if resTmp == nil { 5675 return graphql.Null 5676 } 5677 res := resTmp.([]*model.Film) 5678 rctx.Result = res 5679 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5680 5681 arr1 := make(graphql.Array, len(res)) 5682 var wg sync.WaitGroup 5683 5684 isLen1 := len(res) == 1 5685 if !isLen1 { 5686 wg.Add(len(res)) 5687 } 5688 5689 for idx1 := range res { 5690 idx1 := idx1 5691 rctx := &graphql.ResolverContext{ 5692 Index: &idx1, 5693 Result: res[idx1], 5694 } 5695 ctx := graphql.WithResolverContext(ctx, rctx) 5696 f := func(idx1 int) { 5697 if !isLen1 { 5698 defer wg.Done() 5699 } 5700 arr1[idx1] = func() graphql.Marshaler { 5701 5702 if res[idx1] == nil { 5703 return graphql.Null 5704 } 5705 5706 return ec._Film(ctx, field.Selections, res[idx1]) 5707 }() 5708 } 5709 if isLen1 { 5710 f(idx1) 5711 } else { 5712 go f(idx1) 5713 } 5714 5715 } 5716 wg.Wait() 5717 return arr1 5718 } 5719 5720 // nolint: vetshadow 5721 func (ec *executionContext) _Specie_People(ctx context.Context, field graphql.CollectedField, obj *model.Specie) graphql.Marshaler { 5722 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5723 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5724 rctx := &graphql.ResolverContext{ 5725 Object: "Specie", 5726 Args: nil, 5727 Field: field, 5728 } 5729 ctx = graphql.WithResolverContext(ctx, rctx) 5730 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5731 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5732 ctx = rctx // use context from middleware stack in children 5733 return obj.People, nil 5734 }) 5735 if resTmp == nil { 5736 return graphql.Null 5737 } 5738 res := resTmp.([]*model.People) 5739 rctx.Result = res 5740 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5741 5742 arr1 := make(graphql.Array, len(res)) 5743 var wg sync.WaitGroup 5744 5745 isLen1 := len(res) == 1 5746 if !isLen1 { 5747 wg.Add(len(res)) 5748 } 5749 5750 for idx1 := range res { 5751 idx1 := idx1 5752 rctx := &graphql.ResolverContext{ 5753 Index: &idx1, 5754 Result: res[idx1], 5755 } 5756 ctx := graphql.WithResolverContext(ctx, rctx) 5757 f := func(idx1 int) { 5758 if !isLen1 { 5759 defer wg.Done() 5760 } 5761 arr1[idx1] = func() graphql.Marshaler { 5762 5763 if res[idx1] == nil { 5764 return graphql.Null 5765 } 5766 5767 return ec._People(ctx, field.Selections, res[idx1]) 5768 }() 5769 } 5770 if isLen1 { 5771 f(idx1) 5772 } else { 5773 go f(idx1) 5774 } 5775 5776 } 5777 wg.Wait() 5778 return arr1 5779 } 5780 5781 var specieConnectionImplementors = []string{"SpecieConnection"} 5782 5783 // nolint: gocyclo, errcheck, gas, goconst 5784 func (ec *executionContext) _SpecieConnection(ctx context.Context, sel ast.SelectionSet, obj *model.SpecieConnection) graphql.Marshaler { 5785 fields := graphql.CollectFields(ctx, sel, specieConnectionImplementors) 5786 5787 out := graphql.NewOrderedMap(len(fields)) 5788 invalid := false 5789 for i, field := range fields { 5790 out.Keys[i] = field.Alias 5791 5792 switch field.Name { 5793 case "__typename": 5794 out.Values[i] = graphql.MarshalString("SpecieConnection") 5795 case "pageInfo": 5796 out.Values[i] = ec._SpecieConnection_pageInfo(ctx, field, obj) 5797 if out.Values[i] == graphql.Null { 5798 invalid = true 5799 } 5800 case "edges": 5801 out.Values[i] = ec._SpecieConnection_edges(ctx, field, obj) 5802 case "totalCount": 5803 out.Values[i] = ec._SpecieConnection_totalCount(ctx, field, obj) 5804 if out.Values[i] == graphql.Null { 5805 invalid = true 5806 } 5807 default: 5808 panic("unknown field " + strconv.Quote(field.Name)) 5809 } 5810 } 5811 5812 if invalid { 5813 return graphql.Null 5814 } 5815 return out 5816 } 5817 5818 // nolint: vetshadow 5819 func (ec *executionContext) _SpecieConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.SpecieConnection) graphql.Marshaler { 5820 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5821 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5822 rctx := &graphql.ResolverContext{ 5823 Object: "SpecieConnection", 5824 Args: nil, 5825 Field: field, 5826 } 5827 ctx = graphql.WithResolverContext(ctx, rctx) 5828 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5829 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5830 ctx = rctx // use context from middleware stack in children 5831 return obj.PageInfo, nil 5832 }) 5833 if resTmp == nil { 5834 if !ec.HasError(rctx) { 5835 ec.Errorf(ctx, "must not be null") 5836 } 5837 return graphql.Null 5838 } 5839 res := resTmp.(model.PageInfo) 5840 rctx.Result = res 5841 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5842 5843 return ec._PageInfo(ctx, field.Selections, &res) 5844 } 5845 5846 // nolint: vetshadow 5847 func (ec *executionContext) _SpecieConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.SpecieConnection) graphql.Marshaler { 5848 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5849 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5850 rctx := &graphql.ResolverContext{ 5851 Object: "SpecieConnection", 5852 Args: nil, 5853 Field: field, 5854 } 5855 ctx = graphql.WithResolverContext(ctx, rctx) 5856 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5857 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5858 ctx = rctx // use context from middleware stack in children 5859 return obj.Edges, nil 5860 }) 5861 if resTmp == nil { 5862 return graphql.Null 5863 } 5864 res := resTmp.([]model.SpecieEdge) 5865 rctx.Result = res 5866 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5867 5868 arr1 := make(graphql.Array, len(res)) 5869 var wg sync.WaitGroup 5870 5871 isLen1 := len(res) == 1 5872 if !isLen1 { 5873 wg.Add(len(res)) 5874 } 5875 5876 for idx1 := range res { 5877 idx1 := idx1 5878 rctx := &graphql.ResolverContext{ 5879 Index: &idx1, 5880 Result: &res[idx1], 5881 } 5882 ctx := graphql.WithResolverContext(ctx, rctx) 5883 f := func(idx1 int) { 5884 if !isLen1 { 5885 defer wg.Done() 5886 } 5887 arr1[idx1] = func() graphql.Marshaler { 5888 5889 return ec._SpecieEdge(ctx, field.Selections, &res[idx1]) 5890 }() 5891 } 5892 if isLen1 { 5893 f(idx1) 5894 } else { 5895 go f(idx1) 5896 } 5897 5898 } 5899 wg.Wait() 5900 return arr1 5901 } 5902 5903 // nolint: vetshadow 5904 func (ec *executionContext) _SpecieConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.SpecieConnection) graphql.Marshaler { 5905 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5906 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5907 rctx := &graphql.ResolverContext{ 5908 Object: "SpecieConnection", 5909 Args: nil, 5910 Field: field, 5911 } 5912 ctx = graphql.WithResolverContext(ctx, rctx) 5913 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5914 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5915 ctx = rctx // use context from middleware stack in children 5916 return obj.TotalCount, nil 5917 }) 5918 if resTmp == nil { 5919 if !ec.HasError(rctx) { 5920 ec.Errorf(ctx, "must not be null") 5921 } 5922 return graphql.Null 5923 } 5924 res := resTmp.(int) 5925 rctx.Result = res 5926 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5927 return graphql.MarshalInt(res) 5928 } 5929 5930 var specieEdgeImplementors = []string{"SpecieEdge"} 5931 5932 // nolint: gocyclo, errcheck, gas, goconst 5933 func (ec *executionContext) _SpecieEdge(ctx context.Context, sel ast.SelectionSet, obj *model.SpecieEdge) graphql.Marshaler { 5934 fields := graphql.CollectFields(ctx, sel, specieEdgeImplementors) 5935 5936 out := graphql.NewOrderedMap(len(fields)) 5937 invalid := false 5938 for i, field := range fields { 5939 out.Keys[i] = field.Alias 5940 5941 switch field.Name { 5942 case "__typename": 5943 out.Values[i] = graphql.MarshalString("SpecieEdge") 5944 case "node": 5945 out.Values[i] = ec._SpecieEdge_node(ctx, field, obj) 5946 case "cursor": 5947 out.Values[i] = ec._SpecieEdge_cursor(ctx, field, obj) 5948 if out.Values[i] == graphql.Null { 5949 invalid = true 5950 } 5951 default: 5952 panic("unknown field " + strconv.Quote(field.Name)) 5953 } 5954 } 5955 5956 if invalid { 5957 return graphql.Null 5958 } 5959 return out 5960 } 5961 5962 // nolint: vetshadow 5963 func (ec *executionContext) _SpecieEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.SpecieEdge) graphql.Marshaler { 5964 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5965 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5966 rctx := &graphql.ResolverContext{ 5967 Object: "SpecieEdge", 5968 Args: nil, 5969 Field: field, 5970 } 5971 ctx = graphql.WithResolverContext(ctx, rctx) 5972 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 5973 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 5974 ctx = rctx // use context from middleware stack in children 5975 return obj.Node, nil 5976 }) 5977 if resTmp == nil { 5978 return graphql.Null 5979 } 5980 res := resTmp.(*model.Specie) 5981 rctx.Result = res 5982 ctx = ec.Tracer.StartFieldChildExecution(ctx) 5983 5984 if res == nil { 5985 return graphql.Null 5986 } 5987 5988 return ec._Specie(ctx, field.Selections, res) 5989 } 5990 5991 // nolint: vetshadow 5992 func (ec *executionContext) _SpecieEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.SpecieEdge) graphql.Marshaler { 5993 ctx = ec.Tracer.StartFieldExecution(ctx, field) 5994 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 5995 rctx := &graphql.ResolverContext{ 5996 Object: "SpecieEdge", 5997 Args: nil, 5998 Field: field, 5999 } 6000 ctx = graphql.WithResolverContext(ctx, rctx) 6001 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6002 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6003 ctx = rctx // use context from middleware stack in children 6004 return obj.Cursor, nil 6005 }) 6006 if resTmp == nil { 6007 if !ec.HasError(rctx) { 6008 ec.Errorf(ctx, "must not be null") 6009 } 6010 return graphql.Null 6011 } 6012 res := resTmp.(string) 6013 rctx.Result = res 6014 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6015 return graphql.MarshalID(res) 6016 } 6017 6018 var starshipImplementors = []string{"Starship"} 6019 6020 // nolint: gocyclo, errcheck, gas, goconst 6021 func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, obj *model.Starship) graphql.Marshaler { 6022 fields := graphql.CollectFields(ctx, sel, starshipImplementors) 6023 6024 out := graphql.NewOrderedMap(len(fields)) 6025 invalid := false 6026 for i, field := range fields { 6027 out.Keys[i] = field.Alias 6028 6029 switch field.Name { 6030 case "__typename": 6031 out.Values[i] = graphql.MarshalString("Starship") 6032 case "id": 6033 out.Values[i] = ec._Starship_id(ctx, field, obj) 6034 if out.Values[i] == graphql.Null { 6035 invalid = true 6036 } 6037 case "name": 6038 out.Values[i] = ec._Starship_name(ctx, field, obj) 6039 if out.Values[i] == graphql.Null { 6040 invalid = true 6041 } 6042 case "model": 6043 out.Values[i] = ec._Starship_model(ctx, field, obj) 6044 case "starship_class": 6045 out.Values[i] = ec._Starship_starship_class(ctx, field, obj) 6046 case "manufacturer": 6047 out.Values[i] = ec._Starship_manufacturer(ctx, field, obj) 6048 case "cost_in_credits": 6049 out.Values[i] = ec._Starship_cost_in_credits(ctx, field, obj) 6050 case "length": 6051 out.Values[i] = ec._Starship_length(ctx, field, obj) 6052 case "crew": 6053 out.Values[i] = ec._Starship_crew(ctx, field, obj) 6054 case "passengers": 6055 out.Values[i] = ec._Starship_passengers(ctx, field, obj) 6056 case "max_atmosphering_speed": 6057 out.Values[i] = ec._Starship_max_atmosphering_speed(ctx, field, obj) 6058 case "hyperdrive_rating": 6059 out.Values[i] = ec._Starship_hyperdrive_rating(ctx, field, obj) 6060 case "MGLT": 6061 out.Values[i] = ec._Starship_MGLT(ctx, field, obj) 6062 case "cargo_capacity": 6063 out.Values[i] = ec._Starship_cargo_capacity(ctx, field, obj) 6064 case "consumables": 6065 out.Values[i] = ec._Starship_consumables(ctx, field, obj) 6066 case "films": 6067 out.Values[i] = ec._Starship_films(ctx, field, obj) 6068 case "pilots": 6069 out.Values[i] = ec._Starship_pilots(ctx, field, obj) 6070 default: 6071 panic("unknown field " + strconv.Quote(field.Name)) 6072 } 6073 } 6074 6075 if invalid { 6076 return graphql.Null 6077 } 6078 return out 6079 } 6080 6081 // nolint: vetshadow 6082 func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6083 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6084 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6085 rctx := &graphql.ResolverContext{ 6086 Object: "Starship", 6087 Args: nil, 6088 Field: field, 6089 } 6090 ctx = graphql.WithResolverContext(ctx, rctx) 6091 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6092 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6093 ctx = rctx // use context from middleware stack in children 6094 return obj.ID, nil 6095 }) 6096 if resTmp == nil { 6097 if !ec.HasError(rctx) { 6098 ec.Errorf(ctx, "must not be null") 6099 } 6100 return graphql.Null 6101 } 6102 res := resTmp.(string) 6103 rctx.Result = res 6104 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6105 return graphql.MarshalID(res) 6106 } 6107 6108 // nolint: vetshadow 6109 func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6110 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6111 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6112 rctx := &graphql.ResolverContext{ 6113 Object: "Starship", 6114 Args: nil, 6115 Field: field, 6116 } 6117 ctx = graphql.WithResolverContext(ctx, rctx) 6118 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6119 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6120 ctx = rctx // use context from middleware stack in children 6121 return obj.Name, nil 6122 }) 6123 if resTmp == nil { 6124 if !ec.HasError(rctx) { 6125 ec.Errorf(ctx, "must not be null") 6126 } 6127 return graphql.Null 6128 } 6129 res := resTmp.(string) 6130 rctx.Result = res 6131 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6132 return graphql.MarshalString(res) 6133 } 6134 6135 // nolint: vetshadow 6136 func (ec *executionContext) _Starship_model(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6137 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6138 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6139 rctx := &graphql.ResolverContext{ 6140 Object: "Starship", 6141 Args: nil, 6142 Field: field, 6143 } 6144 ctx = graphql.WithResolverContext(ctx, rctx) 6145 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6146 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6147 ctx = rctx // use context from middleware stack in children 6148 return obj.Model, nil 6149 }) 6150 if resTmp == nil { 6151 return graphql.Null 6152 } 6153 res := resTmp.(*string) 6154 rctx.Result = res 6155 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6156 6157 if res == nil { 6158 return graphql.Null 6159 } 6160 return graphql.MarshalString(*res) 6161 } 6162 6163 // nolint: vetshadow 6164 func (ec *executionContext) _Starship_starship_class(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6165 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6166 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6167 rctx := &graphql.ResolverContext{ 6168 Object: "Starship", 6169 Args: nil, 6170 Field: field, 6171 } 6172 ctx = graphql.WithResolverContext(ctx, rctx) 6173 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6174 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6175 ctx = rctx // use context from middleware stack in children 6176 return obj.StarshipClass, nil 6177 }) 6178 if resTmp == nil { 6179 return graphql.Null 6180 } 6181 res := resTmp.(*string) 6182 rctx.Result = res 6183 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6184 6185 if res == nil { 6186 return graphql.Null 6187 } 6188 return graphql.MarshalString(*res) 6189 } 6190 6191 // nolint: vetshadow 6192 func (ec *executionContext) _Starship_manufacturer(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6193 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6194 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6195 rctx := &graphql.ResolverContext{ 6196 Object: "Starship", 6197 Args: nil, 6198 Field: field, 6199 } 6200 ctx = graphql.WithResolverContext(ctx, rctx) 6201 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6202 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6203 ctx = rctx // use context from middleware stack in children 6204 return obj.Manufacturer, nil 6205 }) 6206 if resTmp == nil { 6207 return graphql.Null 6208 } 6209 res := resTmp.(*string) 6210 rctx.Result = res 6211 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6212 6213 if res == nil { 6214 return graphql.Null 6215 } 6216 return graphql.MarshalString(*res) 6217 } 6218 6219 // nolint: vetshadow 6220 func (ec *executionContext) _Starship_cost_in_credits(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6221 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6222 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6223 rctx := &graphql.ResolverContext{ 6224 Object: "Starship", 6225 Args: nil, 6226 Field: field, 6227 } 6228 ctx = graphql.WithResolverContext(ctx, rctx) 6229 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6230 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6231 ctx = rctx // use context from middleware stack in children 6232 return obj.CostInCredits, nil 6233 }) 6234 if resTmp == nil { 6235 return graphql.Null 6236 } 6237 res := resTmp.(*string) 6238 rctx.Result = res 6239 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6240 6241 if res == nil { 6242 return graphql.Null 6243 } 6244 return graphql.MarshalString(*res) 6245 } 6246 6247 // nolint: vetshadow 6248 func (ec *executionContext) _Starship_length(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6249 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6250 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6251 rctx := &graphql.ResolverContext{ 6252 Object: "Starship", 6253 Args: nil, 6254 Field: field, 6255 } 6256 ctx = graphql.WithResolverContext(ctx, rctx) 6257 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6258 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6259 ctx = rctx // use context from middleware stack in children 6260 return obj.Length, nil 6261 }) 6262 if resTmp == nil { 6263 return graphql.Null 6264 } 6265 res := resTmp.(*string) 6266 rctx.Result = res 6267 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6268 6269 if res == nil { 6270 return graphql.Null 6271 } 6272 return graphql.MarshalString(*res) 6273 } 6274 6275 // nolint: vetshadow 6276 func (ec *executionContext) _Starship_crew(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6277 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6278 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6279 rctx := &graphql.ResolverContext{ 6280 Object: "Starship", 6281 Args: nil, 6282 Field: field, 6283 } 6284 ctx = graphql.WithResolverContext(ctx, rctx) 6285 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6286 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6287 ctx = rctx // use context from middleware stack in children 6288 return obj.Crew, nil 6289 }) 6290 if resTmp == nil { 6291 return graphql.Null 6292 } 6293 res := resTmp.(*string) 6294 rctx.Result = res 6295 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6296 6297 if res == nil { 6298 return graphql.Null 6299 } 6300 return graphql.MarshalString(*res) 6301 } 6302 6303 // nolint: vetshadow 6304 func (ec *executionContext) _Starship_passengers(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6305 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6306 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6307 rctx := &graphql.ResolverContext{ 6308 Object: "Starship", 6309 Args: nil, 6310 Field: field, 6311 } 6312 ctx = graphql.WithResolverContext(ctx, rctx) 6313 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6314 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6315 ctx = rctx // use context from middleware stack in children 6316 return obj.Passengers, nil 6317 }) 6318 if resTmp == nil { 6319 return graphql.Null 6320 } 6321 res := resTmp.(*string) 6322 rctx.Result = res 6323 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6324 6325 if res == nil { 6326 return graphql.Null 6327 } 6328 return graphql.MarshalString(*res) 6329 } 6330 6331 // nolint: vetshadow 6332 func (ec *executionContext) _Starship_max_atmosphering_speed(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6333 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6334 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6335 rctx := &graphql.ResolverContext{ 6336 Object: "Starship", 6337 Args: nil, 6338 Field: field, 6339 } 6340 ctx = graphql.WithResolverContext(ctx, rctx) 6341 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6342 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6343 ctx = rctx // use context from middleware stack in children 6344 return obj.MaxAtmospheringSpeed, nil 6345 }) 6346 if resTmp == nil { 6347 return graphql.Null 6348 } 6349 res := resTmp.(*string) 6350 rctx.Result = res 6351 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6352 6353 if res == nil { 6354 return graphql.Null 6355 } 6356 return graphql.MarshalString(*res) 6357 } 6358 6359 // nolint: vetshadow 6360 func (ec *executionContext) _Starship_hyperdrive_rating(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6361 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6362 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6363 rctx := &graphql.ResolverContext{ 6364 Object: "Starship", 6365 Args: nil, 6366 Field: field, 6367 } 6368 ctx = graphql.WithResolverContext(ctx, rctx) 6369 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6370 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6371 ctx = rctx // use context from middleware stack in children 6372 return obj.HyperdriveRating, nil 6373 }) 6374 if resTmp == nil { 6375 return graphql.Null 6376 } 6377 res := resTmp.(*string) 6378 rctx.Result = res 6379 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6380 6381 if res == nil { 6382 return graphql.Null 6383 } 6384 return graphql.MarshalString(*res) 6385 } 6386 6387 // nolint: vetshadow 6388 func (ec *executionContext) _Starship_MGLT(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6389 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6390 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6391 rctx := &graphql.ResolverContext{ 6392 Object: "Starship", 6393 Args: nil, 6394 Field: field, 6395 } 6396 ctx = graphql.WithResolverContext(ctx, rctx) 6397 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6398 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6399 ctx = rctx // use context from middleware stack in children 6400 return obj.MGLT, nil 6401 }) 6402 if resTmp == nil { 6403 return graphql.Null 6404 } 6405 res := resTmp.(*string) 6406 rctx.Result = res 6407 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6408 6409 if res == nil { 6410 return graphql.Null 6411 } 6412 return graphql.MarshalString(*res) 6413 } 6414 6415 // nolint: vetshadow 6416 func (ec *executionContext) _Starship_cargo_capacity(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6417 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6418 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6419 rctx := &graphql.ResolverContext{ 6420 Object: "Starship", 6421 Args: nil, 6422 Field: field, 6423 } 6424 ctx = graphql.WithResolverContext(ctx, rctx) 6425 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6426 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6427 ctx = rctx // use context from middleware stack in children 6428 return obj.CargoCapacity, nil 6429 }) 6430 if resTmp == nil { 6431 return graphql.Null 6432 } 6433 res := resTmp.(*string) 6434 rctx.Result = res 6435 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6436 6437 if res == nil { 6438 return graphql.Null 6439 } 6440 return graphql.MarshalString(*res) 6441 } 6442 6443 // nolint: vetshadow 6444 func (ec *executionContext) _Starship_consumables(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6445 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6446 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6447 rctx := &graphql.ResolverContext{ 6448 Object: "Starship", 6449 Args: nil, 6450 Field: field, 6451 } 6452 ctx = graphql.WithResolverContext(ctx, rctx) 6453 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6454 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6455 ctx = rctx // use context from middleware stack in children 6456 return obj.Consumables, nil 6457 }) 6458 if resTmp == nil { 6459 return graphql.Null 6460 } 6461 res := resTmp.(*string) 6462 rctx.Result = res 6463 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6464 6465 if res == nil { 6466 return graphql.Null 6467 } 6468 return graphql.MarshalString(*res) 6469 } 6470 6471 // nolint: vetshadow 6472 func (ec *executionContext) _Starship_films(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6473 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6474 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6475 rctx := &graphql.ResolverContext{ 6476 Object: "Starship", 6477 Args: nil, 6478 Field: field, 6479 } 6480 ctx = graphql.WithResolverContext(ctx, rctx) 6481 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6482 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6483 ctx = rctx // use context from middleware stack in children 6484 return obj.Films, nil 6485 }) 6486 if resTmp == nil { 6487 return graphql.Null 6488 } 6489 res := resTmp.([]*model.Film) 6490 rctx.Result = res 6491 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6492 6493 arr1 := make(graphql.Array, len(res)) 6494 var wg sync.WaitGroup 6495 6496 isLen1 := len(res) == 1 6497 if !isLen1 { 6498 wg.Add(len(res)) 6499 } 6500 6501 for idx1 := range res { 6502 idx1 := idx1 6503 rctx := &graphql.ResolverContext{ 6504 Index: &idx1, 6505 Result: res[idx1], 6506 } 6507 ctx := graphql.WithResolverContext(ctx, rctx) 6508 f := func(idx1 int) { 6509 if !isLen1 { 6510 defer wg.Done() 6511 } 6512 arr1[idx1] = func() graphql.Marshaler { 6513 6514 if res[idx1] == nil { 6515 return graphql.Null 6516 } 6517 6518 return ec._Film(ctx, field.Selections, res[idx1]) 6519 }() 6520 } 6521 if isLen1 { 6522 f(idx1) 6523 } else { 6524 go f(idx1) 6525 } 6526 6527 } 6528 wg.Wait() 6529 return arr1 6530 } 6531 6532 // nolint: vetshadow 6533 func (ec *executionContext) _Starship_pilots(ctx context.Context, field graphql.CollectedField, obj *model.Starship) graphql.Marshaler { 6534 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6535 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6536 rctx := &graphql.ResolverContext{ 6537 Object: "Starship", 6538 Args: nil, 6539 Field: field, 6540 } 6541 ctx = graphql.WithResolverContext(ctx, rctx) 6542 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6543 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6544 ctx = rctx // use context from middleware stack in children 6545 return obj.Pilots, nil 6546 }) 6547 if resTmp == nil { 6548 return graphql.Null 6549 } 6550 res := resTmp.([]*model.People) 6551 rctx.Result = res 6552 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6553 6554 arr1 := make(graphql.Array, len(res)) 6555 var wg sync.WaitGroup 6556 6557 isLen1 := len(res) == 1 6558 if !isLen1 { 6559 wg.Add(len(res)) 6560 } 6561 6562 for idx1 := range res { 6563 idx1 := idx1 6564 rctx := &graphql.ResolverContext{ 6565 Index: &idx1, 6566 Result: res[idx1], 6567 } 6568 ctx := graphql.WithResolverContext(ctx, rctx) 6569 f := func(idx1 int) { 6570 if !isLen1 { 6571 defer wg.Done() 6572 } 6573 arr1[idx1] = func() graphql.Marshaler { 6574 6575 if res[idx1] == nil { 6576 return graphql.Null 6577 } 6578 6579 return ec._People(ctx, field.Selections, res[idx1]) 6580 }() 6581 } 6582 if isLen1 { 6583 f(idx1) 6584 } else { 6585 go f(idx1) 6586 } 6587 6588 } 6589 wg.Wait() 6590 return arr1 6591 } 6592 6593 var starshipConnectionImplementors = []string{"StarshipConnection"} 6594 6595 // nolint: gocyclo, errcheck, gas, goconst 6596 func (ec *executionContext) _StarshipConnection(ctx context.Context, sel ast.SelectionSet, obj *model.StarshipConnection) graphql.Marshaler { 6597 fields := graphql.CollectFields(ctx, sel, starshipConnectionImplementors) 6598 6599 out := graphql.NewOrderedMap(len(fields)) 6600 invalid := false 6601 for i, field := range fields { 6602 out.Keys[i] = field.Alias 6603 6604 switch field.Name { 6605 case "__typename": 6606 out.Values[i] = graphql.MarshalString("StarshipConnection") 6607 case "pageInfo": 6608 out.Values[i] = ec._StarshipConnection_pageInfo(ctx, field, obj) 6609 if out.Values[i] == graphql.Null { 6610 invalid = true 6611 } 6612 case "edges": 6613 out.Values[i] = ec._StarshipConnection_edges(ctx, field, obj) 6614 case "totalCount": 6615 out.Values[i] = ec._StarshipConnection_totalCount(ctx, field, obj) 6616 if out.Values[i] == graphql.Null { 6617 invalid = true 6618 } 6619 default: 6620 panic("unknown field " + strconv.Quote(field.Name)) 6621 } 6622 } 6623 6624 if invalid { 6625 return graphql.Null 6626 } 6627 return out 6628 } 6629 6630 // nolint: vetshadow 6631 func (ec *executionContext) _StarshipConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.StarshipConnection) graphql.Marshaler { 6632 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6633 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6634 rctx := &graphql.ResolverContext{ 6635 Object: "StarshipConnection", 6636 Args: nil, 6637 Field: field, 6638 } 6639 ctx = graphql.WithResolverContext(ctx, rctx) 6640 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6641 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6642 ctx = rctx // use context from middleware stack in children 6643 return obj.PageInfo, nil 6644 }) 6645 if resTmp == nil { 6646 if !ec.HasError(rctx) { 6647 ec.Errorf(ctx, "must not be null") 6648 } 6649 return graphql.Null 6650 } 6651 res := resTmp.(model.PageInfo) 6652 rctx.Result = res 6653 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6654 6655 return ec._PageInfo(ctx, field.Selections, &res) 6656 } 6657 6658 // nolint: vetshadow 6659 func (ec *executionContext) _StarshipConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.StarshipConnection) graphql.Marshaler { 6660 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6661 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6662 rctx := &graphql.ResolverContext{ 6663 Object: "StarshipConnection", 6664 Args: nil, 6665 Field: field, 6666 } 6667 ctx = graphql.WithResolverContext(ctx, rctx) 6668 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6669 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6670 ctx = rctx // use context from middleware stack in children 6671 return obj.Edges, nil 6672 }) 6673 if resTmp == nil { 6674 return graphql.Null 6675 } 6676 res := resTmp.([]model.StarshipEdge) 6677 rctx.Result = res 6678 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6679 6680 arr1 := make(graphql.Array, len(res)) 6681 var wg sync.WaitGroup 6682 6683 isLen1 := len(res) == 1 6684 if !isLen1 { 6685 wg.Add(len(res)) 6686 } 6687 6688 for idx1 := range res { 6689 idx1 := idx1 6690 rctx := &graphql.ResolverContext{ 6691 Index: &idx1, 6692 Result: &res[idx1], 6693 } 6694 ctx := graphql.WithResolverContext(ctx, rctx) 6695 f := func(idx1 int) { 6696 if !isLen1 { 6697 defer wg.Done() 6698 } 6699 arr1[idx1] = func() graphql.Marshaler { 6700 6701 return ec._StarshipEdge(ctx, field.Selections, &res[idx1]) 6702 }() 6703 } 6704 if isLen1 { 6705 f(idx1) 6706 } else { 6707 go f(idx1) 6708 } 6709 6710 } 6711 wg.Wait() 6712 return arr1 6713 } 6714 6715 // nolint: vetshadow 6716 func (ec *executionContext) _StarshipConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.StarshipConnection) graphql.Marshaler { 6717 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6718 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6719 rctx := &graphql.ResolverContext{ 6720 Object: "StarshipConnection", 6721 Args: nil, 6722 Field: field, 6723 } 6724 ctx = graphql.WithResolverContext(ctx, rctx) 6725 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6726 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6727 ctx = rctx // use context from middleware stack in children 6728 return obj.TotalCount, nil 6729 }) 6730 if resTmp == nil { 6731 if !ec.HasError(rctx) { 6732 ec.Errorf(ctx, "must not be null") 6733 } 6734 return graphql.Null 6735 } 6736 res := resTmp.(int) 6737 rctx.Result = res 6738 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6739 return graphql.MarshalInt(res) 6740 } 6741 6742 var starshipEdgeImplementors = []string{"StarshipEdge"} 6743 6744 // nolint: gocyclo, errcheck, gas, goconst 6745 func (ec *executionContext) _StarshipEdge(ctx context.Context, sel ast.SelectionSet, obj *model.StarshipEdge) graphql.Marshaler { 6746 fields := graphql.CollectFields(ctx, sel, starshipEdgeImplementors) 6747 6748 out := graphql.NewOrderedMap(len(fields)) 6749 invalid := false 6750 for i, field := range fields { 6751 out.Keys[i] = field.Alias 6752 6753 switch field.Name { 6754 case "__typename": 6755 out.Values[i] = graphql.MarshalString("StarshipEdge") 6756 case "node": 6757 out.Values[i] = ec._StarshipEdge_node(ctx, field, obj) 6758 case "cursor": 6759 out.Values[i] = ec._StarshipEdge_cursor(ctx, field, obj) 6760 if out.Values[i] == graphql.Null { 6761 invalid = true 6762 } 6763 default: 6764 panic("unknown field " + strconv.Quote(field.Name)) 6765 } 6766 } 6767 6768 if invalid { 6769 return graphql.Null 6770 } 6771 return out 6772 } 6773 6774 // nolint: vetshadow 6775 func (ec *executionContext) _StarshipEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.StarshipEdge) graphql.Marshaler { 6776 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6777 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6778 rctx := &graphql.ResolverContext{ 6779 Object: "StarshipEdge", 6780 Args: nil, 6781 Field: field, 6782 } 6783 ctx = graphql.WithResolverContext(ctx, rctx) 6784 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6785 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6786 ctx = rctx // use context from middleware stack in children 6787 return obj.Node, nil 6788 }) 6789 if resTmp == nil { 6790 return graphql.Null 6791 } 6792 res := resTmp.(*model.Starship) 6793 rctx.Result = res 6794 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6795 6796 if res == nil { 6797 return graphql.Null 6798 } 6799 6800 return ec._Starship(ctx, field.Selections, res) 6801 } 6802 6803 // nolint: vetshadow 6804 func (ec *executionContext) _StarshipEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.StarshipEdge) graphql.Marshaler { 6805 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6806 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6807 rctx := &graphql.ResolverContext{ 6808 Object: "StarshipEdge", 6809 Args: nil, 6810 Field: field, 6811 } 6812 ctx = graphql.WithResolverContext(ctx, rctx) 6813 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6814 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6815 ctx = rctx // use context from middleware stack in children 6816 return obj.Cursor, nil 6817 }) 6818 if resTmp == nil { 6819 if !ec.HasError(rctx) { 6820 ec.Errorf(ctx, "must not be null") 6821 } 6822 return graphql.Null 6823 } 6824 res := resTmp.(string) 6825 rctx.Result = res 6826 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6827 return graphql.MarshalID(res) 6828 } 6829 6830 var vehicleImplementors = []string{"Vehicle"} 6831 6832 // nolint: gocyclo, errcheck, gas, goconst 6833 func (ec *executionContext) _Vehicle(ctx context.Context, sel ast.SelectionSet, obj *model.Vehicle) graphql.Marshaler { 6834 fields := graphql.CollectFields(ctx, sel, vehicleImplementors) 6835 6836 out := graphql.NewOrderedMap(len(fields)) 6837 invalid := false 6838 for i, field := range fields { 6839 out.Keys[i] = field.Alias 6840 6841 switch field.Name { 6842 case "__typename": 6843 out.Values[i] = graphql.MarshalString("Vehicle") 6844 case "id": 6845 out.Values[i] = ec._Vehicle_id(ctx, field, obj) 6846 if out.Values[i] == graphql.Null { 6847 invalid = true 6848 } 6849 case "name": 6850 out.Values[i] = ec._Vehicle_name(ctx, field, obj) 6851 if out.Values[i] == graphql.Null { 6852 invalid = true 6853 } 6854 case "model": 6855 out.Values[i] = ec._Vehicle_model(ctx, field, obj) 6856 case "vehicle_class": 6857 out.Values[i] = ec._Vehicle_vehicle_class(ctx, field, obj) 6858 case "manufacturer": 6859 out.Values[i] = ec._Vehicle_manufacturer(ctx, field, obj) 6860 case "length": 6861 out.Values[i] = ec._Vehicle_length(ctx, field, obj) 6862 case "cost_in_credits": 6863 out.Values[i] = ec._Vehicle_cost_in_credits(ctx, field, obj) 6864 case "crew": 6865 out.Values[i] = ec._Vehicle_crew(ctx, field, obj) 6866 case "passengers": 6867 out.Values[i] = ec._Vehicle_passengers(ctx, field, obj) 6868 case "max_atmosphering_speed": 6869 out.Values[i] = ec._Vehicle_max_atmosphering_speed(ctx, field, obj) 6870 case "cargo_capacity": 6871 out.Values[i] = ec._Vehicle_cargo_capacity(ctx, field, obj) 6872 case "consumables": 6873 out.Values[i] = ec._Vehicle_consumables(ctx, field, obj) 6874 case "films": 6875 out.Values[i] = ec._Vehicle_films(ctx, field, obj) 6876 case "pilots": 6877 out.Values[i] = ec._Vehicle_pilots(ctx, field, obj) 6878 default: 6879 panic("unknown field " + strconv.Quote(field.Name)) 6880 } 6881 } 6882 6883 if invalid { 6884 return graphql.Null 6885 } 6886 return out 6887 } 6888 6889 // nolint: vetshadow 6890 func (ec *executionContext) _Vehicle_id(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 6891 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6892 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6893 rctx := &graphql.ResolverContext{ 6894 Object: "Vehicle", 6895 Args: nil, 6896 Field: field, 6897 } 6898 ctx = graphql.WithResolverContext(ctx, rctx) 6899 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6900 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6901 ctx = rctx // use context from middleware stack in children 6902 return obj.ID, nil 6903 }) 6904 if resTmp == nil { 6905 if !ec.HasError(rctx) { 6906 ec.Errorf(ctx, "must not be null") 6907 } 6908 return graphql.Null 6909 } 6910 res := resTmp.(string) 6911 rctx.Result = res 6912 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6913 return graphql.MarshalID(res) 6914 } 6915 6916 // nolint: vetshadow 6917 func (ec *executionContext) _Vehicle_name(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 6918 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6919 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6920 rctx := &graphql.ResolverContext{ 6921 Object: "Vehicle", 6922 Args: nil, 6923 Field: field, 6924 } 6925 ctx = graphql.WithResolverContext(ctx, rctx) 6926 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6927 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6928 ctx = rctx // use context from middleware stack in children 6929 return obj.Name, nil 6930 }) 6931 if resTmp == nil { 6932 if !ec.HasError(rctx) { 6933 ec.Errorf(ctx, "must not be null") 6934 } 6935 return graphql.Null 6936 } 6937 res := resTmp.(string) 6938 rctx.Result = res 6939 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6940 return graphql.MarshalString(res) 6941 } 6942 6943 // nolint: vetshadow 6944 func (ec *executionContext) _Vehicle_model(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 6945 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6946 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6947 rctx := &graphql.ResolverContext{ 6948 Object: "Vehicle", 6949 Args: nil, 6950 Field: field, 6951 } 6952 ctx = graphql.WithResolverContext(ctx, rctx) 6953 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6954 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6955 ctx = rctx // use context from middleware stack in children 6956 return obj.Model, nil 6957 }) 6958 if resTmp == nil { 6959 return graphql.Null 6960 } 6961 res := resTmp.(*string) 6962 rctx.Result = res 6963 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6964 6965 if res == nil { 6966 return graphql.Null 6967 } 6968 return graphql.MarshalString(*res) 6969 } 6970 6971 // nolint: vetshadow 6972 func (ec *executionContext) _Vehicle_vehicle_class(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 6973 ctx = ec.Tracer.StartFieldExecution(ctx, field) 6974 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 6975 rctx := &graphql.ResolverContext{ 6976 Object: "Vehicle", 6977 Args: nil, 6978 Field: field, 6979 } 6980 ctx = graphql.WithResolverContext(ctx, rctx) 6981 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 6982 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 6983 ctx = rctx // use context from middleware stack in children 6984 return obj.VehicleClass, nil 6985 }) 6986 if resTmp == nil { 6987 return graphql.Null 6988 } 6989 res := resTmp.(*model.VehicleClass) 6990 rctx.Result = res 6991 ctx = ec.Tracer.StartFieldChildExecution(ctx) 6992 6993 if res == nil { 6994 return graphql.Null 6995 } 6996 return *res 6997 } 6998 6999 // nolint: vetshadow 7000 func (ec *executionContext) _Vehicle_manufacturer(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7001 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7002 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7003 rctx := &graphql.ResolverContext{ 7004 Object: "Vehicle", 7005 Args: nil, 7006 Field: field, 7007 } 7008 ctx = graphql.WithResolverContext(ctx, rctx) 7009 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7010 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7011 ctx = rctx // use context from middleware stack in children 7012 return obj.Manufacturer, nil 7013 }) 7014 if resTmp == nil { 7015 return graphql.Null 7016 } 7017 res := resTmp.(*string) 7018 rctx.Result = res 7019 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7020 7021 if res == nil { 7022 return graphql.Null 7023 } 7024 return graphql.MarshalString(*res) 7025 } 7026 7027 // nolint: vetshadow 7028 func (ec *executionContext) _Vehicle_length(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7029 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7030 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7031 rctx := &graphql.ResolverContext{ 7032 Object: "Vehicle", 7033 Args: nil, 7034 Field: field, 7035 } 7036 ctx = graphql.WithResolverContext(ctx, rctx) 7037 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7038 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7039 ctx = rctx // use context from middleware stack in children 7040 return obj.Length, nil 7041 }) 7042 if resTmp == nil { 7043 return graphql.Null 7044 } 7045 res := resTmp.(*string) 7046 rctx.Result = res 7047 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7048 7049 if res == nil { 7050 return graphql.Null 7051 } 7052 return graphql.MarshalString(*res) 7053 } 7054 7055 // nolint: vetshadow 7056 func (ec *executionContext) _Vehicle_cost_in_credits(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7057 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7058 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7059 rctx := &graphql.ResolverContext{ 7060 Object: "Vehicle", 7061 Args: nil, 7062 Field: field, 7063 } 7064 ctx = graphql.WithResolverContext(ctx, rctx) 7065 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7066 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7067 ctx = rctx // use context from middleware stack in children 7068 return obj.CostInCredits, nil 7069 }) 7070 if resTmp == nil { 7071 return graphql.Null 7072 } 7073 res := resTmp.(*string) 7074 rctx.Result = res 7075 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7076 7077 if res == nil { 7078 return graphql.Null 7079 } 7080 return graphql.MarshalString(*res) 7081 } 7082 7083 // nolint: vetshadow 7084 func (ec *executionContext) _Vehicle_crew(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7085 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7086 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7087 rctx := &graphql.ResolverContext{ 7088 Object: "Vehicle", 7089 Args: nil, 7090 Field: field, 7091 } 7092 ctx = graphql.WithResolverContext(ctx, rctx) 7093 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7094 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7095 ctx = rctx // use context from middleware stack in children 7096 return obj.Crew, nil 7097 }) 7098 if resTmp == nil { 7099 return graphql.Null 7100 } 7101 res := resTmp.(*string) 7102 rctx.Result = res 7103 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7104 7105 if res == nil { 7106 return graphql.Null 7107 } 7108 return graphql.MarshalString(*res) 7109 } 7110 7111 // nolint: vetshadow 7112 func (ec *executionContext) _Vehicle_passengers(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7113 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7114 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7115 rctx := &graphql.ResolverContext{ 7116 Object: "Vehicle", 7117 Args: nil, 7118 Field: field, 7119 } 7120 ctx = graphql.WithResolverContext(ctx, rctx) 7121 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7122 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7123 ctx = rctx // use context from middleware stack in children 7124 return obj.Passengers, nil 7125 }) 7126 if resTmp == nil { 7127 return graphql.Null 7128 } 7129 res := resTmp.(*string) 7130 rctx.Result = res 7131 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7132 7133 if res == nil { 7134 return graphql.Null 7135 } 7136 return graphql.MarshalString(*res) 7137 } 7138 7139 // nolint: vetshadow 7140 func (ec *executionContext) _Vehicle_max_atmosphering_speed(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7141 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7142 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7143 rctx := &graphql.ResolverContext{ 7144 Object: "Vehicle", 7145 Args: nil, 7146 Field: field, 7147 } 7148 ctx = graphql.WithResolverContext(ctx, rctx) 7149 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7150 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7151 ctx = rctx // use context from middleware stack in children 7152 return obj.MaxAtmospheringSpeed, nil 7153 }) 7154 if resTmp == nil { 7155 return graphql.Null 7156 } 7157 res := resTmp.(*string) 7158 rctx.Result = res 7159 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7160 7161 if res == nil { 7162 return graphql.Null 7163 } 7164 return graphql.MarshalString(*res) 7165 } 7166 7167 // nolint: vetshadow 7168 func (ec *executionContext) _Vehicle_cargo_capacity(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7169 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7170 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7171 rctx := &graphql.ResolverContext{ 7172 Object: "Vehicle", 7173 Args: nil, 7174 Field: field, 7175 } 7176 ctx = graphql.WithResolverContext(ctx, rctx) 7177 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7178 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7179 ctx = rctx // use context from middleware stack in children 7180 return obj.CargoCapacity, nil 7181 }) 7182 if resTmp == nil { 7183 return graphql.Null 7184 } 7185 res := resTmp.(*string) 7186 rctx.Result = res 7187 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7188 7189 if res == nil { 7190 return graphql.Null 7191 } 7192 return graphql.MarshalString(*res) 7193 } 7194 7195 // nolint: vetshadow 7196 func (ec *executionContext) _Vehicle_consumables(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7197 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7198 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7199 rctx := &graphql.ResolverContext{ 7200 Object: "Vehicle", 7201 Args: nil, 7202 Field: field, 7203 } 7204 ctx = graphql.WithResolverContext(ctx, rctx) 7205 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7206 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7207 ctx = rctx // use context from middleware stack in children 7208 return obj.Consumables, nil 7209 }) 7210 if resTmp == nil { 7211 return graphql.Null 7212 } 7213 res := resTmp.(*string) 7214 rctx.Result = res 7215 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7216 7217 if res == nil { 7218 return graphql.Null 7219 } 7220 return graphql.MarshalString(*res) 7221 } 7222 7223 // nolint: vetshadow 7224 func (ec *executionContext) _Vehicle_films(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7225 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7226 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7227 rctx := &graphql.ResolverContext{ 7228 Object: "Vehicle", 7229 Args: nil, 7230 Field: field, 7231 } 7232 ctx = graphql.WithResolverContext(ctx, rctx) 7233 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7234 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7235 ctx = rctx // use context from middleware stack in children 7236 return obj.Films, nil 7237 }) 7238 if resTmp == nil { 7239 return graphql.Null 7240 } 7241 res := resTmp.([]*model.Film) 7242 rctx.Result = res 7243 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7244 7245 arr1 := make(graphql.Array, len(res)) 7246 var wg sync.WaitGroup 7247 7248 isLen1 := len(res) == 1 7249 if !isLen1 { 7250 wg.Add(len(res)) 7251 } 7252 7253 for idx1 := range res { 7254 idx1 := idx1 7255 rctx := &graphql.ResolverContext{ 7256 Index: &idx1, 7257 Result: res[idx1], 7258 } 7259 ctx := graphql.WithResolverContext(ctx, rctx) 7260 f := func(idx1 int) { 7261 if !isLen1 { 7262 defer wg.Done() 7263 } 7264 arr1[idx1] = func() graphql.Marshaler { 7265 7266 if res[idx1] == nil { 7267 return graphql.Null 7268 } 7269 7270 return ec._Film(ctx, field.Selections, res[idx1]) 7271 }() 7272 } 7273 if isLen1 { 7274 f(idx1) 7275 } else { 7276 go f(idx1) 7277 } 7278 7279 } 7280 wg.Wait() 7281 return arr1 7282 } 7283 7284 // nolint: vetshadow 7285 func (ec *executionContext) _Vehicle_pilots(ctx context.Context, field graphql.CollectedField, obj *model.Vehicle) graphql.Marshaler { 7286 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7287 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7288 rctx := &graphql.ResolverContext{ 7289 Object: "Vehicle", 7290 Args: nil, 7291 Field: field, 7292 } 7293 ctx = graphql.WithResolverContext(ctx, rctx) 7294 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7295 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7296 ctx = rctx // use context from middleware stack in children 7297 return obj.Pilots, nil 7298 }) 7299 if resTmp == nil { 7300 return graphql.Null 7301 } 7302 res := resTmp.([]*model.People) 7303 rctx.Result = res 7304 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7305 7306 arr1 := make(graphql.Array, len(res)) 7307 var wg sync.WaitGroup 7308 7309 isLen1 := len(res) == 1 7310 if !isLen1 { 7311 wg.Add(len(res)) 7312 } 7313 7314 for idx1 := range res { 7315 idx1 := idx1 7316 rctx := &graphql.ResolverContext{ 7317 Index: &idx1, 7318 Result: res[idx1], 7319 } 7320 ctx := graphql.WithResolverContext(ctx, rctx) 7321 f := func(idx1 int) { 7322 if !isLen1 { 7323 defer wg.Done() 7324 } 7325 arr1[idx1] = func() graphql.Marshaler { 7326 7327 if res[idx1] == nil { 7328 return graphql.Null 7329 } 7330 7331 return ec._People(ctx, field.Selections, res[idx1]) 7332 }() 7333 } 7334 if isLen1 { 7335 f(idx1) 7336 } else { 7337 go f(idx1) 7338 } 7339 7340 } 7341 wg.Wait() 7342 return arr1 7343 } 7344 7345 var vehicleConnectionImplementors = []string{"VehicleConnection"} 7346 7347 // nolint: gocyclo, errcheck, gas, goconst 7348 func (ec *executionContext) _VehicleConnection(ctx context.Context, sel ast.SelectionSet, obj *model.VehicleConnection) graphql.Marshaler { 7349 fields := graphql.CollectFields(ctx, sel, vehicleConnectionImplementors) 7350 7351 out := graphql.NewOrderedMap(len(fields)) 7352 invalid := false 7353 for i, field := range fields { 7354 out.Keys[i] = field.Alias 7355 7356 switch field.Name { 7357 case "__typename": 7358 out.Values[i] = graphql.MarshalString("VehicleConnection") 7359 case "pageInfo": 7360 out.Values[i] = ec._VehicleConnection_pageInfo(ctx, field, obj) 7361 if out.Values[i] == graphql.Null { 7362 invalid = true 7363 } 7364 case "edges": 7365 out.Values[i] = ec._VehicleConnection_edges(ctx, field, obj) 7366 case "totalCount": 7367 out.Values[i] = ec._VehicleConnection_totalCount(ctx, field, obj) 7368 if out.Values[i] == graphql.Null { 7369 invalid = true 7370 } 7371 default: 7372 panic("unknown field " + strconv.Quote(field.Name)) 7373 } 7374 } 7375 7376 if invalid { 7377 return graphql.Null 7378 } 7379 return out 7380 } 7381 7382 // nolint: vetshadow 7383 func (ec *executionContext) _VehicleConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.VehicleConnection) graphql.Marshaler { 7384 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7385 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7386 rctx := &graphql.ResolverContext{ 7387 Object: "VehicleConnection", 7388 Args: nil, 7389 Field: field, 7390 } 7391 ctx = graphql.WithResolverContext(ctx, rctx) 7392 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7393 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7394 ctx = rctx // use context from middleware stack in children 7395 return obj.PageInfo, nil 7396 }) 7397 if resTmp == nil { 7398 if !ec.HasError(rctx) { 7399 ec.Errorf(ctx, "must not be null") 7400 } 7401 return graphql.Null 7402 } 7403 res := resTmp.(model.PageInfo) 7404 rctx.Result = res 7405 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7406 7407 return ec._PageInfo(ctx, field.Selections, &res) 7408 } 7409 7410 // nolint: vetshadow 7411 func (ec *executionContext) _VehicleConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.VehicleConnection) graphql.Marshaler { 7412 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7413 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7414 rctx := &graphql.ResolverContext{ 7415 Object: "VehicleConnection", 7416 Args: nil, 7417 Field: field, 7418 } 7419 ctx = graphql.WithResolverContext(ctx, rctx) 7420 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7421 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7422 ctx = rctx // use context from middleware stack in children 7423 return obj.Edges, nil 7424 }) 7425 if resTmp == nil { 7426 return graphql.Null 7427 } 7428 res := resTmp.([]model.VehicleEdge) 7429 rctx.Result = res 7430 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7431 7432 arr1 := make(graphql.Array, len(res)) 7433 var wg sync.WaitGroup 7434 7435 isLen1 := len(res) == 1 7436 if !isLen1 { 7437 wg.Add(len(res)) 7438 } 7439 7440 for idx1 := range res { 7441 idx1 := idx1 7442 rctx := &graphql.ResolverContext{ 7443 Index: &idx1, 7444 Result: &res[idx1], 7445 } 7446 ctx := graphql.WithResolverContext(ctx, rctx) 7447 f := func(idx1 int) { 7448 if !isLen1 { 7449 defer wg.Done() 7450 } 7451 arr1[idx1] = func() graphql.Marshaler { 7452 7453 return ec._VehicleEdge(ctx, field.Selections, &res[idx1]) 7454 }() 7455 } 7456 if isLen1 { 7457 f(idx1) 7458 } else { 7459 go f(idx1) 7460 } 7461 7462 } 7463 wg.Wait() 7464 return arr1 7465 } 7466 7467 // nolint: vetshadow 7468 func (ec *executionContext) _VehicleConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.VehicleConnection) graphql.Marshaler { 7469 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7470 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7471 rctx := &graphql.ResolverContext{ 7472 Object: "VehicleConnection", 7473 Args: nil, 7474 Field: field, 7475 } 7476 ctx = graphql.WithResolverContext(ctx, rctx) 7477 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7478 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7479 ctx = rctx // use context from middleware stack in children 7480 return obj.TotalCount, nil 7481 }) 7482 if resTmp == nil { 7483 if !ec.HasError(rctx) { 7484 ec.Errorf(ctx, "must not be null") 7485 } 7486 return graphql.Null 7487 } 7488 res := resTmp.(int) 7489 rctx.Result = res 7490 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7491 return graphql.MarshalInt(res) 7492 } 7493 7494 var vehicleEdgeImplementors = []string{"VehicleEdge"} 7495 7496 // nolint: gocyclo, errcheck, gas, goconst 7497 func (ec *executionContext) _VehicleEdge(ctx context.Context, sel ast.SelectionSet, obj *model.VehicleEdge) graphql.Marshaler { 7498 fields := graphql.CollectFields(ctx, sel, vehicleEdgeImplementors) 7499 7500 out := graphql.NewOrderedMap(len(fields)) 7501 invalid := false 7502 for i, field := range fields { 7503 out.Keys[i] = field.Alias 7504 7505 switch field.Name { 7506 case "__typename": 7507 out.Values[i] = graphql.MarshalString("VehicleEdge") 7508 case "node": 7509 out.Values[i] = ec._VehicleEdge_node(ctx, field, obj) 7510 case "cursor": 7511 out.Values[i] = ec._VehicleEdge_cursor(ctx, field, obj) 7512 if out.Values[i] == graphql.Null { 7513 invalid = true 7514 } 7515 default: 7516 panic("unknown field " + strconv.Quote(field.Name)) 7517 } 7518 } 7519 7520 if invalid { 7521 return graphql.Null 7522 } 7523 return out 7524 } 7525 7526 // nolint: vetshadow 7527 func (ec *executionContext) _VehicleEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.VehicleEdge) graphql.Marshaler { 7528 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7529 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7530 rctx := &graphql.ResolverContext{ 7531 Object: "VehicleEdge", 7532 Args: nil, 7533 Field: field, 7534 } 7535 ctx = graphql.WithResolverContext(ctx, rctx) 7536 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7537 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7538 ctx = rctx // use context from middleware stack in children 7539 return obj.Node, nil 7540 }) 7541 if resTmp == nil { 7542 return graphql.Null 7543 } 7544 res := resTmp.(*model.Vehicle) 7545 rctx.Result = res 7546 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7547 7548 if res == nil { 7549 return graphql.Null 7550 } 7551 7552 return ec._Vehicle(ctx, field.Selections, res) 7553 } 7554 7555 // nolint: vetshadow 7556 func (ec *executionContext) _VehicleEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.VehicleEdge) graphql.Marshaler { 7557 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7558 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7559 rctx := &graphql.ResolverContext{ 7560 Object: "VehicleEdge", 7561 Args: nil, 7562 Field: field, 7563 } 7564 ctx = graphql.WithResolverContext(ctx, rctx) 7565 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7566 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7567 ctx = rctx // use context from middleware stack in children 7568 return obj.Cursor, nil 7569 }) 7570 if resTmp == nil { 7571 if !ec.HasError(rctx) { 7572 ec.Errorf(ctx, "must not be null") 7573 } 7574 return graphql.Null 7575 } 7576 res := resTmp.(string) 7577 rctx.Result = res 7578 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7579 return graphql.MarshalID(res) 7580 } 7581 7582 var __DirectiveImplementors = []string{"__Directive"} 7583 7584 // nolint: gocyclo, errcheck, gas, goconst 7585 func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { 7586 fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) 7587 7588 out := graphql.NewOrderedMap(len(fields)) 7589 invalid := false 7590 for i, field := range fields { 7591 out.Keys[i] = field.Alias 7592 7593 switch field.Name { 7594 case "__typename": 7595 out.Values[i] = graphql.MarshalString("__Directive") 7596 case "name": 7597 out.Values[i] = ec.___Directive_name(ctx, field, obj) 7598 if out.Values[i] == graphql.Null { 7599 invalid = true 7600 } 7601 case "description": 7602 out.Values[i] = ec.___Directive_description(ctx, field, obj) 7603 case "locations": 7604 out.Values[i] = ec.___Directive_locations(ctx, field, obj) 7605 if out.Values[i] == graphql.Null { 7606 invalid = true 7607 } 7608 case "args": 7609 out.Values[i] = ec.___Directive_args(ctx, field, obj) 7610 if out.Values[i] == graphql.Null { 7611 invalid = true 7612 } 7613 default: 7614 panic("unknown field " + strconv.Quote(field.Name)) 7615 } 7616 } 7617 7618 if invalid { 7619 return graphql.Null 7620 } 7621 return out 7622 } 7623 7624 // nolint: vetshadow 7625 func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 7626 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7627 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7628 rctx := &graphql.ResolverContext{ 7629 Object: "__Directive", 7630 Args: nil, 7631 Field: field, 7632 } 7633 ctx = graphql.WithResolverContext(ctx, rctx) 7634 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7635 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7636 ctx = rctx // use context from middleware stack in children 7637 return obj.Name, nil 7638 }) 7639 if resTmp == nil { 7640 if !ec.HasError(rctx) { 7641 ec.Errorf(ctx, "must not be null") 7642 } 7643 return graphql.Null 7644 } 7645 res := resTmp.(string) 7646 rctx.Result = res 7647 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7648 return graphql.MarshalString(res) 7649 } 7650 7651 // nolint: vetshadow 7652 func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 7653 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7654 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7655 rctx := &graphql.ResolverContext{ 7656 Object: "__Directive", 7657 Args: nil, 7658 Field: field, 7659 } 7660 ctx = graphql.WithResolverContext(ctx, rctx) 7661 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7662 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7663 ctx = rctx // use context from middleware stack in children 7664 return obj.Description, nil 7665 }) 7666 if resTmp == nil { 7667 return graphql.Null 7668 } 7669 res := resTmp.(string) 7670 rctx.Result = res 7671 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7672 return graphql.MarshalString(res) 7673 } 7674 7675 // nolint: vetshadow 7676 func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 7677 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7678 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7679 rctx := &graphql.ResolverContext{ 7680 Object: "__Directive", 7681 Args: nil, 7682 Field: field, 7683 } 7684 ctx = graphql.WithResolverContext(ctx, rctx) 7685 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7686 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7687 ctx = rctx // use context from middleware stack in children 7688 return obj.Locations, nil 7689 }) 7690 if resTmp == nil { 7691 if !ec.HasError(rctx) { 7692 ec.Errorf(ctx, "must not be null") 7693 } 7694 return graphql.Null 7695 } 7696 res := resTmp.([]string) 7697 rctx.Result = res 7698 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7699 7700 arr1 := make(graphql.Array, len(res)) 7701 7702 for idx1 := range res { 7703 arr1[idx1] = func() graphql.Marshaler { 7704 return graphql.MarshalString(res[idx1]) 7705 }() 7706 } 7707 7708 return arr1 7709 } 7710 7711 // nolint: vetshadow 7712 func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 7713 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7714 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7715 rctx := &graphql.ResolverContext{ 7716 Object: "__Directive", 7717 Args: nil, 7718 Field: field, 7719 } 7720 ctx = graphql.WithResolverContext(ctx, rctx) 7721 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7722 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7723 ctx = rctx // use context from middleware stack in children 7724 return obj.Args, nil 7725 }) 7726 if resTmp == nil { 7727 if !ec.HasError(rctx) { 7728 ec.Errorf(ctx, "must not be null") 7729 } 7730 return graphql.Null 7731 } 7732 res := resTmp.([]introspection.InputValue) 7733 rctx.Result = res 7734 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7735 7736 arr1 := make(graphql.Array, len(res)) 7737 var wg sync.WaitGroup 7738 7739 isLen1 := len(res) == 1 7740 if !isLen1 { 7741 wg.Add(len(res)) 7742 } 7743 7744 for idx1 := range res { 7745 idx1 := idx1 7746 rctx := &graphql.ResolverContext{ 7747 Index: &idx1, 7748 Result: &res[idx1], 7749 } 7750 ctx := graphql.WithResolverContext(ctx, rctx) 7751 f := func(idx1 int) { 7752 if !isLen1 { 7753 defer wg.Done() 7754 } 7755 arr1[idx1] = func() graphql.Marshaler { 7756 7757 return ec.___InputValue(ctx, field.Selections, &res[idx1]) 7758 }() 7759 } 7760 if isLen1 { 7761 f(idx1) 7762 } else { 7763 go f(idx1) 7764 } 7765 7766 } 7767 wg.Wait() 7768 return arr1 7769 } 7770 7771 var __EnumValueImplementors = []string{"__EnumValue"} 7772 7773 // nolint: gocyclo, errcheck, gas, goconst 7774 func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { 7775 fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) 7776 7777 out := graphql.NewOrderedMap(len(fields)) 7778 invalid := false 7779 for i, field := range fields { 7780 out.Keys[i] = field.Alias 7781 7782 switch field.Name { 7783 case "__typename": 7784 out.Values[i] = graphql.MarshalString("__EnumValue") 7785 case "name": 7786 out.Values[i] = ec.___EnumValue_name(ctx, field, obj) 7787 if out.Values[i] == graphql.Null { 7788 invalid = true 7789 } 7790 case "description": 7791 out.Values[i] = ec.___EnumValue_description(ctx, field, obj) 7792 case "isDeprecated": 7793 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) 7794 if out.Values[i] == graphql.Null { 7795 invalid = true 7796 } 7797 case "deprecationReason": 7798 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) 7799 default: 7800 panic("unknown field " + strconv.Quote(field.Name)) 7801 } 7802 } 7803 7804 if invalid { 7805 return graphql.Null 7806 } 7807 return out 7808 } 7809 7810 // nolint: vetshadow 7811 func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 7812 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7813 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7814 rctx := &graphql.ResolverContext{ 7815 Object: "__EnumValue", 7816 Args: nil, 7817 Field: field, 7818 } 7819 ctx = graphql.WithResolverContext(ctx, rctx) 7820 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7821 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7822 ctx = rctx // use context from middleware stack in children 7823 return obj.Name, nil 7824 }) 7825 if resTmp == nil { 7826 if !ec.HasError(rctx) { 7827 ec.Errorf(ctx, "must not be null") 7828 } 7829 return graphql.Null 7830 } 7831 res := resTmp.(string) 7832 rctx.Result = res 7833 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7834 return graphql.MarshalString(res) 7835 } 7836 7837 // nolint: vetshadow 7838 func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 7839 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7840 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7841 rctx := &graphql.ResolverContext{ 7842 Object: "__EnumValue", 7843 Args: nil, 7844 Field: field, 7845 } 7846 ctx = graphql.WithResolverContext(ctx, rctx) 7847 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7848 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7849 ctx = rctx // use context from middleware stack in children 7850 return obj.Description, nil 7851 }) 7852 if resTmp == nil { 7853 return graphql.Null 7854 } 7855 res := resTmp.(string) 7856 rctx.Result = res 7857 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7858 return graphql.MarshalString(res) 7859 } 7860 7861 // nolint: vetshadow 7862 func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 7863 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7864 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7865 rctx := &graphql.ResolverContext{ 7866 Object: "__EnumValue", 7867 Args: nil, 7868 Field: field, 7869 } 7870 ctx = graphql.WithResolverContext(ctx, rctx) 7871 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7872 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7873 ctx = rctx // use context from middleware stack in children 7874 return obj.IsDeprecated(), nil 7875 }) 7876 if resTmp == nil { 7877 if !ec.HasError(rctx) { 7878 ec.Errorf(ctx, "must not be null") 7879 } 7880 return graphql.Null 7881 } 7882 res := resTmp.(bool) 7883 rctx.Result = res 7884 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7885 return graphql.MarshalBoolean(res) 7886 } 7887 7888 // nolint: vetshadow 7889 func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 7890 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7891 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7892 rctx := &graphql.ResolverContext{ 7893 Object: "__EnumValue", 7894 Args: nil, 7895 Field: field, 7896 } 7897 ctx = graphql.WithResolverContext(ctx, rctx) 7898 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7899 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7900 ctx = rctx // use context from middleware stack in children 7901 return obj.DeprecationReason(), nil 7902 }) 7903 if resTmp == nil { 7904 return graphql.Null 7905 } 7906 res := resTmp.(*string) 7907 rctx.Result = res 7908 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7909 7910 if res == nil { 7911 return graphql.Null 7912 } 7913 return graphql.MarshalString(*res) 7914 } 7915 7916 var __FieldImplementors = []string{"__Field"} 7917 7918 // nolint: gocyclo, errcheck, gas, goconst 7919 func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { 7920 fields := graphql.CollectFields(ctx, sel, __FieldImplementors) 7921 7922 out := graphql.NewOrderedMap(len(fields)) 7923 invalid := false 7924 for i, field := range fields { 7925 out.Keys[i] = field.Alias 7926 7927 switch field.Name { 7928 case "__typename": 7929 out.Values[i] = graphql.MarshalString("__Field") 7930 case "name": 7931 out.Values[i] = ec.___Field_name(ctx, field, obj) 7932 if out.Values[i] == graphql.Null { 7933 invalid = true 7934 } 7935 case "description": 7936 out.Values[i] = ec.___Field_description(ctx, field, obj) 7937 case "args": 7938 out.Values[i] = ec.___Field_args(ctx, field, obj) 7939 if out.Values[i] == graphql.Null { 7940 invalid = true 7941 } 7942 case "type": 7943 out.Values[i] = ec.___Field_type(ctx, field, obj) 7944 if out.Values[i] == graphql.Null { 7945 invalid = true 7946 } 7947 case "isDeprecated": 7948 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) 7949 if out.Values[i] == graphql.Null { 7950 invalid = true 7951 } 7952 case "deprecationReason": 7953 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) 7954 default: 7955 panic("unknown field " + strconv.Quote(field.Name)) 7956 } 7957 } 7958 7959 if invalid { 7960 return graphql.Null 7961 } 7962 return out 7963 } 7964 7965 // nolint: vetshadow 7966 func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 7967 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7968 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7969 rctx := &graphql.ResolverContext{ 7970 Object: "__Field", 7971 Args: nil, 7972 Field: field, 7973 } 7974 ctx = graphql.WithResolverContext(ctx, rctx) 7975 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 7976 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 7977 ctx = rctx // use context from middleware stack in children 7978 return obj.Name, nil 7979 }) 7980 if resTmp == nil { 7981 if !ec.HasError(rctx) { 7982 ec.Errorf(ctx, "must not be null") 7983 } 7984 return graphql.Null 7985 } 7986 res := resTmp.(string) 7987 rctx.Result = res 7988 ctx = ec.Tracer.StartFieldChildExecution(ctx) 7989 return graphql.MarshalString(res) 7990 } 7991 7992 // nolint: vetshadow 7993 func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 7994 ctx = ec.Tracer.StartFieldExecution(ctx, field) 7995 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 7996 rctx := &graphql.ResolverContext{ 7997 Object: "__Field", 7998 Args: nil, 7999 Field: field, 8000 } 8001 ctx = graphql.WithResolverContext(ctx, rctx) 8002 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8003 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8004 ctx = rctx // use context from middleware stack in children 8005 return obj.Description, nil 8006 }) 8007 if resTmp == nil { 8008 return graphql.Null 8009 } 8010 res := resTmp.(string) 8011 rctx.Result = res 8012 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8013 return graphql.MarshalString(res) 8014 } 8015 8016 // nolint: vetshadow 8017 func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 8018 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8019 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8020 rctx := &graphql.ResolverContext{ 8021 Object: "__Field", 8022 Args: nil, 8023 Field: field, 8024 } 8025 ctx = graphql.WithResolverContext(ctx, rctx) 8026 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8027 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8028 ctx = rctx // use context from middleware stack in children 8029 return obj.Args, nil 8030 }) 8031 if resTmp == nil { 8032 if !ec.HasError(rctx) { 8033 ec.Errorf(ctx, "must not be null") 8034 } 8035 return graphql.Null 8036 } 8037 res := resTmp.([]introspection.InputValue) 8038 rctx.Result = res 8039 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8040 8041 arr1 := make(graphql.Array, len(res)) 8042 var wg sync.WaitGroup 8043 8044 isLen1 := len(res) == 1 8045 if !isLen1 { 8046 wg.Add(len(res)) 8047 } 8048 8049 for idx1 := range res { 8050 idx1 := idx1 8051 rctx := &graphql.ResolverContext{ 8052 Index: &idx1, 8053 Result: &res[idx1], 8054 } 8055 ctx := graphql.WithResolverContext(ctx, rctx) 8056 f := func(idx1 int) { 8057 if !isLen1 { 8058 defer wg.Done() 8059 } 8060 arr1[idx1] = func() graphql.Marshaler { 8061 8062 return ec.___InputValue(ctx, field.Selections, &res[idx1]) 8063 }() 8064 } 8065 if isLen1 { 8066 f(idx1) 8067 } else { 8068 go f(idx1) 8069 } 8070 8071 } 8072 wg.Wait() 8073 return arr1 8074 } 8075 8076 // nolint: vetshadow 8077 func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 8078 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8079 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8080 rctx := &graphql.ResolverContext{ 8081 Object: "__Field", 8082 Args: nil, 8083 Field: field, 8084 } 8085 ctx = graphql.WithResolverContext(ctx, rctx) 8086 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8087 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8088 ctx = rctx // use context from middleware stack in children 8089 return obj.Type, nil 8090 }) 8091 if resTmp == nil { 8092 if !ec.HasError(rctx) { 8093 ec.Errorf(ctx, "must not be null") 8094 } 8095 return graphql.Null 8096 } 8097 res := resTmp.(*introspection.Type) 8098 rctx.Result = res 8099 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8100 8101 if res == nil { 8102 if !ec.HasError(rctx) { 8103 ec.Errorf(ctx, "must not be null") 8104 } 8105 return graphql.Null 8106 } 8107 8108 return ec.___Type(ctx, field.Selections, res) 8109 } 8110 8111 // nolint: vetshadow 8112 func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 8113 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8114 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8115 rctx := &graphql.ResolverContext{ 8116 Object: "__Field", 8117 Args: nil, 8118 Field: field, 8119 } 8120 ctx = graphql.WithResolverContext(ctx, rctx) 8121 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8122 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8123 ctx = rctx // use context from middleware stack in children 8124 return obj.IsDeprecated(), nil 8125 }) 8126 if resTmp == nil { 8127 if !ec.HasError(rctx) { 8128 ec.Errorf(ctx, "must not be null") 8129 } 8130 return graphql.Null 8131 } 8132 res := resTmp.(bool) 8133 rctx.Result = res 8134 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8135 return graphql.MarshalBoolean(res) 8136 } 8137 8138 // nolint: vetshadow 8139 func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 8140 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8141 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8142 rctx := &graphql.ResolverContext{ 8143 Object: "__Field", 8144 Args: nil, 8145 Field: field, 8146 } 8147 ctx = graphql.WithResolverContext(ctx, rctx) 8148 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8149 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8150 ctx = rctx // use context from middleware stack in children 8151 return obj.DeprecationReason(), nil 8152 }) 8153 if resTmp == nil { 8154 return graphql.Null 8155 } 8156 res := resTmp.(*string) 8157 rctx.Result = res 8158 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8159 8160 if res == nil { 8161 return graphql.Null 8162 } 8163 return graphql.MarshalString(*res) 8164 } 8165 8166 var __InputValueImplementors = []string{"__InputValue"} 8167 8168 // nolint: gocyclo, errcheck, gas, goconst 8169 func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { 8170 fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) 8171 8172 out := graphql.NewOrderedMap(len(fields)) 8173 invalid := false 8174 for i, field := range fields { 8175 out.Keys[i] = field.Alias 8176 8177 switch field.Name { 8178 case "__typename": 8179 out.Values[i] = graphql.MarshalString("__InputValue") 8180 case "name": 8181 out.Values[i] = ec.___InputValue_name(ctx, field, obj) 8182 if out.Values[i] == graphql.Null { 8183 invalid = true 8184 } 8185 case "description": 8186 out.Values[i] = ec.___InputValue_description(ctx, field, obj) 8187 case "type": 8188 out.Values[i] = ec.___InputValue_type(ctx, field, obj) 8189 if out.Values[i] == graphql.Null { 8190 invalid = true 8191 } 8192 case "defaultValue": 8193 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) 8194 default: 8195 panic("unknown field " + strconv.Quote(field.Name)) 8196 } 8197 } 8198 8199 if invalid { 8200 return graphql.Null 8201 } 8202 return out 8203 } 8204 8205 // nolint: vetshadow 8206 func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 8207 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8208 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8209 rctx := &graphql.ResolverContext{ 8210 Object: "__InputValue", 8211 Args: nil, 8212 Field: field, 8213 } 8214 ctx = graphql.WithResolverContext(ctx, rctx) 8215 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8216 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8217 ctx = rctx // use context from middleware stack in children 8218 return obj.Name, nil 8219 }) 8220 if resTmp == nil { 8221 if !ec.HasError(rctx) { 8222 ec.Errorf(ctx, "must not be null") 8223 } 8224 return graphql.Null 8225 } 8226 res := resTmp.(string) 8227 rctx.Result = res 8228 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8229 return graphql.MarshalString(res) 8230 } 8231 8232 // nolint: vetshadow 8233 func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 8234 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8235 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8236 rctx := &graphql.ResolverContext{ 8237 Object: "__InputValue", 8238 Args: nil, 8239 Field: field, 8240 } 8241 ctx = graphql.WithResolverContext(ctx, rctx) 8242 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8243 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8244 ctx = rctx // use context from middleware stack in children 8245 return obj.Description, nil 8246 }) 8247 if resTmp == nil { 8248 return graphql.Null 8249 } 8250 res := resTmp.(string) 8251 rctx.Result = res 8252 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8253 return graphql.MarshalString(res) 8254 } 8255 8256 // nolint: vetshadow 8257 func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 8258 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8259 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8260 rctx := &graphql.ResolverContext{ 8261 Object: "__InputValue", 8262 Args: nil, 8263 Field: field, 8264 } 8265 ctx = graphql.WithResolverContext(ctx, rctx) 8266 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8267 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8268 ctx = rctx // use context from middleware stack in children 8269 return obj.Type, nil 8270 }) 8271 if resTmp == nil { 8272 if !ec.HasError(rctx) { 8273 ec.Errorf(ctx, "must not be null") 8274 } 8275 return graphql.Null 8276 } 8277 res := resTmp.(*introspection.Type) 8278 rctx.Result = res 8279 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8280 8281 if res == nil { 8282 if !ec.HasError(rctx) { 8283 ec.Errorf(ctx, "must not be null") 8284 } 8285 return graphql.Null 8286 } 8287 8288 return ec.___Type(ctx, field.Selections, res) 8289 } 8290 8291 // nolint: vetshadow 8292 func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 8293 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8294 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8295 rctx := &graphql.ResolverContext{ 8296 Object: "__InputValue", 8297 Args: nil, 8298 Field: field, 8299 } 8300 ctx = graphql.WithResolverContext(ctx, rctx) 8301 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8302 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8303 ctx = rctx // use context from middleware stack in children 8304 return obj.DefaultValue, nil 8305 }) 8306 if resTmp == nil { 8307 return graphql.Null 8308 } 8309 res := resTmp.(*string) 8310 rctx.Result = res 8311 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8312 8313 if res == nil { 8314 return graphql.Null 8315 } 8316 return graphql.MarshalString(*res) 8317 } 8318 8319 var __SchemaImplementors = []string{"__Schema"} 8320 8321 // nolint: gocyclo, errcheck, gas, goconst 8322 func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { 8323 fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) 8324 8325 out := graphql.NewOrderedMap(len(fields)) 8326 invalid := false 8327 for i, field := range fields { 8328 out.Keys[i] = field.Alias 8329 8330 switch field.Name { 8331 case "__typename": 8332 out.Values[i] = graphql.MarshalString("__Schema") 8333 case "types": 8334 out.Values[i] = ec.___Schema_types(ctx, field, obj) 8335 if out.Values[i] == graphql.Null { 8336 invalid = true 8337 } 8338 case "queryType": 8339 out.Values[i] = ec.___Schema_queryType(ctx, field, obj) 8340 if out.Values[i] == graphql.Null { 8341 invalid = true 8342 } 8343 case "mutationType": 8344 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) 8345 case "subscriptionType": 8346 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) 8347 case "directives": 8348 out.Values[i] = ec.___Schema_directives(ctx, field, obj) 8349 if out.Values[i] == graphql.Null { 8350 invalid = true 8351 } 8352 default: 8353 panic("unknown field " + strconv.Quote(field.Name)) 8354 } 8355 } 8356 8357 if invalid { 8358 return graphql.Null 8359 } 8360 return out 8361 } 8362 8363 // nolint: vetshadow 8364 func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 8365 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8366 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8367 rctx := &graphql.ResolverContext{ 8368 Object: "__Schema", 8369 Args: nil, 8370 Field: field, 8371 } 8372 ctx = graphql.WithResolverContext(ctx, rctx) 8373 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8374 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8375 ctx = rctx // use context from middleware stack in children 8376 return obj.Types(), nil 8377 }) 8378 if resTmp == nil { 8379 if !ec.HasError(rctx) { 8380 ec.Errorf(ctx, "must not be null") 8381 } 8382 return graphql.Null 8383 } 8384 res := resTmp.([]introspection.Type) 8385 rctx.Result = res 8386 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8387 8388 arr1 := make(graphql.Array, len(res)) 8389 var wg sync.WaitGroup 8390 8391 isLen1 := len(res) == 1 8392 if !isLen1 { 8393 wg.Add(len(res)) 8394 } 8395 8396 for idx1 := range res { 8397 idx1 := idx1 8398 rctx := &graphql.ResolverContext{ 8399 Index: &idx1, 8400 Result: &res[idx1], 8401 } 8402 ctx := graphql.WithResolverContext(ctx, rctx) 8403 f := func(idx1 int) { 8404 if !isLen1 { 8405 defer wg.Done() 8406 } 8407 arr1[idx1] = func() graphql.Marshaler { 8408 8409 return ec.___Type(ctx, field.Selections, &res[idx1]) 8410 }() 8411 } 8412 if isLen1 { 8413 f(idx1) 8414 } else { 8415 go f(idx1) 8416 } 8417 8418 } 8419 wg.Wait() 8420 return arr1 8421 } 8422 8423 // nolint: vetshadow 8424 func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 8425 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8426 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8427 rctx := &graphql.ResolverContext{ 8428 Object: "__Schema", 8429 Args: nil, 8430 Field: field, 8431 } 8432 ctx = graphql.WithResolverContext(ctx, rctx) 8433 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8434 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8435 ctx = rctx // use context from middleware stack in children 8436 return obj.QueryType(), nil 8437 }) 8438 if resTmp == nil { 8439 if !ec.HasError(rctx) { 8440 ec.Errorf(ctx, "must not be null") 8441 } 8442 return graphql.Null 8443 } 8444 res := resTmp.(*introspection.Type) 8445 rctx.Result = res 8446 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8447 8448 if res == nil { 8449 if !ec.HasError(rctx) { 8450 ec.Errorf(ctx, "must not be null") 8451 } 8452 return graphql.Null 8453 } 8454 8455 return ec.___Type(ctx, field.Selections, res) 8456 } 8457 8458 // nolint: vetshadow 8459 func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 8460 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8461 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8462 rctx := &graphql.ResolverContext{ 8463 Object: "__Schema", 8464 Args: nil, 8465 Field: field, 8466 } 8467 ctx = graphql.WithResolverContext(ctx, rctx) 8468 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8469 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8470 ctx = rctx // use context from middleware stack in children 8471 return obj.MutationType(), nil 8472 }) 8473 if resTmp == nil { 8474 return graphql.Null 8475 } 8476 res := resTmp.(*introspection.Type) 8477 rctx.Result = res 8478 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8479 8480 if res == nil { 8481 return graphql.Null 8482 } 8483 8484 return ec.___Type(ctx, field.Selections, res) 8485 } 8486 8487 // nolint: vetshadow 8488 func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 8489 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8490 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8491 rctx := &graphql.ResolverContext{ 8492 Object: "__Schema", 8493 Args: nil, 8494 Field: field, 8495 } 8496 ctx = graphql.WithResolverContext(ctx, rctx) 8497 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8498 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8499 ctx = rctx // use context from middleware stack in children 8500 return obj.SubscriptionType(), nil 8501 }) 8502 if resTmp == nil { 8503 return graphql.Null 8504 } 8505 res := resTmp.(*introspection.Type) 8506 rctx.Result = res 8507 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8508 8509 if res == nil { 8510 return graphql.Null 8511 } 8512 8513 return ec.___Type(ctx, field.Selections, res) 8514 } 8515 8516 // nolint: vetshadow 8517 func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 8518 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8519 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8520 rctx := &graphql.ResolverContext{ 8521 Object: "__Schema", 8522 Args: nil, 8523 Field: field, 8524 } 8525 ctx = graphql.WithResolverContext(ctx, rctx) 8526 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8527 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8528 ctx = rctx // use context from middleware stack in children 8529 return obj.Directives(), nil 8530 }) 8531 if resTmp == nil { 8532 if !ec.HasError(rctx) { 8533 ec.Errorf(ctx, "must not be null") 8534 } 8535 return graphql.Null 8536 } 8537 res := resTmp.([]introspection.Directive) 8538 rctx.Result = res 8539 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8540 8541 arr1 := make(graphql.Array, len(res)) 8542 var wg sync.WaitGroup 8543 8544 isLen1 := len(res) == 1 8545 if !isLen1 { 8546 wg.Add(len(res)) 8547 } 8548 8549 for idx1 := range res { 8550 idx1 := idx1 8551 rctx := &graphql.ResolverContext{ 8552 Index: &idx1, 8553 Result: &res[idx1], 8554 } 8555 ctx := graphql.WithResolverContext(ctx, rctx) 8556 f := func(idx1 int) { 8557 if !isLen1 { 8558 defer wg.Done() 8559 } 8560 arr1[idx1] = func() graphql.Marshaler { 8561 8562 return ec.___Directive(ctx, field.Selections, &res[idx1]) 8563 }() 8564 } 8565 if isLen1 { 8566 f(idx1) 8567 } else { 8568 go f(idx1) 8569 } 8570 8571 } 8572 wg.Wait() 8573 return arr1 8574 } 8575 8576 var __TypeImplementors = []string{"__Type"} 8577 8578 // nolint: gocyclo, errcheck, gas, goconst 8579 func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { 8580 fields := graphql.CollectFields(ctx, sel, __TypeImplementors) 8581 8582 out := graphql.NewOrderedMap(len(fields)) 8583 invalid := false 8584 for i, field := range fields { 8585 out.Keys[i] = field.Alias 8586 8587 switch field.Name { 8588 case "__typename": 8589 out.Values[i] = graphql.MarshalString("__Type") 8590 case "kind": 8591 out.Values[i] = ec.___Type_kind(ctx, field, obj) 8592 if out.Values[i] == graphql.Null { 8593 invalid = true 8594 } 8595 case "name": 8596 out.Values[i] = ec.___Type_name(ctx, field, obj) 8597 case "description": 8598 out.Values[i] = ec.___Type_description(ctx, field, obj) 8599 case "fields": 8600 out.Values[i] = ec.___Type_fields(ctx, field, obj) 8601 case "interfaces": 8602 out.Values[i] = ec.___Type_interfaces(ctx, field, obj) 8603 case "possibleTypes": 8604 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) 8605 case "enumValues": 8606 out.Values[i] = ec.___Type_enumValues(ctx, field, obj) 8607 case "inputFields": 8608 out.Values[i] = ec.___Type_inputFields(ctx, field, obj) 8609 case "ofType": 8610 out.Values[i] = ec.___Type_ofType(ctx, field, obj) 8611 default: 8612 panic("unknown field " + strconv.Quote(field.Name)) 8613 } 8614 } 8615 8616 if invalid { 8617 return graphql.Null 8618 } 8619 return out 8620 } 8621 8622 // nolint: vetshadow 8623 func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8624 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8625 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8626 rctx := &graphql.ResolverContext{ 8627 Object: "__Type", 8628 Args: nil, 8629 Field: field, 8630 } 8631 ctx = graphql.WithResolverContext(ctx, rctx) 8632 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8633 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8634 ctx = rctx // use context from middleware stack in children 8635 return obj.Kind(), nil 8636 }) 8637 if resTmp == nil { 8638 if !ec.HasError(rctx) { 8639 ec.Errorf(ctx, "must not be null") 8640 } 8641 return graphql.Null 8642 } 8643 res := resTmp.(string) 8644 rctx.Result = res 8645 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8646 return graphql.MarshalString(res) 8647 } 8648 8649 // nolint: vetshadow 8650 func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8651 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8652 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8653 rctx := &graphql.ResolverContext{ 8654 Object: "__Type", 8655 Args: nil, 8656 Field: field, 8657 } 8658 ctx = graphql.WithResolverContext(ctx, rctx) 8659 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8660 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8661 ctx = rctx // use context from middleware stack in children 8662 return obj.Name(), nil 8663 }) 8664 if resTmp == nil { 8665 return graphql.Null 8666 } 8667 res := resTmp.(*string) 8668 rctx.Result = res 8669 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8670 8671 if res == nil { 8672 return graphql.Null 8673 } 8674 return graphql.MarshalString(*res) 8675 } 8676 8677 // nolint: vetshadow 8678 func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8679 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8680 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8681 rctx := &graphql.ResolverContext{ 8682 Object: "__Type", 8683 Args: nil, 8684 Field: field, 8685 } 8686 ctx = graphql.WithResolverContext(ctx, rctx) 8687 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8688 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8689 ctx = rctx // use context from middleware stack in children 8690 return obj.Description(), nil 8691 }) 8692 if resTmp == nil { 8693 return graphql.Null 8694 } 8695 res := resTmp.(string) 8696 rctx.Result = res 8697 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8698 return graphql.MarshalString(res) 8699 } 8700 8701 // nolint: vetshadow 8702 func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8703 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8704 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8705 rawArgs := field.ArgumentMap(ec.Variables) 8706 args, err := field___Type_fields_args(rawArgs) 8707 if err != nil { 8708 ec.Error(ctx, err) 8709 return graphql.Null 8710 } 8711 rctx := &graphql.ResolverContext{ 8712 Object: "__Type", 8713 Args: args, 8714 Field: field, 8715 } 8716 ctx = graphql.WithResolverContext(ctx, rctx) 8717 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8718 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8719 ctx = rctx // use context from middleware stack in children 8720 return obj.Fields(args["includeDeprecated"].(bool)), nil 8721 }) 8722 if resTmp == nil { 8723 return graphql.Null 8724 } 8725 res := resTmp.([]introspection.Field) 8726 rctx.Result = res 8727 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8728 8729 arr1 := make(graphql.Array, len(res)) 8730 var wg sync.WaitGroup 8731 8732 isLen1 := len(res) == 1 8733 if !isLen1 { 8734 wg.Add(len(res)) 8735 } 8736 8737 for idx1 := range res { 8738 idx1 := idx1 8739 rctx := &graphql.ResolverContext{ 8740 Index: &idx1, 8741 Result: &res[idx1], 8742 } 8743 ctx := graphql.WithResolverContext(ctx, rctx) 8744 f := func(idx1 int) { 8745 if !isLen1 { 8746 defer wg.Done() 8747 } 8748 arr1[idx1] = func() graphql.Marshaler { 8749 8750 return ec.___Field(ctx, field.Selections, &res[idx1]) 8751 }() 8752 } 8753 if isLen1 { 8754 f(idx1) 8755 } else { 8756 go f(idx1) 8757 } 8758 8759 } 8760 wg.Wait() 8761 return arr1 8762 } 8763 8764 // nolint: vetshadow 8765 func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8766 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8767 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8768 rctx := &graphql.ResolverContext{ 8769 Object: "__Type", 8770 Args: nil, 8771 Field: field, 8772 } 8773 ctx = graphql.WithResolverContext(ctx, rctx) 8774 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8775 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8776 ctx = rctx // use context from middleware stack in children 8777 return obj.Interfaces(), nil 8778 }) 8779 if resTmp == nil { 8780 return graphql.Null 8781 } 8782 res := resTmp.([]introspection.Type) 8783 rctx.Result = res 8784 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8785 8786 arr1 := make(graphql.Array, len(res)) 8787 var wg sync.WaitGroup 8788 8789 isLen1 := len(res) == 1 8790 if !isLen1 { 8791 wg.Add(len(res)) 8792 } 8793 8794 for idx1 := range res { 8795 idx1 := idx1 8796 rctx := &graphql.ResolverContext{ 8797 Index: &idx1, 8798 Result: &res[idx1], 8799 } 8800 ctx := graphql.WithResolverContext(ctx, rctx) 8801 f := func(idx1 int) { 8802 if !isLen1 { 8803 defer wg.Done() 8804 } 8805 arr1[idx1] = func() graphql.Marshaler { 8806 8807 return ec.___Type(ctx, field.Selections, &res[idx1]) 8808 }() 8809 } 8810 if isLen1 { 8811 f(idx1) 8812 } else { 8813 go f(idx1) 8814 } 8815 8816 } 8817 wg.Wait() 8818 return arr1 8819 } 8820 8821 // nolint: vetshadow 8822 func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8823 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8824 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8825 rctx := &graphql.ResolverContext{ 8826 Object: "__Type", 8827 Args: nil, 8828 Field: field, 8829 } 8830 ctx = graphql.WithResolverContext(ctx, rctx) 8831 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8832 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8833 ctx = rctx // use context from middleware stack in children 8834 return obj.PossibleTypes(), nil 8835 }) 8836 if resTmp == nil { 8837 return graphql.Null 8838 } 8839 res := resTmp.([]introspection.Type) 8840 rctx.Result = res 8841 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8842 8843 arr1 := make(graphql.Array, len(res)) 8844 var wg sync.WaitGroup 8845 8846 isLen1 := len(res) == 1 8847 if !isLen1 { 8848 wg.Add(len(res)) 8849 } 8850 8851 for idx1 := range res { 8852 idx1 := idx1 8853 rctx := &graphql.ResolverContext{ 8854 Index: &idx1, 8855 Result: &res[idx1], 8856 } 8857 ctx := graphql.WithResolverContext(ctx, rctx) 8858 f := func(idx1 int) { 8859 if !isLen1 { 8860 defer wg.Done() 8861 } 8862 arr1[idx1] = func() graphql.Marshaler { 8863 8864 return ec.___Type(ctx, field.Selections, &res[idx1]) 8865 }() 8866 } 8867 if isLen1 { 8868 f(idx1) 8869 } else { 8870 go f(idx1) 8871 } 8872 8873 } 8874 wg.Wait() 8875 return arr1 8876 } 8877 8878 // nolint: vetshadow 8879 func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8880 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8881 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8882 rawArgs := field.ArgumentMap(ec.Variables) 8883 args, err := field___Type_enumValues_args(rawArgs) 8884 if err != nil { 8885 ec.Error(ctx, err) 8886 return graphql.Null 8887 } 8888 rctx := &graphql.ResolverContext{ 8889 Object: "__Type", 8890 Args: args, 8891 Field: field, 8892 } 8893 ctx = graphql.WithResolverContext(ctx, rctx) 8894 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8895 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8896 ctx = rctx // use context from middleware stack in children 8897 return obj.EnumValues(args["includeDeprecated"].(bool)), nil 8898 }) 8899 if resTmp == nil { 8900 return graphql.Null 8901 } 8902 res := resTmp.([]introspection.EnumValue) 8903 rctx.Result = res 8904 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8905 8906 arr1 := make(graphql.Array, len(res)) 8907 var wg sync.WaitGroup 8908 8909 isLen1 := len(res) == 1 8910 if !isLen1 { 8911 wg.Add(len(res)) 8912 } 8913 8914 for idx1 := range res { 8915 idx1 := idx1 8916 rctx := &graphql.ResolverContext{ 8917 Index: &idx1, 8918 Result: &res[idx1], 8919 } 8920 ctx := graphql.WithResolverContext(ctx, rctx) 8921 f := func(idx1 int) { 8922 if !isLen1 { 8923 defer wg.Done() 8924 } 8925 arr1[idx1] = func() graphql.Marshaler { 8926 8927 return ec.___EnumValue(ctx, field.Selections, &res[idx1]) 8928 }() 8929 } 8930 if isLen1 { 8931 f(idx1) 8932 } else { 8933 go f(idx1) 8934 } 8935 8936 } 8937 wg.Wait() 8938 return arr1 8939 } 8940 8941 // nolint: vetshadow 8942 func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 8943 ctx = ec.Tracer.StartFieldExecution(ctx, field) 8944 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 8945 rctx := &graphql.ResolverContext{ 8946 Object: "__Type", 8947 Args: nil, 8948 Field: field, 8949 } 8950 ctx = graphql.WithResolverContext(ctx, rctx) 8951 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 8952 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 8953 ctx = rctx // use context from middleware stack in children 8954 return obj.InputFields(), nil 8955 }) 8956 if resTmp == nil { 8957 return graphql.Null 8958 } 8959 res := resTmp.([]introspection.InputValue) 8960 rctx.Result = res 8961 ctx = ec.Tracer.StartFieldChildExecution(ctx) 8962 8963 arr1 := make(graphql.Array, len(res)) 8964 var wg sync.WaitGroup 8965 8966 isLen1 := len(res) == 1 8967 if !isLen1 { 8968 wg.Add(len(res)) 8969 } 8970 8971 for idx1 := range res { 8972 idx1 := idx1 8973 rctx := &graphql.ResolverContext{ 8974 Index: &idx1, 8975 Result: &res[idx1], 8976 } 8977 ctx := graphql.WithResolverContext(ctx, rctx) 8978 f := func(idx1 int) { 8979 if !isLen1 { 8980 defer wg.Done() 8981 } 8982 arr1[idx1] = func() graphql.Marshaler { 8983 8984 return ec.___InputValue(ctx, field.Selections, &res[idx1]) 8985 }() 8986 } 8987 if isLen1 { 8988 f(idx1) 8989 } else { 8990 go f(idx1) 8991 } 8992 8993 } 8994 wg.Wait() 8995 return arr1 8996 } 8997 8998 // nolint: vetshadow 8999 func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 9000 ctx = ec.Tracer.StartFieldExecution(ctx, field) 9001 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 9002 rctx := &graphql.ResolverContext{ 9003 Object: "__Type", 9004 Args: nil, 9005 Field: field, 9006 } 9007 ctx = graphql.WithResolverContext(ctx, rctx) 9008 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 9009 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 9010 ctx = rctx // use context from middleware stack in children 9011 return obj.OfType(), nil 9012 }) 9013 if resTmp == nil { 9014 return graphql.Null 9015 } 9016 res := resTmp.(*introspection.Type) 9017 rctx.Result = res 9018 ctx = ec.Tracer.StartFieldChildExecution(ctx) 9019 9020 if res == nil { 9021 return graphql.Null 9022 } 9023 9024 return ec.___Type(ctx, field.Selections, res) 9025 } 9026 9027 func (ec *executionContext) FieldMiddleware(ctx context.Context, obj interface{}, next graphql.Resolver) (ret interface{}) { 9028 defer func() { 9029 if r := recover(); r != nil { 9030 ec.Error(ctx, ec.Recover(ctx, r)) 9031 ret = nil 9032 } 9033 }() 9034 res, err := ec.ResolverMiddleware(ctx, next) 9035 if err != nil { 9036 ec.Error(ctx, err) 9037 return nil 9038 } 9039 return res 9040 } 9041 9042 func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { 9043 if ec.DisableIntrospection { 9044 return nil, errors.New("introspection disabled") 9045 } 9046 return introspection.WrapSchema(parsedSchema), nil 9047 } 9048 9049 func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { 9050 if ec.DisableIntrospection { 9051 return nil, errors.New("introspection disabled") 9052 } 9053 return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil 9054 } 9055 9056 var parsedSchema = gqlparser.MustLoadSchema( 9057 &ast.Source{Name: "graphql/schema.graphql", Input: `""" 9058 Information about pagination in a connection. 9059 """ 9060 type PageInfo { 9061 """ 9062 When paginating forwards, are there more items? 9063 """ 9064 hasNextPage: Boolean! 9065 9066 """ 9067 When paginating backwards, are there more items? 9068 """ 9069 hasPreviousPage: Boolean! 9070 9071 """ 9072 When paginating backwards, the cursor to continue. 9073 """ 9074 startCursor: ID! 9075 9076 """ 9077 When paginating forwards, the cursor to continue. 9078 """ 9079 endCursor: ID! 9080 } 9081 9082 """ 9083 The genders of people in the Star Wars universe. 9084 """ 9085 enum Gender { 9086 """ 9087 Does not have a gender. 9088 """ 9089 NA 9090 9091 """ 9092 Male. 9093 """ 9094 MALE 9095 9096 """ 9097 Female. 9098 """ 9099 FEMALE 9100 } 9101 9102 """ 9103 The class of vehicle in the Star Wars universe. 9104 """ 9105 enum VehicleClass { 9106 """ 9107 Wheeled. 9108 """ 9109 WHEELED 9110 9111 """ 9112 Repulsorcraft. 9113 """ 9114 REPULSOCRAFT 9115 } 9116 9117 """ 9118 A People resource is an individual person or character within the Star Wars universe. 9119 """ 9120 type People { 9121 """ 9122 The id of this person. 9123 """ 9124 id: ID! 9125 9126 """ 9127 The name of this person. 9128 """ 9129 name: String! 9130 9131 """ 9132 The birth year of the person, using the in-universe standard of BBY or ABY - Before the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is a battle that occurs at the end of Star Wars episode IV: A New Hope. 9133 """ 9134 birth_year: String 9135 9136 """ 9137 The eye color of this person. Will be "unknown" if not known or "n/a" if the person does not have an eye. 9138 """ 9139 eye_color: String 9140 9141 """ 9142 The gender of this person. Either "Male", "Female" or "unknown", "n/a" if the person does not have a gender. 9143 """ 9144 gender: String 9145 9146 """ 9147 The hair color of this person. Will be "unknown" if not known or "n/a" if the person does not have hair. 9148 """ 9149 hair_color: String 9150 9151 """ 9152 The height of the person in centimeters. 9153 """ 9154 height: String 9155 9156 """ 9157 The mass of the person in kilograms. 9158 """ 9159 mass: String 9160 9161 """ 9162 The skin color of this person. 9163 """ 9164 skin_color: String 9165 9166 """ 9167 A planet resource, a planet that this person was born on or inhabits. 9168 """ 9169 homeworld: Planet 9170 9171 """ 9172 An array of film resources that this person has been in. 9173 """ 9174 films: [Film] 9175 9176 """ 9177 An array of specie resources that this person belongs to. 9178 """ 9179 species: [Specie] 9180 9181 """ 9182 An array of starship resources that this person has piloted. 9183 """ 9184 starships: [Starship] 9185 9186 """ 9187 An array of vehicle resources that this person has piloted. 9188 """ 9189 vehicles: [Vehicle] 9190 } 9191 9192 """ 9193 A connection to a list of items. 9194 """ 9195 type PeopleConnection { 9196 """ 9197 Information to aid in pagination. 9198 """ 9199 pageInfo: PageInfo! 9200 9201 """ 9202 A list of edges. 9203 """ 9204 edges: [PeopleEdge!] 9205 9206 """ 9207 A count of the total number of items in this connection, ignoring pagination. 9208 """ 9209 totalCount: Int! 9210 } 9211 9212 """ 9213 An edge in a connection. 9214 """ 9215 type PeopleEdge { 9216 """ 9217 The item at the end of the edge. 9218 """ 9219 node: People 9220 9221 """ 9222 A cursor for use in pagination. 9223 """ 9224 cursor: ID! 9225 } 9226 9227 """ 9228 A Film resource is a single film. 9229 """ 9230 type Film { 9231 """ 9232 The id of this film. 9233 """ 9234 id: ID! 9235 9236 """ 9237 The title of this film. 9238 """ 9239 title: String! 9240 9241 """ 9242 The episode number of this film. 9243 """ 9244 episode_id: Int 9245 9246 """ 9247 The opening paragraphs at the beginning of this film. 9248 """ 9249 opening_crawl: String 9250 9251 """ 9252 The name of the director of this film. 9253 """ 9254 director: String 9255 9256 """ 9257 The name(s) of the producer(s) of this film. Comma separated. 9258 """ 9259 producer: String 9260 9261 """ 9262 The ISO 8601 date format of film release at original creator country. 9263 """ 9264 release_date: String 9265 9266 """ 9267 An array of species resources that are in this film. 9268 """ 9269 species: [Specie] 9270 9271 """ 9272 An array of starship resources that are in this film. 9273 """ 9274 starships: [Starship] 9275 9276 """ 9277 An array of vehicle resources that are in this film. 9278 """ 9279 vehicles: [Vehicle] 9280 9281 """ 9282 An array of People resources that are in this film. 9283 """ 9284 characters: [People] 9285 9286 """ 9287 An array of planet resources that are in this film. 9288 """ 9289 planets: [Planet] 9290 } 9291 9292 """ 9293 A connection to a list of items. 9294 """ 9295 type FilmConnection { 9296 """ 9297 Information to aid in pagination. 9298 """ 9299 pageInfo: PageInfo! 9300 9301 """ 9302 A list of edges. 9303 """ 9304 edges: [FilmEdge!] 9305 9306 """ 9307 A count of the total number of items in this connection, ignoring pagination. 9308 """ 9309 totalCount: Int! 9310 } 9311 9312 """ 9313 An edge in a connection. 9314 """ 9315 type FilmEdge { 9316 """ 9317 The item at the end of the edge. 9318 """ 9319 node: Film 9320 9321 """ 9322 A cursor for use in pagination. 9323 """ 9324 cursor: ID! 9325 } 9326 9327 """ 9328 A Starship resource is a single transport craft that has hyperdrive capability. 9329 """ 9330 type Starship { 9331 """ 9332 The id of this starship. 9333 """ 9334 id: ID! 9335 9336 """ 9337 The name of this starship. The common name, such as "Death Star". 9338 """ 9339 name: String! 9340 9341 """ 9342 The model or official name of this starship. Such as "T-65 X-wing" or "DS-1 Orbital Battle Station". 9343 """ 9344 model: String 9345 9346 """ 9347 The class of this starship, such as "Starfighter" or "Deep Space Mobile Battlestation" 9348 """ 9349 starship_class: String 9350 9351 """ 9352 The manufacturer of this starship. Comma separated if more than one. 9353 """ 9354 manufacturer: String 9355 9356 """ 9357 The cost of this starship new, in galactic credits. 9358 """ 9359 cost_in_credits: String 9360 9361 """ 9362 The length of this starship in meters. 9363 """ 9364 length: String 9365 9366 """ 9367 The number of personnel needed to run or pilot this starship. 9368 """ 9369 crew: String 9370 9371 """ 9372 The number of non-essential Vehicle this starship can transport. 9373 """ 9374 passengers: String 9375 9376 """ 9377 The maximum speed of this starship in the atmosphere. "N/A" if this starship is incapable of atmospheric flight. 9378 """ 9379 max_atmosphering_speed: String 9380 9381 """ 9382 The class of this starships hyperdrive. 9383 """ 9384 hyperdrive_rating: String 9385 9386 """ 9387 The Maximum number of Megalights this starship can travel in a standard hour. A "Megalight" is a standard unit of distance and has never been defined before within the Star Wars universe. This figure is only really useful for measuring the difference in speed of starships. We can assume it is similar to AU, the distance between our Sun (Sol) and Earth. 9388 """ 9389 MGLT: String 9390 9391 """ 9392 The maximum number of kilograms that this starship can transport. 9393 """ 9394 cargo_capacity: String 9395 9396 """ 9397 The maximum length of time that this starship can provide consumables for its entire crew without having to resupply. 9398 """ 9399 consumables : String 9400 9401 """ 9402 An array of film resources that this starship has appeared in. 9403 """ 9404 films: [Film] 9405 9406 """ 9407 An array of People resources that this starship has been piloted by. 9408 """ 9409 pilots: [People] 9410 } 9411 9412 """ 9413 A connection to a list of items. 9414 """ 9415 type StarshipConnection { 9416 """ 9417 Information to aid in pagination. 9418 """ 9419 pageInfo: PageInfo! 9420 9421 """ 9422 A list of edges. 9423 """ 9424 edges: [StarshipEdge!] 9425 9426 """ 9427 A count of the total number of items in this connection, ignoring pagination. 9428 """ 9429 totalCount: Int! 9430 } 9431 9432 """ 9433 An edge in a connection. 9434 """ 9435 type StarshipEdge { 9436 """ 9437 The item at the end of the edge. 9438 """ 9439 node: Starship 9440 9441 """ 9442 A cursor for use in pagination. 9443 """ 9444 cursor: ID! 9445 } 9446 9447 """ 9448 A Vehicle resource is a single transport craft that does not have hyperdrive capability. 9449 """ 9450 type Vehicle { 9451 """ 9452 The id of this vehicle. 9453 """ 9454 id: ID! 9455 9456 """ 9457 The name of this vehicle. The common name, such as "Sand Crawler" or "Speeder bike". 9458 """ 9459 name: String! 9460 9461 """ 9462 The model or official name of this vehicle. Such as "All-Terrain Attack Transport". 9463 """ 9464 model: String 9465 9466 """ 9467 The class of this vehicle, such as "Wheeled" or "Repulsorcraft". 9468 """ 9469 vehicle_class: VehicleClass 9470 9471 """ 9472 The manufacturer of this vehicle. Comma separated if more than one. 9473 """ 9474 manufacturer: String 9475 9476 """ 9477 The length of this vehicle in meters. 9478 """ 9479 length: String 9480 9481 """ 9482 The cost of this vehicle new, in Galactic Credits. 9483 """ 9484 cost_in_credits: String 9485 9486 """ 9487 The number of personnel needed to run or pilot this vehicle. 9488 """ 9489 crew: String 9490 9491 """ 9492 The number of non-essential Vehicle this vehicle can transport. 9493 """ 9494 passengers: String 9495 9496 """ 9497 The maximum speed of this vehicle in the atmosphere. 9498 """ 9499 max_atmosphering_speed: String 9500 9501 """ 9502 The maximum number of kilograms that this vehicle can transport. 9503 """ 9504 cargo_capacity: String 9505 9506 """ 9507 The maximum length of time that this vehicle can provide consumables for its entire crew without having to resupply. 9508 """ 9509 consumables: String 9510 9511 """ 9512 An array of film resources that this vehicle has appeared in. 9513 """ 9514 films: [Film] 9515 9516 """ 9517 An array of People resources that this vehicle has been piloted by. 9518 """ 9519 pilots: [People] 9520 } 9521 9522 """ 9523 A connection to a list of items. 9524 """ 9525 type VehicleConnection { 9526 """ 9527 Information to aid in pagination. 9528 """ 9529 pageInfo: PageInfo! 9530 9531 """ 9532 A list of edges. 9533 """ 9534 edges: [VehicleEdge!] 9535 9536 """ 9537 A count of the total number of items in this connection, ignoring pagination. 9538 """ 9539 totalCount: Int! 9540 } 9541 9542 """ 9543 An edge in a connection. 9544 """ 9545 type VehicleEdge { 9546 """ 9547 The item at the end of the edge. 9548 """ 9549 node: Vehicle 9550 9551 """ 9552 A cursor for use in pagination. 9553 """ 9554 cursor: ID! 9555 } 9556 9557 """ 9558 A Species resource is a type of person or character within the Star Wars Universe. 9559 """ 9560 type Specie { 9561 """ 9562 The id of this specie. 9563 """ 9564 id: ID! 9565 9566 """ 9567 The name of this species. 9568 """ 9569 name: String! 9570 9571 """ 9572 The classification of this species, such as "mammal" or "reptile". 9573 """ 9574 classification: String 9575 9576 """ 9577 The designation of this species, such as "sentient". 9578 """ 9579 designation: String 9580 9581 """ 9582 The average height of this species in centimeters. 9583 """ 9584 average_height: String 9585 9586 """ 9587 The average lifespan of this species in years. 9588 """ 9589 average_lifespan: String 9590 9591 """ 9592 A comma-separated string of common eye colors for this species, "none" if this species does not typically have eyes. 9593 """ 9594 eye_colors: String 9595 9596 """ 9597 A comma-separated string of common hair colors for this species, "none" if this species does not typically have hair. 9598 """ 9599 hair_colors: String 9600 9601 """ 9602 A comma-separated string of common skin colors for this species, "none" if this species does not typically have skin. 9603 """ 9604 skin_colors: String 9605 9606 """ 9607 The language commonly spoken by this species. 9608 """ 9609 language: String 9610 9611 """ 9612 A planet resource, a planet that this species originates from. 9613 """ 9614 homeworld: Planet 9615 9616 """ 9617 An array of Vehicle resources that are a part of this species. 9618 """ 9619 Vehicle: [Vehicle] 9620 9621 """ 9622 An array of film resources that this species has appeared in. 9623 """ 9624 films: [Film] 9625 9626 """ 9627 An array of People resources that this species has appeared in. 9628 """ 9629 People: [People] 9630 } 9631 9632 """ 9633 A connection to a list of items. 9634 """ 9635 type SpecieConnection { 9636 """ 9637 Information to aid in pagination. 9638 """ 9639 pageInfo: PageInfo! 9640 9641 """ 9642 A list of edges. 9643 """ 9644 edges: [SpecieEdge!] 9645 9646 """ 9647 A count of the total number of items in this connection, ignoring pagination. 9648 """ 9649 totalCount: Int! 9650 } 9651 9652 """ 9653 An edge in a connection. 9654 """ 9655 type SpecieEdge { 9656 """ 9657 The item at the end of the edge. 9658 """ 9659 node: Specie 9660 9661 """ 9662 A cursor for use in pagination. 9663 """ 9664 cursor: ID! 9665 } 9666 9667 """ 9668 A Planet resource is a large mass, planet or planetoid in the Star Wars Universe, at the time of 0 ABY. 9669 """ 9670 type Planet { 9671 """ 9672 The id of this planet. 9673 """ 9674 id: ID! 9675 9676 """ 9677 The name of this planet. 9678 """ 9679 name: String! 9680 9681 """ 9682 The diameter of this planet in kilometers. 9683 """ 9684 diameter: String 9685 9686 """ 9687 The number of standard hours it takes for this planet to complete a single rotation on its axis. 9688 """ 9689 rotation_period: String 9690 9691 """ 9692 The number of standard days it takes for this planet to complete a single orbit of its local star. 9693 """ 9694 orbital_period: String 9695 9696 """ 9697 A number denoting the gravity of this planet, where "1" is normal or 1 standard G. "2" is twice or 2 standard Gs. "0.5" is half or 0.5 standard Gs. 9698 """ 9699 gravity: String 9700 9701 """ 9702 The average population of sentient beings inhabiting this planet. 9703 """ 9704 population: String 9705 9706 """ 9707 The climate of this planet. Comma separated if diverse. 9708 """ 9709 climate: String 9710 9711 """ 9712 The terrain of this planet. Comma separated if diverse. 9713 """ 9714 terrain: String 9715 9716 """ 9717 The percentage of the planet surface that is naturally occurring water or bodies of water. 9718 """ 9719 surface_water: String 9720 9721 """ 9722 An array of People resources that live on this planet. 9723 """ 9724 residents: [People] 9725 9726 """ 9727 An array of film resources that this planet has appeared in. 9728 """ 9729 films: [Film] 9730 } 9731 9732 """ 9733 A connection to a list of items. 9734 """ 9735 type PlanetConnection { 9736 """ 9737 Information to aid in pagination. 9738 """ 9739 pageInfo: PageInfo! 9740 9741 """ 9742 A list of edges. 9743 """ 9744 edges: [PlanetEdge!] 9745 9746 """ 9747 A count of the total number of items in this connection, ignoring pagination. 9748 """ 9749 totalCount: Int! 9750 } 9751 9752 """ 9753 An edge in a connection. 9754 """ 9755 type PlanetEdge { 9756 """ 9757 The item at the end of the edge. 9758 """ 9759 node: Planet 9760 9761 """ 9762 A cursor for use in pagination. 9763 """ 9764 cursor: ID! 9765 } 9766 9767 """ 9768 The query root, from which multiple types of requests can be made. 9769 """ 9770 type Query { 9771 """ 9772 Look up a specific people by its ID. 9773 """ 9774 people( 9775 """ 9776 The ID of the entity. 9777 """ 9778 id: ID! 9779 ): People 9780 9781 """ 9782 Look up a specific film by its ID. 9783 """ 9784 film( 9785 """ 9786 The ID of the entity. 9787 """ 9788 id: ID! 9789 ): Film 9790 9791 """ 9792 Look up a specific starship by its ID. 9793 """ 9794 starship( 9795 """ 9796 The ID of the entity. 9797 """ 9798 id: ID! 9799 ): Starship 9800 9801 """ 9802 Look up a specific vehicle by its ID. 9803 """ 9804 vehicle( 9805 """ 9806 The ID of the entity. 9807 """ 9808 id: ID! 9809 ): Vehicle 9810 9811 """ 9812 Look up a specific specie by its ID. 9813 """ 9814 specie( 9815 """ 9816 The ID of the entity. 9817 """ 9818 id: ID! 9819 ): Specie 9820 9821 """ 9822 Look up a specific planet by its ID. 9823 """ 9824 planet( 9825 """ 9826 The ID of the entity. 9827 """ 9828 id: ID! 9829 ): Planet 9830 9831 """ 9832 Browse people entities. 9833 """ 9834 peoples ( 9835 """ 9836 The number of entities in the connection. 9837 """ 9838 first: Int 9839 9840 """ 9841 The connection follows by. 9842 """ 9843 after: ID 9844 ): PeopleConnection! 9845 9846 """ 9847 Browse film entities. 9848 """ 9849 films ( 9850 """ 9851 The number of entities in the connection. 9852 """ 9853 first: Int 9854 9855 """ 9856 The connection follows by. 9857 """ 9858 after: ID 9859 ): FilmConnection! 9860 9861 """ 9862 Browse starship entities. 9863 """ 9864 starships ( 9865 """ 9866 The number of entities in the connection. 9867 """ 9868 first: Int 9869 9870 """ 9871 The connection follows by. 9872 """ 9873 after: ID 9874 ): StarshipConnection! 9875 9876 """ 9877 Browse vehicle entities. 9878 """ 9879 vehicles ( 9880 """ 9881 The number of entities in the connection. 9882 """ 9883 first: Int 9884 9885 """ 9886 The connection follows by. 9887 """ 9888 after: ID 9889 ): VehicleConnection! 9890 9891 """ 9892 Browse specie entities. 9893 """ 9894 species ( 9895 """ 9896 The number of entities in the connection. 9897 """ 9898 first: Int 9899 9900 """ 9901 The connection follows by. 9902 """ 9903 after: ID 9904 ): SpecieConnection! 9905 9906 """ 9907 Browse planet entities. 9908 """ 9909 planets ( 9910 """ 9911 The number of entities in the connection. 9912 """ 9913 first: Int 9914 9915 """ 9916 The connection follows by. 9917 """ 9918 after: ID 9919 ): PlanetConnection! 9920 9921 """ 9922 Search for people entities matching the given query. 9923 """ 9924 peopleSearch ( 9925 """ 9926 The search field for name, in Lucene search syntax. 9927 """ 9928 search: String! 9929 9930 """ 9931 The number of entities in the connection. 9932 """ 9933 first: Int 9934 9935 """ 9936 The connection follows by. 9937 """ 9938 after: ID 9939 ): PeopleConnection 9940 9941 """ 9942 Search for film entities matching the given query. 9943 """ 9944 filmsSearch ( 9945 """ 9946 The search field for title, in Lucene search syntax. 9947 """ 9948 search: String! 9949 9950 """ 9951 The number of entities in the connection. 9952 """ 9953 first: Int 9954 9955 """ 9956 The connection follows by. 9957 """ 9958 after: ID 9959 ): FilmConnection 9960 9961 """ 9962 Search for starship entities matching the given query. 9963 """ 9964 starshipsSearch ( 9965 """ 9966 The search field for name or model, in Lucene search syntax. 9967 """ 9968 search: String! 9969 9970 """ 9971 The number of entities in the connection. 9972 """ 9973 first: Int 9974 9975 """ 9976 The connection follows by. 9977 """ 9978 after: ID 9979 ): StarshipConnection 9980 9981 """ 9982 Search for vehicle entities matching the given query. 9983 """ 9984 vehiclesSearch ( 9985 """ 9986 The search field for name or model, in Lucene search syntax. 9987 """ 9988 search: String! 9989 9990 """ 9991 The number of entities in the connection. 9992 """ 9993 first: Int 9994 9995 """ 9996 The connection follows by. 9997 """ 9998 after: ID 9999 ): VehicleConnection 10000 10001 """ 10002 Search for specie entities matching the given query. 10003 """ 10004 speciesSearch ( 10005 """ 10006 The search field for name, in Lucene search syntax. 10007 """ 10008 search: String! 10009 10010 """ 10011 The number of entities in the connection. 10012 """ 10013 first: Int 10014 10015 """ 10016 The connection follows by. 10017 """ 10018 after: ID 10019 ): SpecieConnection 10020 10021 """ 10022 Search for planet entities matching the given query. 10023 """ 10024 planetsSearch ( 10025 """ 10026 The search field for name, in Lucene search syntax. 10027 """ 10028 search: String! 10029 10030 """ 10031 The number of entities in the connection. 10032 """ 10033 first: Int 10034 10035 """ 10036 The connection follows by. 10037 """ 10038 after: ID 10039 ): PlanetConnection 10040 } 10041 `}, 10042 )