github.com/fortexxx/gqlgen@v0.10.3-0.20191216030626-ca5ea8b21ead/example/starwars/generated/exec.go (about) 1 // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. 2 3 package generated 4 5 import ( 6 "bytes" 7 "context" 8 "errors" 9 "fmt" 10 "strconv" 11 "sync" 12 "sync/atomic" 13 "time" 14 15 "github.com/99designs/gqlgen/example/starwars/models" 16 "github.com/99designs/gqlgen/graphql" 17 "github.com/99designs/gqlgen/graphql/introspection" 18 "github.com/vektah/gqlparser" 19 "github.com/vektah/gqlparser/ast" 20 ) 21 22 // region ************************** generated!.gotpl ************************** 23 24 // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. 25 func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { 26 return &executableSchema{ 27 resolvers: cfg.Resolvers, 28 directives: cfg.Directives, 29 complexity: cfg.Complexity, 30 } 31 } 32 33 type Config struct { 34 Resolvers ResolverRoot 35 Directives DirectiveRoot 36 Complexity ComplexityRoot 37 } 38 39 type ResolverRoot interface { 40 Droid() DroidResolver 41 FriendsConnection() FriendsConnectionResolver 42 Human() HumanResolver 43 Mutation() MutationResolver 44 Query() QueryResolver 45 Starship() StarshipResolver 46 } 47 48 type DirectiveRoot struct { 49 } 50 51 type ComplexityRoot struct { 52 Droid struct { 53 AppearsIn func(childComplexity int) int 54 Friends func(childComplexity int) int 55 FriendsConnection func(childComplexity int, first *int, after *string) int 56 ID func(childComplexity int) int 57 Name func(childComplexity int) int 58 PrimaryFunction func(childComplexity int) int 59 } 60 61 FriendsConnection struct { 62 Edges func(childComplexity int) int 63 Friends func(childComplexity int) int 64 PageInfo func(childComplexity int) int 65 TotalCount func(childComplexity int) int 66 } 67 68 FriendsEdge struct { 69 Cursor func(childComplexity int) int 70 Node func(childComplexity int) int 71 } 72 73 Human struct { 74 AppearsIn func(childComplexity int) int 75 Friends func(childComplexity int) int 76 FriendsConnection func(childComplexity int, first *int, after *string) int 77 Height func(childComplexity int, unit models.LengthUnit) int 78 ID func(childComplexity int) int 79 Mass func(childComplexity int) int 80 Name func(childComplexity int) int 81 Starships func(childComplexity int) int 82 } 83 84 Mutation struct { 85 CreateReview func(childComplexity int, episode models.Episode, review models.Review) int 86 } 87 88 PageInfo struct { 89 EndCursor func(childComplexity int) int 90 HasNextPage func(childComplexity int) int 91 StartCursor func(childComplexity int) int 92 } 93 94 Query struct { 95 Character func(childComplexity int, id string) int 96 Droid func(childComplexity int, id string) int 97 Hero func(childComplexity int, episode *models.Episode) int 98 Human func(childComplexity int, id string) int 99 Reviews func(childComplexity int, episode models.Episode, since *time.Time) int 100 Search func(childComplexity int, text string) int 101 Starship func(childComplexity int, id string) int 102 } 103 104 Review struct { 105 Commentary func(childComplexity int) int 106 Stars func(childComplexity int) int 107 Time func(childComplexity int) int 108 } 109 110 Starship struct { 111 History func(childComplexity int) int 112 ID func(childComplexity int) int 113 Length func(childComplexity int, unit *models.LengthUnit) int 114 Name func(childComplexity int) int 115 } 116 } 117 118 type DroidResolver interface { 119 Friends(ctx context.Context, obj *models.Droid) ([]models.Character, error) 120 FriendsConnection(ctx context.Context, obj *models.Droid, first *int, after *string) (*models.FriendsConnection, error) 121 } 122 type FriendsConnectionResolver interface { 123 Edges(ctx context.Context, obj *models.FriendsConnection) ([]*models.FriendsEdge, error) 124 Friends(ctx context.Context, obj *models.FriendsConnection) ([]models.Character, error) 125 } 126 type HumanResolver interface { 127 Friends(ctx context.Context, obj *models.Human) ([]models.Character, error) 128 FriendsConnection(ctx context.Context, obj *models.Human, first *int, after *string) (*models.FriendsConnection, error) 129 130 Starships(ctx context.Context, obj *models.Human) ([]*models.Starship, error) 131 } 132 type MutationResolver interface { 133 CreateReview(ctx context.Context, episode models.Episode, review models.Review) (*models.Review, error) 134 } 135 type QueryResolver interface { 136 Hero(ctx context.Context, episode *models.Episode) (models.Character, error) 137 Reviews(ctx context.Context, episode models.Episode, since *time.Time) ([]*models.Review, error) 138 Search(ctx context.Context, text string) ([]models.SearchResult, error) 139 Character(ctx context.Context, id string) (models.Character, error) 140 Droid(ctx context.Context, id string) (*models.Droid, error) 141 Human(ctx context.Context, id string) (*models.Human, error) 142 Starship(ctx context.Context, id string) (*models.Starship, error) 143 } 144 type StarshipResolver interface { 145 Length(ctx context.Context, obj *models.Starship, unit *models.LengthUnit) (float64, error) 146 } 147 148 type executableSchema struct { 149 resolvers ResolverRoot 150 directives DirectiveRoot 151 complexity ComplexityRoot 152 } 153 154 func (e *executableSchema) Schema() *ast.Schema { 155 return parsedSchema 156 } 157 158 func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { 159 ec := executionContext{nil, e} 160 _ = ec 161 switch typeName + "." + field { 162 163 case "Droid.appearsIn": 164 if e.complexity.Droid.AppearsIn == nil { 165 break 166 } 167 168 return e.complexity.Droid.AppearsIn(childComplexity), true 169 170 case "Droid.friends": 171 if e.complexity.Droid.Friends == nil { 172 break 173 } 174 175 return e.complexity.Droid.Friends(childComplexity), true 176 177 case "Droid.friendsConnection": 178 if e.complexity.Droid.FriendsConnection == nil { 179 break 180 } 181 182 args, err := ec.field_Droid_friendsConnection_args(context.TODO(), rawArgs) 183 if err != nil { 184 return 0, false 185 } 186 187 return e.complexity.Droid.FriendsConnection(childComplexity, args["first"].(*int), args["after"].(*string)), true 188 189 case "Droid.id": 190 if e.complexity.Droid.ID == nil { 191 break 192 } 193 194 return e.complexity.Droid.ID(childComplexity), true 195 196 case "Droid.name": 197 if e.complexity.Droid.Name == nil { 198 break 199 } 200 201 return e.complexity.Droid.Name(childComplexity), true 202 203 case "Droid.primaryFunction": 204 if e.complexity.Droid.PrimaryFunction == nil { 205 break 206 } 207 208 return e.complexity.Droid.PrimaryFunction(childComplexity), true 209 210 case "FriendsConnection.edges": 211 if e.complexity.FriendsConnection.Edges == nil { 212 break 213 } 214 215 return e.complexity.FriendsConnection.Edges(childComplexity), true 216 217 case "FriendsConnection.friends": 218 if e.complexity.FriendsConnection.Friends == nil { 219 break 220 } 221 222 return e.complexity.FriendsConnection.Friends(childComplexity), true 223 224 case "FriendsConnection.pageInfo": 225 if e.complexity.FriendsConnection.PageInfo == nil { 226 break 227 } 228 229 return e.complexity.FriendsConnection.PageInfo(childComplexity), true 230 231 case "FriendsConnection.totalCount": 232 if e.complexity.FriendsConnection.TotalCount == nil { 233 break 234 } 235 236 return e.complexity.FriendsConnection.TotalCount(childComplexity), true 237 238 case "FriendsEdge.cursor": 239 if e.complexity.FriendsEdge.Cursor == nil { 240 break 241 } 242 243 return e.complexity.FriendsEdge.Cursor(childComplexity), true 244 245 case "FriendsEdge.node": 246 if e.complexity.FriendsEdge.Node == nil { 247 break 248 } 249 250 return e.complexity.FriendsEdge.Node(childComplexity), true 251 252 case "Human.appearsIn": 253 if e.complexity.Human.AppearsIn == nil { 254 break 255 } 256 257 return e.complexity.Human.AppearsIn(childComplexity), true 258 259 case "Human.friends": 260 if e.complexity.Human.Friends == nil { 261 break 262 } 263 264 return e.complexity.Human.Friends(childComplexity), true 265 266 case "Human.friendsConnection": 267 if e.complexity.Human.FriendsConnection == nil { 268 break 269 } 270 271 args, err := ec.field_Human_friendsConnection_args(context.TODO(), rawArgs) 272 if err != nil { 273 return 0, false 274 } 275 276 return e.complexity.Human.FriendsConnection(childComplexity, args["first"].(*int), args["after"].(*string)), true 277 278 case "Human.height": 279 if e.complexity.Human.Height == nil { 280 break 281 } 282 283 args, err := ec.field_Human_height_args(context.TODO(), rawArgs) 284 if err != nil { 285 return 0, false 286 } 287 288 return e.complexity.Human.Height(childComplexity, args["unit"].(models.LengthUnit)), true 289 290 case "Human.id": 291 if e.complexity.Human.ID == nil { 292 break 293 } 294 295 return e.complexity.Human.ID(childComplexity), true 296 297 case "Human.mass": 298 if e.complexity.Human.Mass == nil { 299 break 300 } 301 302 return e.complexity.Human.Mass(childComplexity), true 303 304 case "Human.name": 305 if e.complexity.Human.Name == nil { 306 break 307 } 308 309 return e.complexity.Human.Name(childComplexity), true 310 311 case "Human.starships": 312 if e.complexity.Human.Starships == nil { 313 break 314 } 315 316 return e.complexity.Human.Starships(childComplexity), true 317 318 case "Mutation.createReview": 319 if e.complexity.Mutation.CreateReview == nil { 320 break 321 } 322 323 args, err := ec.field_Mutation_createReview_args(context.TODO(), rawArgs) 324 if err != nil { 325 return 0, false 326 } 327 328 return e.complexity.Mutation.CreateReview(childComplexity, args["episode"].(models.Episode), args["review"].(models.Review)), true 329 330 case "PageInfo.endCursor": 331 if e.complexity.PageInfo.EndCursor == nil { 332 break 333 } 334 335 return e.complexity.PageInfo.EndCursor(childComplexity), true 336 337 case "PageInfo.hasNextPage": 338 if e.complexity.PageInfo.HasNextPage == nil { 339 break 340 } 341 342 return e.complexity.PageInfo.HasNextPage(childComplexity), true 343 344 case "PageInfo.startCursor": 345 if e.complexity.PageInfo.StartCursor == nil { 346 break 347 } 348 349 return e.complexity.PageInfo.StartCursor(childComplexity), true 350 351 case "Query.character": 352 if e.complexity.Query.Character == nil { 353 break 354 } 355 356 args, err := ec.field_Query_character_args(context.TODO(), rawArgs) 357 if err != nil { 358 return 0, false 359 } 360 361 return e.complexity.Query.Character(childComplexity, args["id"].(string)), true 362 363 case "Query.droid": 364 if e.complexity.Query.Droid == nil { 365 break 366 } 367 368 args, err := ec.field_Query_droid_args(context.TODO(), rawArgs) 369 if err != nil { 370 return 0, false 371 } 372 373 return e.complexity.Query.Droid(childComplexity, args["id"].(string)), true 374 375 case "Query.hero": 376 if e.complexity.Query.Hero == nil { 377 break 378 } 379 380 args, err := ec.field_Query_hero_args(context.TODO(), rawArgs) 381 if err != nil { 382 return 0, false 383 } 384 385 return e.complexity.Query.Hero(childComplexity, args["episode"].(*models.Episode)), true 386 387 case "Query.human": 388 if e.complexity.Query.Human == nil { 389 break 390 } 391 392 args, err := ec.field_Query_human_args(context.TODO(), rawArgs) 393 if err != nil { 394 return 0, false 395 } 396 397 return e.complexity.Query.Human(childComplexity, args["id"].(string)), true 398 399 case "Query.reviews": 400 if e.complexity.Query.Reviews == nil { 401 break 402 } 403 404 args, err := ec.field_Query_reviews_args(context.TODO(), rawArgs) 405 if err != nil { 406 return 0, false 407 } 408 409 return e.complexity.Query.Reviews(childComplexity, args["episode"].(models.Episode), args["since"].(*time.Time)), true 410 411 case "Query.search": 412 if e.complexity.Query.Search == nil { 413 break 414 } 415 416 args, err := ec.field_Query_search_args(context.TODO(), rawArgs) 417 if err != nil { 418 return 0, false 419 } 420 421 return e.complexity.Query.Search(childComplexity, args["text"].(string)), true 422 423 case "Query.starship": 424 if e.complexity.Query.Starship == nil { 425 break 426 } 427 428 args, err := ec.field_Query_starship_args(context.TODO(), rawArgs) 429 if err != nil { 430 return 0, false 431 } 432 433 return e.complexity.Query.Starship(childComplexity, args["id"].(string)), true 434 435 case "Review.commentary": 436 if e.complexity.Review.Commentary == nil { 437 break 438 } 439 440 return e.complexity.Review.Commentary(childComplexity), true 441 442 case "Review.stars": 443 if e.complexity.Review.Stars == nil { 444 break 445 } 446 447 return e.complexity.Review.Stars(childComplexity), true 448 449 case "Review.time": 450 if e.complexity.Review.Time == nil { 451 break 452 } 453 454 return e.complexity.Review.Time(childComplexity), true 455 456 case "Starship.history": 457 if e.complexity.Starship.History == nil { 458 break 459 } 460 461 return e.complexity.Starship.History(childComplexity), true 462 463 case "Starship.id": 464 if e.complexity.Starship.ID == nil { 465 break 466 } 467 468 return e.complexity.Starship.ID(childComplexity), true 469 470 case "Starship.length": 471 if e.complexity.Starship.Length == nil { 472 break 473 } 474 475 args, err := ec.field_Starship_length_args(context.TODO(), rawArgs) 476 if err != nil { 477 return 0, false 478 } 479 480 return e.complexity.Starship.Length(childComplexity, args["unit"].(*models.LengthUnit)), true 481 482 case "Starship.name": 483 if e.complexity.Starship.Name == nil { 484 break 485 } 486 487 return e.complexity.Starship.Name(childComplexity), true 488 489 } 490 return 0, false 491 } 492 493 func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { 494 rc := graphql.GetOperationContext(ctx) 495 ec := executionContext{rc, e} 496 first := true 497 498 switch rc.Operation.Operation { 499 case ast.Query: 500 return func(ctx context.Context) *graphql.Response { 501 if !first { 502 return nil 503 } 504 first = false 505 data := ec._Query(ctx, rc.Operation.SelectionSet) 506 var buf bytes.Buffer 507 data.MarshalGQL(&buf) 508 509 return &graphql.Response{ 510 Data: buf.Bytes(), 511 } 512 } 513 case ast.Mutation: 514 return func(ctx context.Context) *graphql.Response { 515 if !first { 516 return nil 517 } 518 first = false 519 data := ec._Mutation(ctx, rc.Operation.SelectionSet) 520 var buf bytes.Buffer 521 data.MarshalGQL(&buf) 522 523 return &graphql.Response{ 524 Data: buf.Bytes(), 525 } 526 } 527 528 default: 529 return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) 530 } 531 } 532 533 type executionContext struct { 534 *graphql.OperationContext 535 *executableSchema 536 } 537 538 func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { 539 if ec.DisableIntrospection { 540 return nil, errors.New("introspection disabled") 541 } 542 return introspection.WrapSchema(parsedSchema), nil 543 } 544 545 func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { 546 if ec.DisableIntrospection { 547 return nil, errors.New("introspection disabled") 548 } 549 return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil 550 } 551 552 var parsedSchema = gqlparser.MustLoadSchema( 553 &ast.Source{Name: "schema.graphql", Input: `# The query type, represents all of the entry points into our object graph 554 type Query { 555 hero(episode: Episode = NEWHOPE): Character 556 reviews(episode: Episode!, since: Time): [Review!]! 557 search(text: String!): [SearchResult!]! 558 character(id: ID!): Character 559 droid(id: ID!): Droid 560 human(id: ID!): Human 561 starship(id: ID!): Starship 562 } 563 # The mutation type, represents all updates we can make to our data 564 type Mutation { 565 createReview(episode: Episode!, review: ReviewInput!): Review 566 } 567 # The episodes in the Star Wars trilogy 568 enum Episode { 569 # Star Wars Episode IV: A New Hope, released in 1977. 570 NEWHOPE 571 # Star Wars Episode V: The Empire Strikes Back, released in 1980. 572 EMPIRE 573 # Star Wars Episode VI: Return of the Jedi, released in 1983. 574 JEDI 575 } 576 # A character from the Star Wars universe 577 interface Character { 578 # The ID of the character 579 id: ID! 580 # The name of the character 581 name: String! 582 # The friends of the character, or an empty list if they have none 583 friends: [Character!] 584 # The friends of the character exposed as a connection with edges 585 friendsConnection(first: Int, after: ID): FriendsConnection! 586 # The movies this character appears in 587 appearsIn: [Episode!]! 588 } 589 # Units of height 590 enum LengthUnit { 591 # The standard unit around the world 592 METER 593 # Primarily used in the United States 594 FOOT 595 } 596 # A humanoid creature from the Star Wars universe 597 type Human implements Character { 598 # The ID of the human 599 id: ID! 600 # What this human calls themselves 601 name: String! 602 # Height in the preferred unit, default is meters 603 height(unit: LengthUnit = METER): Float! 604 # Mass in kilograms, or null if unknown 605 mass: Float 606 # This human's friends, or an empty list if they have none 607 friends: [Character!] 608 # The friends of the human exposed as a connection with edges 609 friendsConnection(first: Int, after: ID): FriendsConnection! 610 # The movies this human appears in 611 appearsIn: [Episode!]! 612 # A list of starships this person has piloted, or an empty list if none 613 starships: [Starship!] 614 } 615 # An autonomous mechanical character in the Star Wars universe 616 type Droid implements Character { 617 # The ID of the droid 618 id: ID! 619 # What others call this droid 620 name: String! 621 # This droid's friends, or an empty list if they have none 622 friends: [Character!] 623 # The friends of the droid exposed as a connection with edges 624 friendsConnection(first: Int, after: ID): FriendsConnection! 625 # The movies this droid appears in 626 appearsIn: [Episode!]! 627 # This droid's primary function 628 primaryFunction: String 629 } 630 # A connection object for a character's friends 631 type FriendsConnection { 632 # The total number of friends 633 totalCount: Int! 634 # The edges for each of the character's friends. 635 edges: [FriendsEdge!] 636 # A list of the friends, as a convenience when edges are not needed. 637 friends: [Character!] 638 # Information for paginating this connection 639 pageInfo: PageInfo! 640 } 641 # An edge object for a character's friends 642 type FriendsEdge { 643 # A cursor used for pagination 644 cursor: ID! 645 # The character represented by this friendship edge 646 node: Character 647 } 648 # Information for paginating this connection 649 type PageInfo { 650 startCursor: ID! 651 endCursor: ID! 652 hasNextPage: Boolean! 653 } 654 # Represents a review for a movie 655 type Review { 656 # The number of stars this review gave, 1-5 657 stars: Int! 658 # Comment about the movie 659 commentary: String 660 # when the review was posted 661 time: Time 662 } 663 # The input object sent when someone is creating a new review 664 input ReviewInput { 665 # 0-5 stars 666 stars: Int! 667 # Comment about the movie, optional 668 commentary: String 669 # when the review was posted 670 time: Time 671 } 672 type Starship { 673 # The ID of the starship 674 id: ID! 675 # The name of the starship 676 name: String! 677 # Length of the starship, along the longest axis 678 length(unit: LengthUnit = METER): Float! 679 # coordinates tracking this ship 680 history: [[Int!]!]! 681 } 682 union SearchResult = Human | Droid | Starship 683 scalar Time 684 `}, 685 ) 686 687 // endregion ************************** generated!.gotpl ************************** 688 689 // region ***************************** args.gotpl ***************************** 690 691 func (ec *executionContext) field_Droid_friendsConnection_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 692 var err error 693 args := map[string]interface{}{} 694 var arg0 *int 695 if tmp, ok := rawArgs["first"]; ok { 696 arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) 697 if err != nil { 698 return nil, err 699 } 700 } 701 args["first"] = arg0 702 var arg1 *string 703 if tmp, ok := rawArgs["after"]; ok { 704 arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) 705 if err != nil { 706 return nil, err 707 } 708 } 709 args["after"] = arg1 710 return args, nil 711 } 712 713 func (ec *executionContext) field_Human_friendsConnection_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 714 var err error 715 args := map[string]interface{}{} 716 var arg0 *int 717 if tmp, ok := rawArgs["first"]; ok { 718 arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) 719 if err != nil { 720 return nil, err 721 } 722 } 723 args["first"] = arg0 724 var arg1 *string 725 if tmp, ok := rawArgs["after"]; ok { 726 arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) 727 if err != nil { 728 return nil, err 729 } 730 } 731 args["after"] = arg1 732 return args, nil 733 } 734 735 func (ec *executionContext) field_Human_height_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 736 var err error 737 args := map[string]interface{}{} 738 var arg0 models.LengthUnit 739 if tmp, ok := rawArgs["unit"]; ok { 740 arg0, err = ec.unmarshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx, tmp) 741 if err != nil { 742 return nil, err 743 } 744 } 745 args["unit"] = arg0 746 return args, nil 747 } 748 749 func (ec *executionContext) field_Mutation_createReview_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 750 var err error 751 args := map[string]interface{}{} 752 var arg0 models.Episode 753 if tmp, ok := rawArgs["episode"]; ok { 754 arg0, err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) 755 if err != nil { 756 return nil, err 757 } 758 } 759 args["episode"] = arg0 760 var arg1 models.Review 761 if tmp, ok := rawArgs["review"]; ok { 762 arg1, err = ec.unmarshalNReviewInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx, tmp) 763 if err != nil { 764 return nil, err 765 } 766 } 767 args["review"] = arg1 768 return args, nil 769 } 770 771 func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 772 var err error 773 args := map[string]interface{}{} 774 var arg0 string 775 if tmp, ok := rawArgs["name"]; ok { 776 arg0, err = ec.unmarshalNString2string(ctx, tmp) 777 if err != nil { 778 return nil, err 779 } 780 } 781 args["name"] = arg0 782 return args, nil 783 } 784 785 func (ec *executionContext) field_Query_character_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 786 var err error 787 args := map[string]interface{}{} 788 var arg0 string 789 if tmp, ok := rawArgs["id"]; ok { 790 arg0, err = ec.unmarshalNID2string(ctx, tmp) 791 if err != nil { 792 return nil, err 793 } 794 } 795 args["id"] = arg0 796 return args, nil 797 } 798 799 func (ec *executionContext) field_Query_droid_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 800 var err error 801 args := map[string]interface{}{} 802 var arg0 string 803 if tmp, ok := rawArgs["id"]; ok { 804 arg0, err = ec.unmarshalNID2string(ctx, tmp) 805 if err != nil { 806 return nil, err 807 } 808 } 809 args["id"] = arg0 810 return args, nil 811 } 812 813 func (ec *executionContext) field_Query_hero_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 814 var err error 815 args := map[string]interface{}{} 816 var arg0 *models.Episode 817 if tmp, ok := rawArgs["episode"]; ok { 818 arg0, err = ec.unmarshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) 819 if err != nil { 820 return nil, err 821 } 822 } 823 args["episode"] = arg0 824 return args, nil 825 } 826 827 func (ec *executionContext) field_Query_human_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 828 var err error 829 args := map[string]interface{}{} 830 var arg0 string 831 if tmp, ok := rawArgs["id"]; ok { 832 arg0, err = ec.unmarshalNID2string(ctx, tmp) 833 if err != nil { 834 return nil, err 835 } 836 } 837 args["id"] = arg0 838 return args, nil 839 } 840 841 func (ec *executionContext) field_Query_reviews_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 842 var err error 843 args := map[string]interface{}{} 844 var arg0 models.Episode 845 if tmp, ok := rawArgs["episode"]; ok { 846 arg0, err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, tmp) 847 if err != nil { 848 return nil, err 849 } 850 } 851 args["episode"] = arg0 852 var arg1 *time.Time 853 if tmp, ok := rawArgs["since"]; ok { 854 arg1, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, tmp) 855 if err != nil { 856 return nil, err 857 } 858 } 859 args["since"] = arg1 860 return args, nil 861 } 862 863 func (ec *executionContext) field_Query_search_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 864 var err error 865 args := map[string]interface{}{} 866 var arg0 string 867 if tmp, ok := rawArgs["text"]; ok { 868 arg0, err = ec.unmarshalNString2string(ctx, tmp) 869 if err != nil { 870 return nil, err 871 } 872 } 873 args["text"] = arg0 874 return args, nil 875 } 876 877 func (ec *executionContext) field_Query_starship_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 878 var err error 879 args := map[string]interface{}{} 880 var arg0 string 881 if tmp, ok := rawArgs["id"]; ok { 882 arg0, err = ec.unmarshalNID2string(ctx, tmp) 883 if err != nil { 884 return nil, err 885 } 886 } 887 args["id"] = arg0 888 return args, nil 889 } 890 891 func (ec *executionContext) field_Starship_length_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 892 var err error 893 args := map[string]interface{}{} 894 var arg0 *models.LengthUnit 895 if tmp, ok := rawArgs["unit"]; ok { 896 arg0, err = ec.unmarshalOLengthUnit2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx, tmp) 897 if err != nil { 898 return nil, err 899 } 900 } 901 args["unit"] = arg0 902 return args, nil 903 } 904 905 func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 906 var err error 907 args := map[string]interface{}{} 908 var arg0 bool 909 if tmp, ok := rawArgs["includeDeprecated"]; ok { 910 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 911 if err != nil { 912 return nil, err 913 } 914 } 915 args["includeDeprecated"] = arg0 916 return args, nil 917 } 918 919 func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 920 var err error 921 args := map[string]interface{}{} 922 var arg0 bool 923 if tmp, ok := rawArgs["includeDeprecated"]; ok { 924 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 925 if err != nil { 926 return nil, err 927 } 928 } 929 args["includeDeprecated"] = arg0 930 return args, nil 931 } 932 933 // endregion ***************************** args.gotpl ***************************** 934 935 // region ************************** directives.gotpl ************************** 936 937 // endregion ************************** directives.gotpl ************************** 938 939 // region **************************** field.gotpl ***************************** 940 941 func (ec *executionContext) _Droid_id(ctx context.Context, field graphql.CollectedField, obj *models.Droid) (ret graphql.Marshaler) { 942 defer func() { 943 if r := recover(); r != nil { 944 ec.Error(ctx, ec.Recover(ctx, r)) 945 ret = graphql.Null 946 } 947 }() 948 fc := &graphql.FieldContext{ 949 Object: "Droid", 950 Field: field, 951 Args: nil, 952 IsMethod: false, 953 } 954 955 ctx = graphql.WithFieldContext(ctx, fc) 956 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 957 ctx = rctx // use context from middleware stack in children 958 return obj.ID, nil 959 }) 960 if err != nil { 961 ec.Error(ctx, err) 962 return graphql.Null 963 } 964 if resTmp == nil { 965 if !graphql.HasFieldError(ctx, fc) { 966 ec.Errorf(ctx, "must not be null") 967 } 968 return graphql.Null 969 } 970 res := resTmp.(string) 971 fc.Result = res 972 return ec.marshalNID2string(ctx, field.Selections, res) 973 } 974 975 func (ec *executionContext) _Droid_name(ctx context.Context, field graphql.CollectedField, obj *models.Droid) (ret graphql.Marshaler) { 976 defer func() { 977 if r := recover(); r != nil { 978 ec.Error(ctx, ec.Recover(ctx, r)) 979 ret = graphql.Null 980 } 981 }() 982 fc := &graphql.FieldContext{ 983 Object: "Droid", 984 Field: field, 985 Args: nil, 986 IsMethod: false, 987 } 988 989 ctx = graphql.WithFieldContext(ctx, fc) 990 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 991 ctx = rctx // use context from middleware stack in children 992 return obj.Name, nil 993 }) 994 if err != nil { 995 ec.Error(ctx, err) 996 return graphql.Null 997 } 998 if resTmp == nil { 999 if !graphql.HasFieldError(ctx, fc) { 1000 ec.Errorf(ctx, "must not be null") 1001 } 1002 return graphql.Null 1003 } 1004 res := resTmp.(string) 1005 fc.Result = res 1006 return ec.marshalNString2string(ctx, field.Selections, res) 1007 } 1008 1009 func (ec *executionContext) _Droid_friends(ctx context.Context, field graphql.CollectedField, obj *models.Droid) (ret graphql.Marshaler) { 1010 defer func() { 1011 if r := recover(); r != nil { 1012 ec.Error(ctx, ec.Recover(ctx, r)) 1013 ret = graphql.Null 1014 } 1015 }() 1016 fc := &graphql.FieldContext{ 1017 Object: "Droid", 1018 Field: field, 1019 Args: nil, 1020 IsMethod: true, 1021 } 1022 1023 ctx = graphql.WithFieldContext(ctx, fc) 1024 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1025 ctx = rctx // use context from middleware stack in children 1026 return ec.resolvers.Droid().Friends(rctx, obj) 1027 }) 1028 if err != nil { 1029 ec.Error(ctx, err) 1030 return graphql.Null 1031 } 1032 if resTmp == nil { 1033 return graphql.Null 1034 } 1035 res := resTmp.([]models.Character) 1036 fc.Result = res 1037 return ec.marshalOCharacter2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacterᚄ(ctx, field.Selections, res) 1038 } 1039 1040 func (ec *executionContext) _Droid_friendsConnection(ctx context.Context, field graphql.CollectedField, obj *models.Droid) (ret graphql.Marshaler) { 1041 defer func() { 1042 if r := recover(); r != nil { 1043 ec.Error(ctx, ec.Recover(ctx, r)) 1044 ret = graphql.Null 1045 } 1046 }() 1047 fc := &graphql.FieldContext{ 1048 Object: "Droid", 1049 Field: field, 1050 Args: nil, 1051 IsMethod: true, 1052 } 1053 1054 ctx = graphql.WithFieldContext(ctx, fc) 1055 rawArgs := field.ArgumentMap(ec.Variables) 1056 args, err := ec.field_Droid_friendsConnection_args(ctx, rawArgs) 1057 if err != nil { 1058 ec.Error(ctx, err) 1059 return graphql.Null 1060 } 1061 fc.Args = args 1062 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1063 ctx = rctx // use context from middleware stack in children 1064 return ec.resolvers.Droid().FriendsConnection(rctx, obj, args["first"].(*int), args["after"].(*string)) 1065 }) 1066 if err != nil { 1067 ec.Error(ctx, err) 1068 return graphql.Null 1069 } 1070 if resTmp == nil { 1071 if !graphql.HasFieldError(ctx, fc) { 1072 ec.Errorf(ctx, "must not be null") 1073 } 1074 return graphql.Null 1075 } 1076 res := resTmp.(*models.FriendsConnection) 1077 fc.Result = res 1078 return ec.marshalNFriendsConnection2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsConnection(ctx, field.Selections, res) 1079 } 1080 1081 func (ec *executionContext) _Droid_appearsIn(ctx context.Context, field graphql.CollectedField, obj *models.Droid) (ret graphql.Marshaler) { 1082 defer func() { 1083 if r := recover(); r != nil { 1084 ec.Error(ctx, ec.Recover(ctx, r)) 1085 ret = graphql.Null 1086 } 1087 }() 1088 fc := &graphql.FieldContext{ 1089 Object: "Droid", 1090 Field: field, 1091 Args: nil, 1092 IsMethod: false, 1093 } 1094 1095 ctx = graphql.WithFieldContext(ctx, fc) 1096 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1097 ctx = rctx // use context from middleware stack in children 1098 return obj.AppearsIn, nil 1099 }) 1100 if err != nil { 1101 ec.Error(ctx, err) 1102 return graphql.Null 1103 } 1104 if resTmp == nil { 1105 if !graphql.HasFieldError(ctx, fc) { 1106 ec.Errorf(ctx, "must not be null") 1107 } 1108 return graphql.Null 1109 } 1110 res := resTmp.([]models.Episode) 1111 fc.Result = res 1112 return ec.marshalNEpisode2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisodeᚄ(ctx, field.Selections, res) 1113 } 1114 1115 func (ec *executionContext) _Droid_primaryFunction(ctx context.Context, field graphql.CollectedField, obj *models.Droid) (ret graphql.Marshaler) { 1116 defer func() { 1117 if r := recover(); r != nil { 1118 ec.Error(ctx, ec.Recover(ctx, r)) 1119 ret = graphql.Null 1120 } 1121 }() 1122 fc := &graphql.FieldContext{ 1123 Object: "Droid", 1124 Field: field, 1125 Args: nil, 1126 IsMethod: false, 1127 } 1128 1129 ctx = graphql.WithFieldContext(ctx, fc) 1130 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1131 ctx = rctx // use context from middleware stack in children 1132 return obj.PrimaryFunction, nil 1133 }) 1134 if err != nil { 1135 ec.Error(ctx, err) 1136 return graphql.Null 1137 } 1138 if resTmp == nil { 1139 return graphql.Null 1140 } 1141 res := resTmp.(string) 1142 fc.Result = res 1143 return ec.marshalOString2string(ctx, field.Selections, res) 1144 } 1145 1146 func (ec *executionContext) _FriendsConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *models.FriendsConnection) (ret graphql.Marshaler) { 1147 defer func() { 1148 if r := recover(); r != nil { 1149 ec.Error(ctx, ec.Recover(ctx, r)) 1150 ret = graphql.Null 1151 } 1152 }() 1153 fc := &graphql.FieldContext{ 1154 Object: "FriendsConnection", 1155 Field: field, 1156 Args: nil, 1157 IsMethod: true, 1158 } 1159 1160 ctx = graphql.WithFieldContext(ctx, fc) 1161 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1162 ctx = rctx // use context from middleware stack in children 1163 return obj.TotalCount(), nil 1164 }) 1165 if err != nil { 1166 ec.Error(ctx, err) 1167 return graphql.Null 1168 } 1169 if resTmp == nil { 1170 if !graphql.HasFieldError(ctx, fc) { 1171 ec.Errorf(ctx, "must not be null") 1172 } 1173 return graphql.Null 1174 } 1175 res := resTmp.(int) 1176 fc.Result = res 1177 return ec.marshalNInt2int(ctx, field.Selections, res) 1178 } 1179 1180 func (ec *executionContext) _FriendsConnection_edges(ctx context.Context, field graphql.CollectedField, obj *models.FriendsConnection) (ret graphql.Marshaler) { 1181 defer func() { 1182 if r := recover(); r != nil { 1183 ec.Error(ctx, ec.Recover(ctx, r)) 1184 ret = graphql.Null 1185 } 1186 }() 1187 fc := &graphql.FieldContext{ 1188 Object: "FriendsConnection", 1189 Field: field, 1190 Args: nil, 1191 IsMethod: true, 1192 } 1193 1194 ctx = graphql.WithFieldContext(ctx, fc) 1195 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1196 ctx = rctx // use context from middleware stack in children 1197 return ec.resolvers.FriendsConnection().Edges(rctx, obj) 1198 }) 1199 if err != nil { 1200 ec.Error(ctx, err) 1201 return graphql.Null 1202 } 1203 if resTmp == nil { 1204 return graphql.Null 1205 } 1206 res := resTmp.([]*models.FriendsEdge) 1207 fc.Result = res 1208 return ec.marshalOFriendsEdge2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsEdgeᚄ(ctx, field.Selections, res) 1209 } 1210 1211 func (ec *executionContext) _FriendsConnection_friends(ctx context.Context, field graphql.CollectedField, obj *models.FriendsConnection) (ret graphql.Marshaler) { 1212 defer func() { 1213 if r := recover(); r != nil { 1214 ec.Error(ctx, ec.Recover(ctx, r)) 1215 ret = graphql.Null 1216 } 1217 }() 1218 fc := &graphql.FieldContext{ 1219 Object: "FriendsConnection", 1220 Field: field, 1221 Args: nil, 1222 IsMethod: true, 1223 } 1224 1225 ctx = graphql.WithFieldContext(ctx, fc) 1226 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1227 ctx = rctx // use context from middleware stack in children 1228 return ec.resolvers.FriendsConnection().Friends(rctx, obj) 1229 }) 1230 if err != nil { 1231 ec.Error(ctx, err) 1232 return graphql.Null 1233 } 1234 if resTmp == nil { 1235 return graphql.Null 1236 } 1237 res := resTmp.([]models.Character) 1238 fc.Result = res 1239 return ec.marshalOCharacter2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacterᚄ(ctx, field.Selections, res) 1240 } 1241 1242 func (ec *executionContext) _FriendsConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *models.FriendsConnection) (ret graphql.Marshaler) { 1243 defer func() { 1244 if r := recover(); r != nil { 1245 ec.Error(ctx, ec.Recover(ctx, r)) 1246 ret = graphql.Null 1247 } 1248 }() 1249 fc := &graphql.FieldContext{ 1250 Object: "FriendsConnection", 1251 Field: field, 1252 Args: nil, 1253 IsMethod: true, 1254 } 1255 1256 ctx = graphql.WithFieldContext(ctx, fc) 1257 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1258 ctx = rctx // use context from middleware stack in children 1259 return obj.PageInfo(), nil 1260 }) 1261 if err != nil { 1262 ec.Error(ctx, err) 1263 return graphql.Null 1264 } 1265 if resTmp == nil { 1266 if !graphql.HasFieldError(ctx, fc) { 1267 ec.Errorf(ctx, "must not be null") 1268 } 1269 return graphql.Null 1270 } 1271 res := resTmp.(models.PageInfo) 1272 fc.Result = res 1273 return ec.marshalNPageInfo2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐPageInfo(ctx, field.Selections, res) 1274 } 1275 1276 func (ec *executionContext) _FriendsEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *models.FriendsEdge) (ret graphql.Marshaler) { 1277 defer func() { 1278 if r := recover(); r != nil { 1279 ec.Error(ctx, ec.Recover(ctx, r)) 1280 ret = graphql.Null 1281 } 1282 }() 1283 fc := &graphql.FieldContext{ 1284 Object: "FriendsEdge", 1285 Field: field, 1286 Args: nil, 1287 IsMethod: false, 1288 } 1289 1290 ctx = graphql.WithFieldContext(ctx, fc) 1291 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1292 ctx = rctx // use context from middleware stack in children 1293 return obj.Cursor, nil 1294 }) 1295 if err != nil { 1296 ec.Error(ctx, err) 1297 return graphql.Null 1298 } 1299 if resTmp == nil { 1300 if !graphql.HasFieldError(ctx, fc) { 1301 ec.Errorf(ctx, "must not be null") 1302 } 1303 return graphql.Null 1304 } 1305 res := resTmp.(string) 1306 fc.Result = res 1307 return ec.marshalNID2string(ctx, field.Selections, res) 1308 } 1309 1310 func (ec *executionContext) _FriendsEdge_node(ctx context.Context, field graphql.CollectedField, obj *models.FriendsEdge) (ret graphql.Marshaler) { 1311 defer func() { 1312 if r := recover(); r != nil { 1313 ec.Error(ctx, ec.Recover(ctx, r)) 1314 ret = graphql.Null 1315 } 1316 }() 1317 fc := &graphql.FieldContext{ 1318 Object: "FriendsEdge", 1319 Field: field, 1320 Args: nil, 1321 IsMethod: false, 1322 } 1323 1324 ctx = graphql.WithFieldContext(ctx, fc) 1325 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1326 ctx = rctx // use context from middleware stack in children 1327 return obj.Node, nil 1328 }) 1329 if err != nil { 1330 ec.Error(ctx, err) 1331 return graphql.Null 1332 } 1333 if resTmp == nil { 1334 return graphql.Null 1335 } 1336 res := resTmp.(models.Character) 1337 fc.Result = res 1338 return ec.marshalOCharacter2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacter(ctx, field.Selections, res) 1339 } 1340 1341 func (ec *executionContext) _Human_id(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1342 defer func() { 1343 if r := recover(); r != nil { 1344 ec.Error(ctx, ec.Recover(ctx, r)) 1345 ret = graphql.Null 1346 } 1347 }() 1348 fc := &graphql.FieldContext{ 1349 Object: "Human", 1350 Field: field, 1351 Args: nil, 1352 IsMethod: false, 1353 } 1354 1355 ctx = graphql.WithFieldContext(ctx, fc) 1356 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1357 ctx = rctx // use context from middleware stack in children 1358 return obj.ID, nil 1359 }) 1360 if err != nil { 1361 ec.Error(ctx, err) 1362 return graphql.Null 1363 } 1364 if resTmp == nil { 1365 if !graphql.HasFieldError(ctx, fc) { 1366 ec.Errorf(ctx, "must not be null") 1367 } 1368 return graphql.Null 1369 } 1370 res := resTmp.(string) 1371 fc.Result = res 1372 return ec.marshalNID2string(ctx, field.Selections, res) 1373 } 1374 1375 func (ec *executionContext) _Human_name(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1376 defer func() { 1377 if r := recover(); r != nil { 1378 ec.Error(ctx, ec.Recover(ctx, r)) 1379 ret = graphql.Null 1380 } 1381 }() 1382 fc := &graphql.FieldContext{ 1383 Object: "Human", 1384 Field: field, 1385 Args: nil, 1386 IsMethod: false, 1387 } 1388 1389 ctx = graphql.WithFieldContext(ctx, fc) 1390 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1391 ctx = rctx // use context from middleware stack in children 1392 return obj.Name, nil 1393 }) 1394 if err != nil { 1395 ec.Error(ctx, err) 1396 return graphql.Null 1397 } 1398 if resTmp == nil { 1399 if !graphql.HasFieldError(ctx, fc) { 1400 ec.Errorf(ctx, "must not be null") 1401 } 1402 return graphql.Null 1403 } 1404 res := resTmp.(string) 1405 fc.Result = res 1406 return ec.marshalNString2string(ctx, field.Selections, res) 1407 } 1408 1409 func (ec *executionContext) _Human_height(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1410 defer func() { 1411 if r := recover(); r != nil { 1412 ec.Error(ctx, ec.Recover(ctx, r)) 1413 ret = graphql.Null 1414 } 1415 }() 1416 fc := &graphql.FieldContext{ 1417 Object: "Human", 1418 Field: field, 1419 Args: nil, 1420 IsMethod: true, 1421 } 1422 1423 ctx = graphql.WithFieldContext(ctx, fc) 1424 rawArgs := field.ArgumentMap(ec.Variables) 1425 args, err := ec.field_Human_height_args(ctx, rawArgs) 1426 if err != nil { 1427 ec.Error(ctx, err) 1428 return graphql.Null 1429 } 1430 fc.Args = args 1431 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1432 ctx = rctx // use context from middleware stack in children 1433 return obj.Height(args["unit"].(models.LengthUnit)), nil 1434 }) 1435 if err != nil { 1436 ec.Error(ctx, err) 1437 return graphql.Null 1438 } 1439 if resTmp == nil { 1440 if !graphql.HasFieldError(ctx, fc) { 1441 ec.Errorf(ctx, "must not be null") 1442 } 1443 return graphql.Null 1444 } 1445 res := resTmp.(float64) 1446 fc.Result = res 1447 return ec.marshalNFloat2float64(ctx, field.Selections, res) 1448 } 1449 1450 func (ec *executionContext) _Human_mass(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1451 defer func() { 1452 if r := recover(); r != nil { 1453 ec.Error(ctx, ec.Recover(ctx, r)) 1454 ret = graphql.Null 1455 } 1456 }() 1457 fc := &graphql.FieldContext{ 1458 Object: "Human", 1459 Field: field, 1460 Args: nil, 1461 IsMethod: false, 1462 } 1463 1464 ctx = graphql.WithFieldContext(ctx, fc) 1465 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1466 ctx = rctx // use context from middleware stack in children 1467 return obj.Mass, nil 1468 }) 1469 if err != nil { 1470 ec.Error(ctx, err) 1471 return graphql.Null 1472 } 1473 if resTmp == nil { 1474 return graphql.Null 1475 } 1476 res := resTmp.(float64) 1477 fc.Result = res 1478 return ec.marshalOFloat2float64(ctx, field.Selections, res) 1479 } 1480 1481 func (ec *executionContext) _Human_friends(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1482 defer func() { 1483 if r := recover(); r != nil { 1484 ec.Error(ctx, ec.Recover(ctx, r)) 1485 ret = graphql.Null 1486 } 1487 }() 1488 fc := &graphql.FieldContext{ 1489 Object: "Human", 1490 Field: field, 1491 Args: nil, 1492 IsMethod: true, 1493 } 1494 1495 ctx = graphql.WithFieldContext(ctx, fc) 1496 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1497 ctx = rctx // use context from middleware stack in children 1498 return ec.resolvers.Human().Friends(rctx, obj) 1499 }) 1500 if err != nil { 1501 ec.Error(ctx, err) 1502 return graphql.Null 1503 } 1504 if resTmp == nil { 1505 return graphql.Null 1506 } 1507 res := resTmp.([]models.Character) 1508 fc.Result = res 1509 return ec.marshalOCharacter2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacterᚄ(ctx, field.Selections, res) 1510 } 1511 1512 func (ec *executionContext) _Human_friendsConnection(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1513 defer func() { 1514 if r := recover(); r != nil { 1515 ec.Error(ctx, ec.Recover(ctx, r)) 1516 ret = graphql.Null 1517 } 1518 }() 1519 fc := &graphql.FieldContext{ 1520 Object: "Human", 1521 Field: field, 1522 Args: nil, 1523 IsMethod: true, 1524 } 1525 1526 ctx = graphql.WithFieldContext(ctx, fc) 1527 rawArgs := field.ArgumentMap(ec.Variables) 1528 args, err := ec.field_Human_friendsConnection_args(ctx, rawArgs) 1529 if err != nil { 1530 ec.Error(ctx, err) 1531 return graphql.Null 1532 } 1533 fc.Args = args 1534 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1535 ctx = rctx // use context from middleware stack in children 1536 return ec.resolvers.Human().FriendsConnection(rctx, obj, args["first"].(*int), args["after"].(*string)) 1537 }) 1538 if err != nil { 1539 ec.Error(ctx, err) 1540 return graphql.Null 1541 } 1542 if resTmp == nil { 1543 if !graphql.HasFieldError(ctx, fc) { 1544 ec.Errorf(ctx, "must not be null") 1545 } 1546 return graphql.Null 1547 } 1548 res := resTmp.(*models.FriendsConnection) 1549 fc.Result = res 1550 return ec.marshalNFriendsConnection2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsConnection(ctx, field.Selections, res) 1551 } 1552 1553 func (ec *executionContext) _Human_appearsIn(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1554 defer func() { 1555 if r := recover(); r != nil { 1556 ec.Error(ctx, ec.Recover(ctx, r)) 1557 ret = graphql.Null 1558 } 1559 }() 1560 fc := &graphql.FieldContext{ 1561 Object: "Human", 1562 Field: field, 1563 Args: nil, 1564 IsMethod: false, 1565 } 1566 1567 ctx = graphql.WithFieldContext(ctx, fc) 1568 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1569 ctx = rctx // use context from middleware stack in children 1570 return obj.AppearsIn, nil 1571 }) 1572 if err != nil { 1573 ec.Error(ctx, err) 1574 return graphql.Null 1575 } 1576 if resTmp == nil { 1577 if !graphql.HasFieldError(ctx, fc) { 1578 ec.Errorf(ctx, "must not be null") 1579 } 1580 return graphql.Null 1581 } 1582 res := resTmp.([]models.Episode) 1583 fc.Result = res 1584 return ec.marshalNEpisode2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisodeᚄ(ctx, field.Selections, res) 1585 } 1586 1587 func (ec *executionContext) _Human_starships(ctx context.Context, field graphql.CollectedField, obj *models.Human) (ret graphql.Marshaler) { 1588 defer func() { 1589 if r := recover(); r != nil { 1590 ec.Error(ctx, ec.Recover(ctx, r)) 1591 ret = graphql.Null 1592 } 1593 }() 1594 fc := &graphql.FieldContext{ 1595 Object: "Human", 1596 Field: field, 1597 Args: nil, 1598 IsMethod: true, 1599 } 1600 1601 ctx = graphql.WithFieldContext(ctx, fc) 1602 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1603 ctx = rctx // use context from middleware stack in children 1604 return ec.resolvers.Human().Starships(rctx, obj) 1605 }) 1606 if err != nil { 1607 ec.Error(ctx, err) 1608 return graphql.Null 1609 } 1610 if resTmp == nil { 1611 return graphql.Null 1612 } 1613 res := resTmp.([]*models.Starship) 1614 fc.Result = res 1615 return ec.marshalOStarship2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarshipᚄ(ctx, field.Selections, res) 1616 } 1617 1618 func (ec *executionContext) _Mutation_createReview(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1619 defer func() { 1620 if r := recover(); r != nil { 1621 ec.Error(ctx, ec.Recover(ctx, r)) 1622 ret = graphql.Null 1623 } 1624 }() 1625 fc := &graphql.FieldContext{ 1626 Object: "Mutation", 1627 Field: field, 1628 Args: nil, 1629 IsMethod: true, 1630 } 1631 1632 ctx = graphql.WithFieldContext(ctx, fc) 1633 rawArgs := field.ArgumentMap(ec.Variables) 1634 args, err := ec.field_Mutation_createReview_args(ctx, rawArgs) 1635 if err != nil { 1636 ec.Error(ctx, err) 1637 return graphql.Null 1638 } 1639 fc.Args = args 1640 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1641 ctx = rctx // use context from middleware stack in children 1642 return ec.resolvers.Mutation().CreateReview(rctx, args["episode"].(models.Episode), args["review"].(models.Review)) 1643 }) 1644 if err != nil { 1645 ec.Error(ctx, err) 1646 return graphql.Null 1647 } 1648 if resTmp == nil { 1649 return graphql.Null 1650 } 1651 res := resTmp.(*models.Review) 1652 fc.Result = res 1653 return ec.marshalOReview2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx, field.Selections, res) 1654 } 1655 1656 func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) (ret graphql.Marshaler) { 1657 defer func() { 1658 if r := recover(); r != nil { 1659 ec.Error(ctx, ec.Recover(ctx, r)) 1660 ret = graphql.Null 1661 } 1662 }() 1663 fc := &graphql.FieldContext{ 1664 Object: "PageInfo", 1665 Field: field, 1666 Args: nil, 1667 IsMethod: false, 1668 } 1669 1670 ctx = graphql.WithFieldContext(ctx, fc) 1671 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1672 ctx = rctx // use context from middleware stack in children 1673 return obj.StartCursor, nil 1674 }) 1675 if err != nil { 1676 ec.Error(ctx, err) 1677 return graphql.Null 1678 } 1679 if resTmp == nil { 1680 if !graphql.HasFieldError(ctx, fc) { 1681 ec.Errorf(ctx, "must not be null") 1682 } 1683 return graphql.Null 1684 } 1685 res := resTmp.(string) 1686 fc.Result = res 1687 return ec.marshalNID2string(ctx, field.Selections, res) 1688 } 1689 1690 func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) (ret graphql.Marshaler) { 1691 defer func() { 1692 if r := recover(); r != nil { 1693 ec.Error(ctx, ec.Recover(ctx, r)) 1694 ret = graphql.Null 1695 } 1696 }() 1697 fc := &graphql.FieldContext{ 1698 Object: "PageInfo", 1699 Field: field, 1700 Args: nil, 1701 IsMethod: false, 1702 } 1703 1704 ctx = graphql.WithFieldContext(ctx, fc) 1705 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1706 ctx = rctx // use context from middleware stack in children 1707 return obj.EndCursor, nil 1708 }) 1709 if err != nil { 1710 ec.Error(ctx, err) 1711 return graphql.Null 1712 } 1713 if resTmp == nil { 1714 if !graphql.HasFieldError(ctx, fc) { 1715 ec.Errorf(ctx, "must not be null") 1716 } 1717 return graphql.Null 1718 } 1719 res := resTmp.(string) 1720 fc.Result = res 1721 return ec.marshalNID2string(ctx, field.Selections, res) 1722 } 1723 1724 func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *models.PageInfo) (ret graphql.Marshaler) { 1725 defer func() { 1726 if r := recover(); r != nil { 1727 ec.Error(ctx, ec.Recover(ctx, r)) 1728 ret = graphql.Null 1729 } 1730 }() 1731 fc := &graphql.FieldContext{ 1732 Object: "PageInfo", 1733 Field: field, 1734 Args: nil, 1735 IsMethod: false, 1736 } 1737 1738 ctx = graphql.WithFieldContext(ctx, fc) 1739 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1740 ctx = rctx // use context from middleware stack in children 1741 return obj.HasNextPage, nil 1742 }) 1743 if err != nil { 1744 ec.Error(ctx, err) 1745 return graphql.Null 1746 } 1747 if resTmp == nil { 1748 if !graphql.HasFieldError(ctx, fc) { 1749 ec.Errorf(ctx, "must not be null") 1750 } 1751 return graphql.Null 1752 } 1753 res := resTmp.(bool) 1754 fc.Result = res 1755 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 1756 } 1757 1758 func (ec *executionContext) _Query_hero(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1759 defer func() { 1760 if r := recover(); r != nil { 1761 ec.Error(ctx, ec.Recover(ctx, r)) 1762 ret = graphql.Null 1763 } 1764 }() 1765 fc := &graphql.FieldContext{ 1766 Object: "Query", 1767 Field: field, 1768 Args: nil, 1769 IsMethod: true, 1770 } 1771 1772 ctx = graphql.WithFieldContext(ctx, fc) 1773 rawArgs := field.ArgumentMap(ec.Variables) 1774 args, err := ec.field_Query_hero_args(ctx, rawArgs) 1775 if err != nil { 1776 ec.Error(ctx, err) 1777 return graphql.Null 1778 } 1779 fc.Args = args 1780 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1781 ctx = rctx // use context from middleware stack in children 1782 return ec.resolvers.Query().Hero(rctx, args["episode"].(*models.Episode)) 1783 }) 1784 if err != nil { 1785 ec.Error(ctx, err) 1786 return graphql.Null 1787 } 1788 if resTmp == nil { 1789 return graphql.Null 1790 } 1791 res := resTmp.(models.Character) 1792 fc.Result = res 1793 return ec.marshalOCharacter2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacter(ctx, field.Selections, res) 1794 } 1795 1796 func (ec *executionContext) _Query_reviews(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1797 defer func() { 1798 if r := recover(); r != nil { 1799 ec.Error(ctx, ec.Recover(ctx, r)) 1800 ret = graphql.Null 1801 } 1802 }() 1803 fc := &graphql.FieldContext{ 1804 Object: "Query", 1805 Field: field, 1806 Args: nil, 1807 IsMethod: true, 1808 } 1809 1810 ctx = graphql.WithFieldContext(ctx, fc) 1811 rawArgs := field.ArgumentMap(ec.Variables) 1812 args, err := ec.field_Query_reviews_args(ctx, rawArgs) 1813 if err != nil { 1814 ec.Error(ctx, err) 1815 return graphql.Null 1816 } 1817 fc.Args = args 1818 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1819 ctx = rctx // use context from middleware stack in children 1820 return ec.resolvers.Query().Reviews(rctx, args["episode"].(models.Episode), args["since"].(*time.Time)) 1821 }) 1822 if err != nil { 1823 ec.Error(ctx, err) 1824 return graphql.Null 1825 } 1826 if resTmp == nil { 1827 if !graphql.HasFieldError(ctx, fc) { 1828 ec.Errorf(ctx, "must not be null") 1829 } 1830 return graphql.Null 1831 } 1832 res := resTmp.([]*models.Review) 1833 fc.Result = res 1834 return ec.marshalNReview2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReviewᚄ(ctx, field.Selections, res) 1835 } 1836 1837 func (ec *executionContext) _Query_search(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1838 defer func() { 1839 if r := recover(); r != nil { 1840 ec.Error(ctx, ec.Recover(ctx, r)) 1841 ret = graphql.Null 1842 } 1843 }() 1844 fc := &graphql.FieldContext{ 1845 Object: "Query", 1846 Field: field, 1847 Args: nil, 1848 IsMethod: true, 1849 } 1850 1851 ctx = graphql.WithFieldContext(ctx, fc) 1852 rawArgs := field.ArgumentMap(ec.Variables) 1853 args, err := ec.field_Query_search_args(ctx, rawArgs) 1854 if err != nil { 1855 ec.Error(ctx, err) 1856 return graphql.Null 1857 } 1858 fc.Args = args 1859 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1860 ctx = rctx // use context from middleware stack in children 1861 return ec.resolvers.Query().Search(rctx, args["text"].(string)) 1862 }) 1863 if err != nil { 1864 ec.Error(ctx, err) 1865 return graphql.Null 1866 } 1867 if resTmp == nil { 1868 if !graphql.HasFieldError(ctx, fc) { 1869 ec.Errorf(ctx, "must not be null") 1870 } 1871 return graphql.Null 1872 } 1873 res := resTmp.([]models.SearchResult) 1874 fc.Result = res 1875 return ec.marshalNSearchResult2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐSearchResultᚄ(ctx, field.Selections, res) 1876 } 1877 1878 func (ec *executionContext) _Query_character(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1879 defer func() { 1880 if r := recover(); r != nil { 1881 ec.Error(ctx, ec.Recover(ctx, r)) 1882 ret = graphql.Null 1883 } 1884 }() 1885 fc := &graphql.FieldContext{ 1886 Object: "Query", 1887 Field: field, 1888 Args: nil, 1889 IsMethod: true, 1890 } 1891 1892 ctx = graphql.WithFieldContext(ctx, fc) 1893 rawArgs := field.ArgumentMap(ec.Variables) 1894 args, err := ec.field_Query_character_args(ctx, rawArgs) 1895 if err != nil { 1896 ec.Error(ctx, err) 1897 return graphql.Null 1898 } 1899 fc.Args = args 1900 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1901 ctx = rctx // use context from middleware stack in children 1902 return ec.resolvers.Query().Character(rctx, args["id"].(string)) 1903 }) 1904 if err != nil { 1905 ec.Error(ctx, err) 1906 return graphql.Null 1907 } 1908 if resTmp == nil { 1909 return graphql.Null 1910 } 1911 res := resTmp.(models.Character) 1912 fc.Result = res 1913 return ec.marshalOCharacter2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacter(ctx, field.Selections, res) 1914 } 1915 1916 func (ec *executionContext) _Query_droid(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1917 defer func() { 1918 if r := recover(); r != nil { 1919 ec.Error(ctx, ec.Recover(ctx, r)) 1920 ret = graphql.Null 1921 } 1922 }() 1923 fc := &graphql.FieldContext{ 1924 Object: "Query", 1925 Field: field, 1926 Args: nil, 1927 IsMethod: true, 1928 } 1929 1930 ctx = graphql.WithFieldContext(ctx, fc) 1931 rawArgs := field.ArgumentMap(ec.Variables) 1932 args, err := ec.field_Query_droid_args(ctx, rawArgs) 1933 if err != nil { 1934 ec.Error(ctx, err) 1935 return graphql.Null 1936 } 1937 fc.Args = args 1938 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1939 ctx = rctx // use context from middleware stack in children 1940 return ec.resolvers.Query().Droid(rctx, args["id"].(string)) 1941 }) 1942 if err != nil { 1943 ec.Error(ctx, err) 1944 return graphql.Null 1945 } 1946 if resTmp == nil { 1947 return graphql.Null 1948 } 1949 res := resTmp.(*models.Droid) 1950 fc.Result = res 1951 return ec.marshalODroid2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐDroid(ctx, field.Selections, res) 1952 } 1953 1954 func (ec *executionContext) _Query_human(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1955 defer func() { 1956 if r := recover(); r != nil { 1957 ec.Error(ctx, ec.Recover(ctx, r)) 1958 ret = graphql.Null 1959 } 1960 }() 1961 fc := &graphql.FieldContext{ 1962 Object: "Query", 1963 Field: field, 1964 Args: nil, 1965 IsMethod: true, 1966 } 1967 1968 ctx = graphql.WithFieldContext(ctx, fc) 1969 rawArgs := field.ArgumentMap(ec.Variables) 1970 args, err := ec.field_Query_human_args(ctx, rawArgs) 1971 if err != nil { 1972 ec.Error(ctx, err) 1973 return graphql.Null 1974 } 1975 fc.Args = args 1976 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1977 ctx = rctx // use context from middleware stack in children 1978 return ec.resolvers.Query().Human(rctx, args["id"].(string)) 1979 }) 1980 if err != nil { 1981 ec.Error(ctx, err) 1982 return graphql.Null 1983 } 1984 if resTmp == nil { 1985 return graphql.Null 1986 } 1987 res := resTmp.(*models.Human) 1988 fc.Result = res 1989 return ec.marshalOHuman2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐHuman(ctx, field.Selections, res) 1990 } 1991 1992 func (ec *executionContext) _Query_starship(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1993 defer func() { 1994 if r := recover(); r != nil { 1995 ec.Error(ctx, ec.Recover(ctx, r)) 1996 ret = graphql.Null 1997 } 1998 }() 1999 fc := &graphql.FieldContext{ 2000 Object: "Query", 2001 Field: field, 2002 Args: nil, 2003 IsMethod: true, 2004 } 2005 2006 ctx = graphql.WithFieldContext(ctx, fc) 2007 rawArgs := field.ArgumentMap(ec.Variables) 2008 args, err := ec.field_Query_starship_args(ctx, rawArgs) 2009 if err != nil { 2010 ec.Error(ctx, err) 2011 return graphql.Null 2012 } 2013 fc.Args = args 2014 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2015 ctx = rctx // use context from middleware stack in children 2016 return ec.resolvers.Query().Starship(rctx, args["id"].(string)) 2017 }) 2018 if err != nil { 2019 ec.Error(ctx, err) 2020 return graphql.Null 2021 } 2022 if resTmp == nil { 2023 return graphql.Null 2024 } 2025 res := resTmp.(*models.Starship) 2026 fc.Result = res 2027 return ec.marshalOStarship2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarship(ctx, field.Selections, res) 2028 } 2029 2030 func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 2031 defer func() { 2032 if r := recover(); r != nil { 2033 ec.Error(ctx, ec.Recover(ctx, r)) 2034 ret = graphql.Null 2035 } 2036 }() 2037 fc := &graphql.FieldContext{ 2038 Object: "Query", 2039 Field: field, 2040 Args: nil, 2041 IsMethod: true, 2042 } 2043 2044 ctx = graphql.WithFieldContext(ctx, fc) 2045 rawArgs := field.ArgumentMap(ec.Variables) 2046 args, err := ec.field_Query___type_args(ctx, rawArgs) 2047 if err != nil { 2048 ec.Error(ctx, err) 2049 return graphql.Null 2050 } 2051 fc.Args = args 2052 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2053 ctx = rctx // use context from middleware stack in children 2054 return ec.introspectType(args["name"].(string)) 2055 }) 2056 if err != nil { 2057 ec.Error(ctx, err) 2058 return graphql.Null 2059 } 2060 if resTmp == nil { 2061 return graphql.Null 2062 } 2063 res := resTmp.(*introspection.Type) 2064 fc.Result = res 2065 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2066 } 2067 2068 func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 2069 defer func() { 2070 if r := recover(); r != nil { 2071 ec.Error(ctx, ec.Recover(ctx, r)) 2072 ret = graphql.Null 2073 } 2074 }() 2075 fc := &graphql.FieldContext{ 2076 Object: "Query", 2077 Field: field, 2078 Args: nil, 2079 IsMethod: true, 2080 } 2081 2082 ctx = graphql.WithFieldContext(ctx, fc) 2083 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2084 ctx = rctx // use context from middleware stack in children 2085 return ec.introspectSchema() 2086 }) 2087 if err != nil { 2088 ec.Error(ctx, err) 2089 return graphql.Null 2090 } 2091 if resTmp == nil { 2092 return graphql.Null 2093 } 2094 res := resTmp.(*introspection.Schema) 2095 fc.Result = res 2096 return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) 2097 } 2098 2099 func (ec *executionContext) _Review_stars(ctx context.Context, field graphql.CollectedField, obj *models.Review) (ret graphql.Marshaler) { 2100 defer func() { 2101 if r := recover(); r != nil { 2102 ec.Error(ctx, ec.Recover(ctx, r)) 2103 ret = graphql.Null 2104 } 2105 }() 2106 fc := &graphql.FieldContext{ 2107 Object: "Review", 2108 Field: field, 2109 Args: nil, 2110 IsMethod: false, 2111 } 2112 2113 ctx = graphql.WithFieldContext(ctx, fc) 2114 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2115 ctx = rctx // use context from middleware stack in children 2116 return obj.Stars, nil 2117 }) 2118 if err != nil { 2119 ec.Error(ctx, err) 2120 return graphql.Null 2121 } 2122 if resTmp == nil { 2123 if !graphql.HasFieldError(ctx, fc) { 2124 ec.Errorf(ctx, "must not be null") 2125 } 2126 return graphql.Null 2127 } 2128 res := resTmp.(int) 2129 fc.Result = res 2130 return ec.marshalNInt2int(ctx, field.Selections, res) 2131 } 2132 2133 func (ec *executionContext) _Review_commentary(ctx context.Context, field graphql.CollectedField, obj *models.Review) (ret graphql.Marshaler) { 2134 defer func() { 2135 if r := recover(); r != nil { 2136 ec.Error(ctx, ec.Recover(ctx, r)) 2137 ret = graphql.Null 2138 } 2139 }() 2140 fc := &graphql.FieldContext{ 2141 Object: "Review", 2142 Field: field, 2143 Args: nil, 2144 IsMethod: false, 2145 } 2146 2147 ctx = graphql.WithFieldContext(ctx, fc) 2148 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2149 ctx = rctx // use context from middleware stack in children 2150 return obj.Commentary, nil 2151 }) 2152 if err != nil { 2153 ec.Error(ctx, err) 2154 return graphql.Null 2155 } 2156 if resTmp == nil { 2157 return graphql.Null 2158 } 2159 res := resTmp.(*string) 2160 fc.Result = res 2161 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2162 } 2163 2164 func (ec *executionContext) _Review_time(ctx context.Context, field graphql.CollectedField, obj *models.Review) (ret graphql.Marshaler) { 2165 defer func() { 2166 if r := recover(); r != nil { 2167 ec.Error(ctx, ec.Recover(ctx, r)) 2168 ret = graphql.Null 2169 } 2170 }() 2171 fc := &graphql.FieldContext{ 2172 Object: "Review", 2173 Field: field, 2174 Args: nil, 2175 IsMethod: false, 2176 } 2177 2178 ctx = graphql.WithFieldContext(ctx, fc) 2179 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2180 ctx = rctx // use context from middleware stack in children 2181 return obj.Time, nil 2182 }) 2183 if err != nil { 2184 ec.Error(ctx, err) 2185 return graphql.Null 2186 } 2187 if resTmp == nil { 2188 return graphql.Null 2189 } 2190 res := resTmp.(time.Time) 2191 fc.Result = res 2192 return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) 2193 } 2194 2195 func (ec *executionContext) _Starship_id(ctx context.Context, field graphql.CollectedField, obj *models.Starship) (ret graphql.Marshaler) { 2196 defer func() { 2197 if r := recover(); r != nil { 2198 ec.Error(ctx, ec.Recover(ctx, r)) 2199 ret = graphql.Null 2200 } 2201 }() 2202 fc := &graphql.FieldContext{ 2203 Object: "Starship", 2204 Field: field, 2205 Args: nil, 2206 IsMethod: false, 2207 } 2208 2209 ctx = graphql.WithFieldContext(ctx, fc) 2210 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2211 ctx = rctx // use context from middleware stack in children 2212 return obj.ID, nil 2213 }) 2214 if err != nil { 2215 ec.Error(ctx, err) 2216 return graphql.Null 2217 } 2218 if resTmp == nil { 2219 if !graphql.HasFieldError(ctx, fc) { 2220 ec.Errorf(ctx, "must not be null") 2221 } 2222 return graphql.Null 2223 } 2224 res := resTmp.(string) 2225 fc.Result = res 2226 return ec.marshalNID2string(ctx, field.Selections, res) 2227 } 2228 2229 func (ec *executionContext) _Starship_name(ctx context.Context, field graphql.CollectedField, obj *models.Starship) (ret graphql.Marshaler) { 2230 defer func() { 2231 if r := recover(); r != nil { 2232 ec.Error(ctx, ec.Recover(ctx, r)) 2233 ret = graphql.Null 2234 } 2235 }() 2236 fc := &graphql.FieldContext{ 2237 Object: "Starship", 2238 Field: field, 2239 Args: nil, 2240 IsMethod: false, 2241 } 2242 2243 ctx = graphql.WithFieldContext(ctx, fc) 2244 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2245 ctx = rctx // use context from middleware stack in children 2246 return obj.Name, nil 2247 }) 2248 if err != nil { 2249 ec.Error(ctx, err) 2250 return graphql.Null 2251 } 2252 if resTmp == nil { 2253 if !graphql.HasFieldError(ctx, fc) { 2254 ec.Errorf(ctx, "must not be null") 2255 } 2256 return graphql.Null 2257 } 2258 res := resTmp.(string) 2259 fc.Result = res 2260 return ec.marshalNString2string(ctx, field.Selections, res) 2261 } 2262 2263 func (ec *executionContext) _Starship_length(ctx context.Context, field graphql.CollectedField, obj *models.Starship) (ret graphql.Marshaler) { 2264 defer func() { 2265 if r := recover(); r != nil { 2266 ec.Error(ctx, ec.Recover(ctx, r)) 2267 ret = graphql.Null 2268 } 2269 }() 2270 fc := &graphql.FieldContext{ 2271 Object: "Starship", 2272 Field: field, 2273 Args: nil, 2274 IsMethod: true, 2275 } 2276 2277 ctx = graphql.WithFieldContext(ctx, fc) 2278 rawArgs := field.ArgumentMap(ec.Variables) 2279 args, err := ec.field_Starship_length_args(ctx, rawArgs) 2280 if err != nil { 2281 ec.Error(ctx, err) 2282 return graphql.Null 2283 } 2284 fc.Args = args 2285 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2286 ctx = rctx // use context from middleware stack in children 2287 return ec.resolvers.Starship().Length(rctx, obj, args["unit"].(*models.LengthUnit)) 2288 }) 2289 if err != nil { 2290 ec.Error(ctx, err) 2291 return graphql.Null 2292 } 2293 if resTmp == nil { 2294 if !graphql.HasFieldError(ctx, fc) { 2295 ec.Errorf(ctx, "must not be null") 2296 } 2297 return graphql.Null 2298 } 2299 res := resTmp.(float64) 2300 fc.Result = res 2301 return ec.marshalNFloat2float64(ctx, field.Selections, res) 2302 } 2303 2304 func (ec *executionContext) _Starship_history(ctx context.Context, field graphql.CollectedField, obj *models.Starship) (ret graphql.Marshaler) { 2305 defer func() { 2306 if r := recover(); r != nil { 2307 ec.Error(ctx, ec.Recover(ctx, r)) 2308 ret = graphql.Null 2309 } 2310 }() 2311 fc := &graphql.FieldContext{ 2312 Object: "Starship", 2313 Field: field, 2314 Args: nil, 2315 IsMethod: false, 2316 } 2317 2318 ctx = graphql.WithFieldContext(ctx, fc) 2319 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2320 ctx = rctx // use context from middleware stack in children 2321 return obj.History, nil 2322 }) 2323 if err != nil { 2324 ec.Error(ctx, err) 2325 return graphql.Null 2326 } 2327 if resTmp == nil { 2328 if !graphql.HasFieldError(ctx, fc) { 2329 ec.Errorf(ctx, "must not be null") 2330 } 2331 return graphql.Null 2332 } 2333 res := resTmp.([][]int) 2334 fc.Result = res 2335 return ec.marshalNInt2ᚕᚕintᚄ(ctx, field.Selections, res) 2336 } 2337 2338 func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 2339 defer func() { 2340 if r := recover(); r != nil { 2341 ec.Error(ctx, ec.Recover(ctx, r)) 2342 ret = graphql.Null 2343 } 2344 }() 2345 fc := &graphql.FieldContext{ 2346 Object: "__Directive", 2347 Field: field, 2348 Args: nil, 2349 IsMethod: false, 2350 } 2351 2352 ctx = graphql.WithFieldContext(ctx, fc) 2353 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2354 ctx = rctx // use context from middleware stack in children 2355 return obj.Name, nil 2356 }) 2357 if err != nil { 2358 ec.Error(ctx, err) 2359 return graphql.Null 2360 } 2361 if resTmp == nil { 2362 if !graphql.HasFieldError(ctx, fc) { 2363 ec.Errorf(ctx, "must not be null") 2364 } 2365 return graphql.Null 2366 } 2367 res := resTmp.(string) 2368 fc.Result = res 2369 return ec.marshalNString2string(ctx, field.Selections, res) 2370 } 2371 2372 func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 2373 defer func() { 2374 if r := recover(); r != nil { 2375 ec.Error(ctx, ec.Recover(ctx, r)) 2376 ret = graphql.Null 2377 } 2378 }() 2379 fc := &graphql.FieldContext{ 2380 Object: "__Directive", 2381 Field: field, 2382 Args: nil, 2383 IsMethod: false, 2384 } 2385 2386 ctx = graphql.WithFieldContext(ctx, fc) 2387 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2388 ctx = rctx // use context from middleware stack in children 2389 return obj.Description, nil 2390 }) 2391 if err != nil { 2392 ec.Error(ctx, err) 2393 return graphql.Null 2394 } 2395 if resTmp == nil { 2396 return graphql.Null 2397 } 2398 res := resTmp.(string) 2399 fc.Result = res 2400 return ec.marshalOString2string(ctx, field.Selections, res) 2401 } 2402 2403 func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 2404 defer func() { 2405 if r := recover(); r != nil { 2406 ec.Error(ctx, ec.Recover(ctx, r)) 2407 ret = graphql.Null 2408 } 2409 }() 2410 fc := &graphql.FieldContext{ 2411 Object: "__Directive", 2412 Field: field, 2413 Args: nil, 2414 IsMethod: false, 2415 } 2416 2417 ctx = graphql.WithFieldContext(ctx, fc) 2418 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2419 ctx = rctx // use context from middleware stack in children 2420 return obj.Locations, nil 2421 }) 2422 if err != nil { 2423 ec.Error(ctx, err) 2424 return graphql.Null 2425 } 2426 if resTmp == nil { 2427 if !graphql.HasFieldError(ctx, fc) { 2428 ec.Errorf(ctx, "must not be null") 2429 } 2430 return graphql.Null 2431 } 2432 res := resTmp.([]string) 2433 fc.Result = res 2434 return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) 2435 } 2436 2437 func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 2438 defer func() { 2439 if r := recover(); r != nil { 2440 ec.Error(ctx, ec.Recover(ctx, r)) 2441 ret = graphql.Null 2442 } 2443 }() 2444 fc := &graphql.FieldContext{ 2445 Object: "__Directive", 2446 Field: field, 2447 Args: nil, 2448 IsMethod: false, 2449 } 2450 2451 ctx = graphql.WithFieldContext(ctx, fc) 2452 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2453 ctx = rctx // use context from middleware stack in children 2454 return obj.Args, nil 2455 }) 2456 if err != nil { 2457 ec.Error(ctx, err) 2458 return graphql.Null 2459 } 2460 if resTmp == nil { 2461 if !graphql.HasFieldError(ctx, fc) { 2462 ec.Errorf(ctx, "must not be null") 2463 } 2464 return graphql.Null 2465 } 2466 res := resTmp.([]introspection.InputValue) 2467 fc.Result = res 2468 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 2469 } 2470 2471 func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 2472 defer func() { 2473 if r := recover(); r != nil { 2474 ec.Error(ctx, ec.Recover(ctx, r)) 2475 ret = graphql.Null 2476 } 2477 }() 2478 fc := &graphql.FieldContext{ 2479 Object: "__EnumValue", 2480 Field: field, 2481 Args: nil, 2482 IsMethod: false, 2483 } 2484 2485 ctx = graphql.WithFieldContext(ctx, fc) 2486 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2487 ctx = rctx // use context from middleware stack in children 2488 return obj.Name, nil 2489 }) 2490 if err != nil { 2491 ec.Error(ctx, err) 2492 return graphql.Null 2493 } 2494 if resTmp == nil { 2495 if !graphql.HasFieldError(ctx, fc) { 2496 ec.Errorf(ctx, "must not be null") 2497 } 2498 return graphql.Null 2499 } 2500 res := resTmp.(string) 2501 fc.Result = res 2502 return ec.marshalNString2string(ctx, field.Selections, res) 2503 } 2504 2505 func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 2506 defer func() { 2507 if r := recover(); r != nil { 2508 ec.Error(ctx, ec.Recover(ctx, r)) 2509 ret = graphql.Null 2510 } 2511 }() 2512 fc := &graphql.FieldContext{ 2513 Object: "__EnumValue", 2514 Field: field, 2515 Args: nil, 2516 IsMethod: false, 2517 } 2518 2519 ctx = graphql.WithFieldContext(ctx, fc) 2520 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2521 ctx = rctx // use context from middleware stack in children 2522 return obj.Description, nil 2523 }) 2524 if err != nil { 2525 ec.Error(ctx, err) 2526 return graphql.Null 2527 } 2528 if resTmp == nil { 2529 return graphql.Null 2530 } 2531 res := resTmp.(string) 2532 fc.Result = res 2533 return ec.marshalOString2string(ctx, field.Selections, res) 2534 } 2535 2536 func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 2537 defer func() { 2538 if r := recover(); r != nil { 2539 ec.Error(ctx, ec.Recover(ctx, r)) 2540 ret = graphql.Null 2541 } 2542 }() 2543 fc := &graphql.FieldContext{ 2544 Object: "__EnumValue", 2545 Field: field, 2546 Args: nil, 2547 IsMethod: true, 2548 } 2549 2550 ctx = graphql.WithFieldContext(ctx, fc) 2551 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2552 ctx = rctx // use context from middleware stack in children 2553 return obj.IsDeprecated(), nil 2554 }) 2555 if err != nil { 2556 ec.Error(ctx, err) 2557 return graphql.Null 2558 } 2559 if resTmp == nil { 2560 if !graphql.HasFieldError(ctx, fc) { 2561 ec.Errorf(ctx, "must not be null") 2562 } 2563 return graphql.Null 2564 } 2565 res := resTmp.(bool) 2566 fc.Result = res 2567 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 2568 } 2569 2570 func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 2571 defer func() { 2572 if r := recover(); r != nil { 2573 ec.Error(ctx, ec.Recover(ctx, r)) 2574 ret = graphql.Null 2575 } 2576 }() 2577 fc := &graphql.FieldContext{ 2578 Object: "__EnumValue", 2579 Field: field, 2580 Args: nil, 2581 IsMethod: true, 2582 } 2583 2584 ctx = graphql.WithFieldContext(ctx, fc) 2585 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2586 ctx = rctx // use context from middleware stack in children 2587 return obj.DeprecationReason(), nil 2588 }) 2589 if err != nil { 2590 ec.Error(ctx, err) 2591 return graphql.Null 2592 } 2593 if resTmp == nil { 2594 return graphql.Null 2595 } 2596 res := resTmp.(*string) 2597 fc.Result = res 2598 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2599 } 2600 2601 func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 2602 defer func() { 2603 if r := recover(); r != nil { 2604 ec.Error(ctx, ec.Recover(ctx, r)) 2605 ret = graphql.Null 2606 } 2607 }() 2608 fc := &graphql.FieldContext{ 2609 Object: "__Field", 2610 Field: field, 2611 Args: nil, 2612 IsMethod: false, 2613 } 2614 2615 ctx = graphql.WithFieldContext(ctx, fc) 2616 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2617 ctx = rctx // use context from middleware stack in children 2618 return obj.Name, nil 2619 }) 2620 if err != nil { 2621 ec.Error(ctx, err) 2622 return graphql.Null 2623 } 2624 if resTmp == nil { 2625 if !graphql.HasFieldError(ctx, fc) { 2626 ec.Errorf(ctx, "must not be null") 2627 } 2628 return graphql.Null 2629 } 2630 res := resTmp.(string) 2631 fc.Result = res 2632 return ec.marshalNString2string(ctx, field.Selections, res) 2633 } 2634 2635 func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 2636 defer func() { 2637 if r := recover(); r != nil { 2638 ec.Error(ctx, ec.Recover(ctx, r)) 2639 ret = graphql.Null 2640 } 2641 }() 2642 fc := &graphql.FieldContext{ 2643 Object: "__Field", 2644 Field: field, 2645 Args: nil, 2646 IsMethod: false, 2647 } 2648 2649 ctx = graphql.WithFieldContext(ctx, fc) 2650 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2651 ctx = rctx // use context from middleware stack in children 2652 return obj.Description, nil 2653 }) 2654 if err != nil { 2655 ec.Error(ctx, err) 2656 return graphql.Null 2657 } 2658 if resTmp == nil { 2659 return graphql.Null 2660 } 2661 res := resTmp.(string) 2662 fc.Result = res 2663 return ec.marshalOString2string(ctx, field.Selections, res) 2664 } 2665 2666 func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 2667 defer func() { 2668 if r := recover(); r != nil { 2669 ec.Error(ctx, ec.Recover(ctx, r)) 2670 ret = graphql.Null 2671 } 2672 }() 2673 fc := &graphql.FieldContext{ 2674 Object: "__Field", 2675 Field: field, 2676 Args: nil, 2677 IsMethod: false, 2678 } 2679 2680 ctx = graphql.WithFieldContext(ctx, fc) 2681 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2682 ctx = rctx // use context from middleware stack in children 2683 return obj.Args, nil 2684 }) 2685 if err != nil { 2686 ec.Error(ctx, err) 2687 return graphql.Null 2688 } 2689 if resTmp == nil { 2690 if !graphql.HasFieldError(ctx, fc) { 2691 ec.Errorf(ctx, "must not be null") 2692 } 2693 return graphql.Null 2694 } 2695 res := resTmp.([]introspection.InputValue) 2696 fc.Result = res 2697 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 2698 } 2699 2700 func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 2701 defer func() { 2702 if r := recover(); r != nil { 2703 ec.Error(ctx, ec.Recover(ctx, r)) 2704 ret = graphql.Null 2705 } 2706 }() 2707 fc := &graphql.FieldContext{ 2708 Object: "__Field", 2709 Field: field, 2710 Args: nil, 2711 IsMethod: false, 2712 } 2713 2714 ctx = graphql.WithFieldContext(ctx, fc) 2715 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2716 ctx = rctx // use context from middleware stack in children 2717 return obj.Type, nil 2718 }) 2719 if err != nil { 2720 ec.Error(ctx, err) 2721 return graphql.Null 2722 } 2723 if resTmp == nil { 2724 if !graphql.HasFieldError(ctx, fc) { 2725 ec.Errorf(ctx, "must not be null") 2726 } 2727 return graphql.Null 2728 } 2729 res := resTmp.(*introspection.Type) 2730 fc.Result = res 2731 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2732 } 2733 2734 func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 2735 defer func() { 2736 if r := recover(); r != nil { 2737 ec.Error(ctx, ec.Recover(ctx, r)) 2738 ret = graphql.Null 2739 } 2740 }() 2741 fc := &graphql.FieldContext{ 2742 Object: "__Field", 2743 Field: field, 2744 Args: nil, 2745 IsMethod: true, 2746 } 2747 2748 ctx = graphql.WithFieldContext(ctx, fc) 2749 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2750 ctx = rctx // use context from middleware stack in children 2751 return obj.IsDeprecated(), nil 2752 }) 2753 if err != nil { 2754 ec.Error(ctx, err) 2755 return graphql.Null 2756 } 2757 if resTmp == nil { 2758 if !graphql.HasFieldError(ctx, fc) { 2759 ec.Errorf(ctx, "must not be null") 2760 } 2761 return graphql.Null 2762 } 2763 res := resTmp.(bool) 2764 fc.Result = res 2765 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 2766 } 2767 2768 func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 2769 defer func() { 2770 if r := recover(); r != nil { 2771 ec.Error(ctx, ec.Recover(ctx, r)) 2772 ret = graphql.Null 2773 } 2774 }() 2775 fc := &graphql.FieldContext{ 2776 Object: "__Field", 2777 Field: field, 2778 Args: nil, 2779 IsMethod: true, 2780 } 2781 2782 ctx = graphql.WithFieldContext(ctx, fc) 2783 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2784 ctx = rctx // use context from middleware stack in children 2785 return obj.DeprecationReason(), nil 2786 }) 2787 if err != nil { 2788 ec.Error(ctx, err) 2789 return graphql.Null 2790 } 2791 if resTmp == nil { 2792 return graphql.Null 2793 } 2794 res := resTmp.(*string) 2795 fc.Result = res 2796 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2797 } 2798 2799 func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 2800 defer func() { 2801 if r := recover(); r != nil { 2802 ec.Error(ctx, ec.Recover(ctx, r)) 2803 ret = graphql.Null 2804 } 2805 }() 2806 fc := &graphql.FieldContext{ 2807 Object: "__InputValue", 2808 Field: field, 2809 Args: nil, 2810 IsMethod: false, 2811 } 2812 2813 ctx = graphql.WithFieldContext(ctx, fc) 2814 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2815 ctx = rctx // use context from middleware stack in children 2816 return obj.Name, nil 2817 }) 2818 if err != nil { 2819 ec.Error(ctx, err) 2820 return graphql.Null 2821 } 2822 if resTmp == nil { 2823 if !graphql.HasFieldError(ctx, fc) { 2824 ec.Errorf(ctx, "must not be null") 2825 } 2826 return graphql.Null 2827 } 2828 res := resTmp.(string) 2829 fc.Result = res 2830 return ec.marshalNString2string(ctx, field.Selections, res) 2831 } 2832 2833 func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 2834 defer func() { 2835 if r := recover(); r != nil { 2836 ec.Error(ctx, ec.Recover(ctx, r)) 2837 ret = graphql.Null 2838 } 2839 }() 2840 fc := &graphql.FieldContext{ 2841 Object: "__InputValue", 2842 Field: field, 2843 Args: nil, 2844 IsMethod: false, 2845 } 2846 2847 ctx = graphql.WithFieldContext(ctx, fc) 2848 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2849 ctx = rctx // use context from middleware stack in children 2850 return obj.Description, nil 2851 }) 2852 if err != nil { 2853 ec.Error(ctx, err) 2854 return graphql.Null 2855 } 2856 if resTmp == nil { 2857 return graphql.Null 2858 } 2859 res := resTmp.(string) 2860 fc.Result = res 2861 return ec.marshalOString2string(ctx, field.Selections, res) 2862 } 2863 2864 func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 2865 defer func() { 2866 if r := recover(); r != nil { 2867 ec.Error(ctx, ec.Recover(ctx, r)) 2868 ret = graphql.Null 2869 } 2870 }() 2871 fc := &graphql.FieldContext{ 2872 Object: "__InputValue", 2873 Field: field, 2874 Args: nil, 2875 IsMethod: false, 2876 } 2877 2878 ctx = graphql.WithFieldContext(ctx, fc) 2879 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2880 ctx = rctx // use context from middleware stack in children 2881 return obj.Type, nil 2882 }) 2883 if err != nil { 2884 ec.Error(ctx, err) 2885 return graphql.Null 2886 } 2887 if resTmp == nil { 2888 if !graphql.HasFieldError(ctx, fc) { 2889 ec.Errorf(ctx, "must not be null") 2890 } 2891 return graphql.Null 2892 } 2893 res := resTmp.(*introspection.Type) 2894 fc.Result = res 2895 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2896 } 2897 2898 func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 2899 defer func() { 2900 if r := recover(); r != nil { 2901 ec.Error(ctx, ec.Recover(ctx, r)) 2902 ret = graphql.Null 2903 } 2904 }() 2905 fc := &graphql.FieldContext{ 2906 Object: "__InputValue", 2907 Field: field, 2908 Args: nil, 2909 IsMethod: false, 2910 } 2911 2912 ctx = graphql.WithFieldContext(ctx, fc) 2913 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2914 ctx = rctx // use context from middleware stack in children 2915 return obj.DefaultValue, nil 2916 }) 2917 if err != nil { 2918 ec.Error(ctx, err) 2919 return graphql.Null 2920 } 2921 if resTmp == nil { 2922 return graphql.Null 2923 } 2924 res := resTmp.(*string) 2925 fc.Result = res 2926 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2927 } 2928 2929 func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2930 defer func() { 2931 if r := recover(); r != nil { 2932 ec.Error(ctx, ec.Recover(ctx, r)) 2933 ret = graphql.Null 2934 } 2935 }() 2936 fc := &graphql.FieldContext{ 2937 Object: "__Schema", 2938 Field: field, 2939 Args: nil, 2940 IsMethod: true, 2941 } 2942 2943 ctx = graphql.WithFieldContext(ctx, fc) 2944 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2945 ctx = rctx // use context from middleware stack in children 2946 return obj.Types(), nil 2947 }) 2948 if err != nil { 2949 ec.Error(ctx, err) 2950 return graphql.Null 2951 } 2952 if resTmp == nil { 2953 if !graphql.HasFieldError(ctx, fc) { 2954 ec.Errorf(ctx, "must not be null") 2955 } 2956 return graphql.Null 2957 } 2958 res := resTmp.([]introspection.Type) 2959 fc.Result = res 2960 return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 2961 } 2962 2963 func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2964 defer func() { 2965 if r := recover(); r != nil { 2966 ec.Error(ctx, ec.Recover(ctx, r)) 2967 ret = graphql.Null 2968 } 2969 }() 2970 fc := &graphql.FieldContext{ 2971 Object: "__Schema", 2972 Field: field, 2973 Args: nil, 2974 IsMethod: true, 2975 } 2976 2977 ctx = graphql.WithFieldContext(ctx, fc) 2978 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2979 ctx = rctx // use context from middleware stack in children 2980 return obj.QueryType(), nil 2981 }) 2982 if err != nil { 2983 ec.Error(ctx, err) 2984 return graphql.Null 2985 } 2986 if resTmp == nil { 2987 if !graphql.HasFieldError(ctx, fc) { 2988 ec.Errorf(ctx, "must not be null") 2989 } 2990 return graphql.Null 2991 } 2992 res := resTmp.(*introspection.Type) 2993 fc.Result = res 2994 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2995 } 2996 2997 func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2998 defer func() { 2999 if r := recover(); r != nil { 3000 ec.Error(ctx, ec.Recover(ctx, r)) 3001 ret = graphql.Null 3002 } 3003 }() 3004 fc := &graphql.FieldContext{ 3005 Object: "__Schema", 3006 Field: field, 3007 Args: nil, 3008 IsMethod: true, 3009 } 3010 3011 ctx = graphql.WithFieldContext(ctx, fc) 3012 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3013 ctx = rctx // use context from middleware stack in children 3014 return obj.MutationType(), nil 3015 }) 3016 if err != nil { 3017 ec.Error(ctx, err) 3018 return graphql.Null 3019 } 3020 if resTmp == nil { 3021 return graphql.Null 3022 } 3023 res := resTmp.(*introspection.Type) 3024 fc.Result = res 3025 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 3026 } 3027 3028 func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 3029 defer func() { 3030 if r := recover(); r != nil { 3031 ec.Error(ctx, ec.Recover(ctx, r)) 3032 ret = graphql.Null 3033 } 3034 }() 3035 fc := &graphql.FieldContext{ 3036 Object: "__Schema", 3037 Field: field, 3038 Args: nil, 3039 IsMethod: true, 3040 } 3041 3042 ctx = graphql.WithFieldContext(ctx, fc) 3043 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3044 ctx = rctx // use context from middleware stack in children 3045 return obj.SubscriptionType(), nil 3046 }) 3047 if err != nil { 3048 ec.Error(ctx, err) 3049 return graphql.Null 3050 } 3051 if resTmp == nil { 3052 return graphql.Null 3053 } 3054 res := resTmp.(*introspection.Type) 3055 fc.Result = res 3056 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 3057 } 3058 3059 func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 3060 defer func() { 3061 if r := recover(); r != nil { 3062 ec.Error(ctx, ec.Recover(ctx, r)) 3063 ret = graphql.Null 3064 } 3065 }() 3066 fc := &graphql.FieldContext{ 3067 Object: "__Schema", 3068 Field: field, 3069 Args: nil, 3070 IsMethod: true, 3071 } 3072 3073 ctx = graphql.WithFieldContext(ctx, fc) 3074 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3075 ctx = rctx // use context from middleware stack in children 3076 return obj.Directives(), nil 3077 }) 3078 if err != nil { 3079 ec.Error(ctx, err) 3080 return graphql.Null 3081 } 3082 if resTmp == nil { 3083 if !graphql.HasFieldError(ctx, fc) { 3084 ec.Errorf(ctx, "must not be null") 3085 } 3086 return graphql.Null 3087 } 3088 res := resTmp.([]introspection.Directive) 3089 fc.Result = res 3090 return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) 3091 } 3092 3093 func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3094 defer func() { 3095 if r := recover(); r != nil { 3096 ec.Error(ctx, ec.Recover(ctx, r)) 3097 ret = graphql.Null 3098 } 3099 }() 3100 fc := &graphql.FieldContext{ 3101 Object: "__Type", 3102 Field: field, 3103 Args: nil, 3104 IsMethod: true, 3105 } 3106 3107 ctx = graphql.WithFieldContext(ctx, fc) 3108 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3109 ctx = rctx // use context from middleware stack in children 3110 return obj.Kind(), nil 3111 }) 3112 if err != nil { 3113 ec.Error(ctx, err) 3114 return graphql.Null 3115 } 3116 if resTmp == nil { 3117 if !graphql.HasFieldError(ctx, fc) { 3118 ec.Errorf(ctx, "must not be null") 3119 } 3120 return graphql.Null 3121 } 3122 res := resTmp.(string) 3123 fc.Result = res 3124 return ec.marshalN__TypeKind2string(ctx, field.Selections, res) 3125 } 3126 3127 func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3128 defer func() { 3129 if r := recover(); r != nil { 3130 ec.Error(ctx, ec.Recover(ctx, r)) 3131 ret = graphql.Null 3132 } 3133 }() 3134 fc := &graphql.FieldContext{ 3135 Object: "__Type", 3136 Field: field, 3137 Args: nil, 3138 IsMethod: true, 3139 } 3140 3141 ctx = graphql.WithFieldContext(ctx, fc) 3142 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3143 ctx = rctx // use context from middleware stack in children 3144 return obj.Name(), nil 3145 }) 3146 if err != nil { 3147 ec.Error(ctx, err) 3148 return graphql.Null 3149 } 3150 if resTmp == nil { 3151 return graphql.Null 3152 } 3153 res := resTmp.(*string) 3154 fc.Result = res 3155 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 3156 } 3157 3158 func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3159 defer func() { 3160 if r := recover(); r != nil { 3161 ec.Error(ctx, ec.Recover(ctx, r)) 3162 ret = graphql.Null 3163 } 3164 }() 3165 fc := &graphql.FieldContext{ 3166 Object: "__Type", 3167 Field: field, 3168 Args: nil, 3169 IsMethod: true, 3170 } 3171 3172 ctx = graphql.WithFieldContext(ctx, fc) 3173 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3174 ctx = rctx // use context from middleware stack in children 3175 return obj.Description(), nil 3176 }) 3177 if err != nil { 3178 ec.Error(ctx, err) 3179 return graphql.Null 3180 } 3181 if resTmp == nil { 3182 return graphql.Null 3183 } 3184 res := resTmp.(string) 3185 fc.Result = res 3186 return ec.marshalOString2string(ctx, field.Selections, res) 3187 } 3188 3189 func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3190 defer func() { 3191 if r := recover(); r != nil { 3192 ec.Error(ctx, ec.Recover(ctx, r)) 3193 ret = graphql.Null 3194 } 3195 }() 3196 fc := &graphql.FieldContext{ 3197 Object: "__Type", 3198 Field: field, 3199 Args: nil, 3200 IsMethod: true, 3201 } 3202 3203 ctx = graphql.WithFieldContext(ctx, fc) 3204 rawArgs := field.ArgumentMap(ec.Variables) 3205 args, err := ec.field___Type_fields_args(ctx, rawArgs) 3206 if err != nil { 3207 ec.Error(ctx, err) 3208 return graphql.Null 3209 } 3210 fc.Args = args 3211 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3212 ctx = rctx // use context from middleware stack in children 3213 return obj.Fields(args["includeDeprecated"].(bool)), nil 3214 }) 3215 if err != nil { 3216 ec.Error(ctx, err) 3217 return graphql.Null 3218 } 3219 if resTmp == nil { 3220 return graphql.Null 3221 } 3222 res := resTmp.([]introspection.Field) 3223 fc.Result = res 3224 return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) 3225 } 3226 3227 func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3228 defer func() { 3229 if r := recover(); r != nil { 3230 ec.Error(ctx, ec.Recover(ctx, r)) 3231 ret = graphql.Null 3232 } 3233 }() 3234 fc := &graphql.FieldContext{ 3235 Object: "__Type", 3236 Field: field, 3237 Args: nil, 3238 IsMethod: true, 3239 } 3240 3241 ctx = graphql.WithFieldContext(ctx, fc) 3242 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3243 ctx = rctx // use context from middleware stack in children 3244 return obj.Interfaces(), nil 3245 }) 3246 if err != nil { 3247 ec.Error(ctx, err) 3248 return graphql.Null 3249 } 3250 if resTmp == nil { 3251 return graphql.Null 3252 } 3253 res := resTmp.([]introspection.Type) 3254 fc.Result = res 3255 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 3256 } 3257 3258 func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3259 defer func() { 3260 if r := recover(); r != nil { 3261 ec.Error(ctx, ec.Recover(ctx, r)) 3262 ret = graphql.Null 3263 } 3264 }() 3265 fc := &graphql.FieldContext{ 3266 Object: "__Type", 3267 Field: field, 3268 Args: nil, 3269 IsMethod: true, 3270 } 3271 3272 ctx = graphql.WithFieldContext(ctx, fc) 3273 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3274 ctx = rctx // use context from middleware stack in children 3275 return obj.PossibleTypes(), nil 3276 }) 3277 if err != nil { 3278 ec.Error(ctx, err) 3279 return graphql.Null 3280 } 3281 if resTmp == nil { 3282 return graphql.Null 3283 } 3284 res := resTmp.([]introspection.Type) 3285 fc.Result = res 3286 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 3287 } 3288 3289 func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3290 defer func() { 3291 if r := recover(); r != nil { 3292 ec.Error(ctx, ec.Recover(ctx, r)) 3293 ret = graphql.Null 3294 } 3295 }() 3296 fc := &graphql.FieldContext{ 3297 Object: "__Type", 3298 Field: field, 3299 Args: nil, 3300 IsMethod: true, 3301 } 3302 3303 ctx = graphql.WithFieldContext(ctx, fc) 3304 rawArgs := field.ArgumentMap(ec.Variables) 3305 args, err := ec.field___Type_enumValues_args(ctx, rawArgs) 3306 if err != nil { 3307 ec.Error(ctx, err) 3308 return graphql.Null 3309 } 3310 fc.Args = args 3311 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3312 ctx = rctx // use context from middleware stack in children 3313 return obj.EnumValues(args["includeDeprecated"].(bool)), nil 3314 }) 3315 if err != nil { 3316 ec.Error(ctx, err) 3317 return graphql.Null 3318 } 3319 if resTmp == nil { 3320 return graphql.Null 3321 } 3322 res := resTmp.([]introspection.EnumValue) 3323 fc.Result = res 3324 return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) 3325 } 3326 3327 func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3328 defer func() { 3329 if r := recover(); r != nil { 3330 ec.Error(ctx, ec.Recover(ctx, r)) 3331 ret = graphql.Null 3332 } 3333 }() 3334 fc := &graphql.FieldContext{ 3335 Object: "__Type", 3336 Field: field, 3337 Args: nil, 3338 IsMethod: true, 3339 } 3340 3341 ctx = graphql.WithFieldContext(ctx, fc) 3342 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3343 ctx = rctx // use context from middleware stack in children 3344 return obj.InputFields(), nil 3345 }) 3346 if err != nil { 3347 ec.Error(ctx, err) 3348 return graphql.Null 3349 } 3350 if resTmp == nil { 3351 return graphql.Null 3352 } 3353 res := resTmp.([]introspection.InputValue) 3354 fc.Result = res 3355 return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 3356 } 3357 3358 func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 3359 defer func() { 3360 if r := recover(); r != nil { 3361 ec.Error(ctx, ec.Recover(ctx, r)) 3362 ret = graphql.Null 3363 } 3364 }() 3365 fc := &graphql.FieldContext{ 3366 Object: "__Type", 3367 Field: field, 3368 Args: nil, 3369 IsMethod: true, 3370 } 3371 3372 ctx = graphql.WithFieldContext(ctx, fc) 3373 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 3374 ctx = rctx // use context from middleware stack in children 3375 return obj.OfType(), nil 3376 }) 3377 if err != nil { 3378 ec.Error(ctx, err) 3379 return graphql.Null 3380 } 3381 if resTmp == nil { 3382 return graphql.Null 3383 } 3384 res := resTmp.(*introspection.Type) 3385 fc.Result = res 3386 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 3387 } 3388 3389 // endregion **************************** field.gotpl ***************************** 3390 3391 // region **************************** input.gotpl ***************************** 3392 3393 func (ec *executionContext) unmarshalInputReviewInput(ctx context.Context, obj interface{}) (models.Review, error) { 3394 var it models.Review 3395 var asMap = obj.(map[string]interface{}) 3396 3397 for k, v := range asMap { 3398 switch k { 3399 case "stars": 3400 var err error 3401 it.Stars, err = ec.unmarshalNInt2int(ctx, v) 3402 if err != nil { 3403 return it, err 3404 } 3405 case "commentary": 3406 var err error 3407 it.Commentary, err = ec.unmarshalOString2ᚖstring(ctx, v) 3408 if err != nil { 3409 return it, err 3410 } 3411 case "time": 3412 var err error 3413 it.Time, err = ec.unmarshalOTime2timeᚐTime(ctx, v) 3414 if err != nil { 3415 return it, err 3416 } 3417 } 3418 } 3419 3420 return it, nil 3421 } 3422 3423 // endregion **************************** input.gotpl ***************************** 3424 3425 // region ************************** interface.gotpl *************************** 3426 3427 func (ec *executionContext) _Character(ctx context.Context, sel ast.SelectionSet, obj models.Character) graphql.Marshaler { 3428 switch obj := (obj).(type) { 3429 case nil: 3430 return graphql.Null 3431 case models.Human: 3432 return ec._Human(ctx, sel, &obj) 3433 case *models.Human: 3434 if obj == nil { 3435 return graphql.Null 3436 } 3437 return ec._Human(ctx, sel, obj) 3438 case models.Droid: 3439 return ec._Droid(ctx, sel, &obj) 3440 case *models.Droid: 3441 if obj == nil { 3442 return graphql.Null 3443 } 3444 return ec._Droid(ctx, sel, obj) 3445 default: 3446 panic(fmt.Errorf("unexpected type %T", obj)) 3447 } 3448 } 3449 3450 func (ec *executionContext) _SearchResult(ctx context.Context, sel ast.SelectionSet, obj models.SearchResult) graphql.Marshaler { 3451 switch obj := (obj).(type) { 3452 case nil: 3453 return graphql.Null 3454 case models.Human: 3455 return ec._Human(ctx, sel, &obj) 3456 case *models.Human: 3457 if obj == nil { 3458 return graphql.Null 3459 } 3460 return ec._Human(ctx, sel, obj) 3461 case models.Droid: 3462 return ec._Droid(ctx, sel, &obj) 3463 case *models.Droid: 3464 if obj == nil { 3465 return graphql.Null 3466 } 3467 return ec._Droid(ctx, sel, obj) 3468 case models.Starship: 3469 return ec._Starship(ctx, sel, &obj) 3470 case *models.Starship: 3471 if obj == nil { 3472 return graphql.Null 3473 } 3474 return ec._Starship(ctx, sel, obj) 3475 default: 3476 panic(fmt.Errorf("unexpected type %T", obj)) 3477 } 3478 } 3479 3480 // endregion ************************** interface.gotpl *************************** 3481 3482 // region **************************** object.gotpl **************************** 3483 3484 var droidImplementors = []string{"Droid", "Character", "SearchResult"} 3485 3486 func (ec *executionContext) _Droid(ctx context.Context, sel ast.SelectionSet, obj *models.Droid) graphql.Marshaler { 3487 fields := graphql.CollectFields(ec.OperationContext, sel, droidImplementors) 3488 3489 out := graphql.NewFieldSet(fields) 3490 var invalids uint32 3491 for i, field := range fields { 3492 switch field.Name { 3493 case "__typename": 3494 out.Values[i] = graphql.MarshalString("Droid") 3495 case "id": 3496 out.Values[i] = ec._Droid_id(ctx, field, obj) 3497 if out.Values[i] == graphql.Null { 3498 atomic.AddUint32(&invalids, 1) 3499 } 3500 case "name": 3501 out.Values[i] = ec._Droid_name(ctx, field, obj) 3502 if out.Values[i] == graphql.Null { 3503 atomic.AddUint32(&invalids, 1) 3504 } 3505 case "friends": 3506 field := field 3507 out.Concurrently(i, func() (res graphql.Marshaler) { 3508 defer func() { 3509 if r := recover(); r != nil { 3510 ec.Error(ctx, ec.Recover(ctx, r)) 3511 } 3512 }() 3513 res = ec._Droid_friends(ctx, field, obj) 3514 return res 3515 }) 3516 case "friendsConnection": 3517 field := field 3518 out.Concurrently(i, func() (res graphql.Marshaler) { 3519 defer func() { 3520 if r := recover(); r != nil { 3521 ec.Error(ctx, ec.Recover(ctx, r)) 3522 } 3523 }() 3524 res = ec._Droid_friendsConnection(ctx, field, obj) 3525 if res == graphql.Null { 3526 atomic.AddUint32(&invalids, 1) 3527 } 3528 return res 3529 }) 3530 case "appearsIn": 3531 out.Values[i] = ec._Droid_appearsIn(ctx, field, obj) 3532 if out.Values[i] == graphql.Null { 3533 atomic.AddUint32(&invalids, 1) 3534 } 3535 case "primaryFunction": 3536 out.Values[i] = ec._Droid_primaryFunction(ctx, field, obj) 3537 default: 3538 panic("unknown field " + strconv.Quote(field.Name)) 3539 } 3540 } 3541 out.Dispatch() 3542 if invalids > 0 { 3543 return graphql.Null 3544 } 3545 return out 3546 } 3547 3548 var friendsConnectionImplementors = []string{"FriendsConnection"} 3549 3550 func (ec *executionContext) _FriendsConnection(ctx context.Context, sel ast.SelectionSet, obj *models.FriendsConnection) graphql.Marshaler { 3551 fields := graphql.CollectFields(ec.OperationContext, sel, friendsConnectionImplementors) 3552 3553 out := graphql.NewFieldSet(fields) 3554 var invalids uint32 3555 for i, field := range fields { 3556 switch field.Name { 3557 case "__typename": 3558 out.Values[i] = graphql.MarshalString("FriendsConnection") 3559 case "totalCount": 3560 out.Values[i] = ec._FriendsConnection_totalCount(ctx, field, obj) 3561 if out.Values[i] == graphql.Null { 3562 atomic.AddUint32(&invalids, 1) 3563 } 3564 case "edges": 3565 field := field 3566 out.Concurrently(i, func() (res graphql.Marshaler) { 3567 defer func() { 3568 if r := recover(); r != nil { 3569 ec.Error(ctx, ec.Recover(ctx, r)) 3570 } 3571 }() 3572 res = ec._FriendsConnection_edges(ctx, field, obj) 3573 return res 3574 }) 3575 case "friends": 3576 field := field 3577 out.Concurrently(i, func() (res graphql.Marshaler) { 3578 defer func() { 3579 if r := recover(); r != nil { 3580 ec.Error(ctx, ec.Recover(ctx, r)) 3581 } 3582 }() 3583 res = ec._FriendsConnection_friends(ctx, field, obj) 3584 return res 3585 }) 3586 case "pageInfo": 3587 out.Values[i] = ec._FriendsConnection_pageInfo(ctx, field, obj) 3588 if out.Values[i] == graphql.Null { 3589 atomic.AddUint32(&invalids, 1) 3590 } 3591 default: 3592 panic("unknown field " + strconv.Quote(field.Name)) 3593 } 3594 } 3595 out.Dispatch() 3596 if invalids > 0 { 3597 return graphql.Null 3598 } 3599 return out 3600 } 3601 3602 var friendsEdgeImplementors = []string{"FriendsEdge"} 3603 3604 func (ec *executionContext) _FriendsEdge(ctx context.Context, sel ast.SelectionSet, obj *models.FriendsEdge) graphql.Marshaler { 3605 fields := graphql.CollectFields(ec.OperationContext, sel, friendsEdgeImplementors) 3606 3607 out := graphql.NewFieldSet(fields) 3608 var invalids uint32 3609 for i, field := range fields { 3610 switch field.Name { 3611 case "__typename": 3612 out.Values[i] = graphql.MarshalString("FriendsEdge") 3613 case "cursor": 3614 out.Values[i] = ec._FriendsEdge_cursor(ctx, field, obj) 3615 if out.Values[i] == graphql.Null { 3616 invalids++ 3617 } 3618 case "node": 3619 out.Values[i] = ec._FriendsEdge_node(ctx, field, obj) 3620 default: 3621 panic("unknown field " + strconv.Quote(field.Name)) 3622 } 3623 } 3624 out.Dispatch() 3625 if invalids > 0 { 3626 return graphql.Null 3627 } 3628 return out 3629 } 3630 3631 var humanImplementors = []string{"Human", "Character", "SearchResult"} 3632 3633 func (ec *executionContext) _Human(ctx context.Context, sel ast.SelectionSet, obj *models.Human) graphql.Marshaler { 3634 fields := graphql.CollectFields(ec.OperationContext, sel, humanImplementors) 3635 3636 out := graphql.NewFieldSet(fields) 3637 var invalids uint32 3638 for i, field := range fields { 3639 switch field.Name { 3640 case "__typename": 3641 out.Values[i] = graphql.MarshalString("Human") 3642 case "id": 3643 out.Values[i] = ec._Human_id(ctx, field, obj) 3644 if out.Values[i] == graphql.Null { 3645 atomic.AddUint32(&invalids, 1) 3646 } 3647 case "name": 3648 out.Values[i] = ec._Human_name(ctx, field, obj) 3649 if out.Values[i] == graphql.Null { 3650 atomic.AddUint32(&invalids, 1) 3651 } 3652 case "height": 3653 out.Values[i] = ec._Human_height(ctx, field, obj) 3654 if out.Values[i] == graphql.Null { 3655 atomic.AddUint32(&invalids, 1) 3656 } 3657 case "mass": 3658 out.Values[i] = ec._Human_mass(ctx, field, obj) 3659 case "friends": 3660 field := field 3661 out.Concurrently(i, func() (res graphql.Marshaler) { 3662 defer func() { 3663 if r := recover(); r != nil { 3664 ec.Error(ctx, ec.Recover(ctx, r)) 3665 } 3666 }() 3667 res = ec._Human_friends(ctx, field, obj) 3668 return res 3669 }) 3670 case "friendsConnection": 3671 field := field 3672 out.Concurrently(i, func() (res graphql.Marshaler) { 3673 defer func() { 3674 if r := recover(); r != nil { 3675 ec.Error(ctx, ec.Recover(ctx, r)) 3676 } 3677 }() 3678 res = ec._Human_friendsConnection(ctx, field, obj) 3679 if res == graphql.Null { 3680 atomic.AddUint32(&invalids, 1) 3681 } 3682 return res 3683 }) 3684 case "appearsIn": 3685 out.Values[i] = ec._Human_appearsIn(ctx, field, obj) 3686 if out.Values[i] == graphql.Null { 3687 atomic.AddUint32(&invalids, 1) 3688 } 3689 case "starships": 3690 field := field 3691 out.Concurrently(i, func() (res graphql.Marshaler) { 3692 defer func() { 3693 if r := recover(); r != nil { 3694 ec.Error(ctx, ec.Recover(ctx, r)) 3695 } 3696 }() 3697 res = ec._Human_starships(ctx, field, obj) 3698 return res 3699 }) 3700 default: 3701 panic("unknown field " + strconv.Quote(field.Name)) 3702 } 3703 } 3704 out.Dispatch() 3705 if invalids > 0 { 3706 return graphql.Null 3707 } 3708 return out 3709 } 3710 3711 var mutationImplementors = []string{"Mutation"} 3712 3713 func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 3714 fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) 3715 3716 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ 3717 Object: "Mutation", 3718 }) 3719 3720 out := graphql.NewFieldSet(fields) 3721 var invalids uint32 3722 for i, field := range fields { 3723 switch field.Name { 3724 case "__typename": 3725 out.Values[i] = graphql.MarshalString("Mutation") 3726 case "createReview": 3727 out.Values[i] = ec._Mutation_createReview(ctx, field) 3728 default: 3729 panic("unknown field " + strconv.Quote(field.Name)) 3730 } 3731 } 3732 out.Dispatch() 3733 if invalids > 0 { 3734 return graphql.Null 3735 } 3736 return out 3737 } 3738 3739 var pageInfoImplementors = []string{"PageInfo"} 3740 3741 func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *models.PageInfo) graphql.Marshaler { 3742 fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) 3743 3744 out := graphql.NewFieldSet(fields) 3745 var invalids uint32 3746 for i, field := range fields { 3747 switch field.Name { 3748 case "__typename": 3749 out.Values[i] = graphql.MarshalString("PageInfo") 3750 case "startCursor": 3751 out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) 3752 if out.Values[i] == graphql.Null { 3753 invalids++ 3754 } 3755 case "endCursor": 3756 out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) 3757 if out.Values[i] == graphql.Null { 3758 invalids++ 3759 } 3760 case "hasNextPage": 3761 out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) 3762 if out.Values[i] == graphql.Null { 3763 invalids++ 3764 } 3765 default: 3766 panic("unknown field " + strconv.Quote(field.Name)) 3767 } 3768 } 3769 out.Dispatch() 3770 if invalids > 0 { 3771 return graphql.Null 3772 } 3773 return out 3774 } 3775 3776 var queryImplementors = []string{"Query"} 3777 3778 func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 3779 fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) 3780 3781 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ 3782 Object: "Query", 3783 }) 3784 3785 out := graphql.NewFieldSet(fields) 3786 var invalids uint32 3787 for i, field := range fields { 3788 switch field.Name { 3789 case "__typename": 3790 out.Values[i] = graphql.MarshalString("Query") 3791 case "hero": 3792 field := field 3793 out.Concurrently(i, func() (res graphql.Marshaler) { 3794 defer func() { 3795 if r := recover(); r != nil { 3796 ec.Error(ctx, ec.Recover(ctx, r)) 3797 } 3798 }() 3799 res = ec._Query_hero(ctx, field) 3800 return res 3801 }) 3802 case "reviews": 3803 field := field 3804 out.Concurrently(i, func() (res graphql.Marshaler) { 3805 defer func() { 3806 if r := recover(); r != nil { 3807 ec.Error(ctx, ec.Recover(ctx, r)) 3808 } 3809 }() 3810 res = ec._Query_reviews(ctx, field) 3811 if res == graphql.Null { 3812 atomic.AddUint32(&invalids, 1) 3813 } 3814 return res 3815 }) 3816 case "search": 3817 field := field 3818 out.Concurrently(i, func() (res graphql.Marshaler) { 3819 defer func() { 3820 if r := recover(); r != nil { 3821 ec.Error(ctx, ec.Recover(ctx, r)) 3822 } 3823 }() 3824 res = ec._Query_search(ctx, field) 3825 if res == graphql.Null { 3826 atomic.AddUint32(&invalids, 1) 3827 } 3828 return res 3829 }) 3830 case "character": 3831 field := field 3832 out.Concurrently(i, func() (res graphql.Marshaler) { 3833 defer func() { 3834 if r := recover(); r != nil { 3835 ec.Error(ctx, ec.Recover(ctx, r)) 3836 } 3837 }() 3838 res = ec._Query_character(ctx, field) 3839 return res 3840 }) 3841 case "droid": 3842 field := field 3843 out.Concurrently(i, func() (res graphql.Marshaler) { 3844 defer func() { 3845 if r := recover(); r != nil { 3846 ec.Error(ctx, ec.Recover(ctx, r)) 3847 } 3848 }() 3849 res = ec._Query_droid(ctx, field) 3850 return res 3851 }) 3852 case "human": 3853 field := field 3854 out.Concurrently(i, func() (res graphql.Marshaler) { 3855 defer func() { 3856 if r := recover(); r != nil { 3857 ec.Error(ctx, ec.Recover(ctx, r)) 3858 } 3859 }() 3860 res = ec._Query_human(ctx, field) 3861 return res 3862 }) 3863 case "starship": 3864 field := field 3865 out.Concurrently(i, func() (res graphql.Marshaler) { 3866 defer func() { 3867 if r := recover(); r != nil { 3868 ec.Error(ctx, ec.Recover(ctx, r)) 3869 } 3870 }() 3871 res = ec._Query_starship(ctx, field) 3872 return res 3873 }) 3874 case "__type": 3875 out.Values[i] = ec._Query___type(ctx, field) 3876 case "__schema": 3877 out.Values[i] = ec._Query___schema(ctx, field) 3878 default: 3879 panic("unknown field " + strconv.Quote(field.Name)) 3880 } 3881 } 3882 out.Dispatch() 3883 if invalids > 0 { 3884 return graphql.Null 3885 } 3886 return out 3887 } 3888 3889 var reviewImplementors = []string{"Review"} 3890 3891 func (ec *executionContext) _Review(ctx context.Context, sel ast.SelectionSet, obj *models.Review) graphql.Marshaler { 3892 fields := graphql.CollectFields(ec.OperationContext, sel, reviewImplementors) 3893 3894 out := graphql.NewFieldSet(fields) 3895 var invalids uint32 3896 for i, field := range fields { 3897 switch field.Name { 3898 case "__typename": 3899 out.Values[i] = graphql.MarshalString("Review") 3900 case "stars": 3901 out.Values[i] = ec._Review_stars(ctx, field, obj) 3902 if out.Values[i] == graphql.Null { 3903 invalids++ 3904 } 3905 case "commentary": 3906 out.Values[i] = ec._Review_commentary(ctx, field, obj) 3907 case "time": 3908 out.Values[i] = ec._Review_time(ctx, field, obj) 3909 default: 3910 panic("unknown field " + strconv.Quote(field.Name)) 3911 } 3912 } 3913 out.Dispatch() 3914 if invalids > 0 { 3915 return graphql.Null 3916 } 3917 return out 3918 } 3919 3920 var starshipImplementors = []string{"Starship", "SearchResult"} 3921 3922 func (ec *executionContext) _Starship(ctx context.Context, sel ast.SelectionSet, obj *models.Starship) graphql.Marshaler { 3923 fields := graphql.CollectFields(ec.OperationContext, sel, starshipImplementors) 3924 3925 out := graphql.NewFieldSet(fields) 3926 var invalids uint32 3927 for i, field := range fields { 3928 switch field.Name { 3929 case "__typename": 3930 out.Values[i] = graphql.MarshalString("Starship") 3931 case "id": 3932 out.Values[i] = ec._Starship_id(ctx, field, obj) 3933 if out.Values[i] == graphql.Null { 3934 atomic.AddUint32(&invalids, 1) 3935 } 3936 case "name": 3937 out.Values[i] = ec._Starship_name(ctx, field, obj) 3938 if out.Values[i] == graphql.Null { 3939 atomic.AddUint32(&invalids, 1) 3940 } 3941 case "length": 3942 field := field 3943 out.Concurrently(i, func() (res graphql.Marshaler) { 3944 defer func() { 3945 if r := recover(); r != nil { 3946 ec.Error(ctx, ec.Recover(ctx, r)) 3947 } 3948 }() 3949 res = ec._Starship_length(ctx, field, obj) 3950 if res == graphql.Null { 3951 atomic.AddUint32(&invalids, 1) 3952 } 3953 return res 3954 }) 3955 case "history": 3956 out.Values[i] = ec._Starship_history(ctx, field, obj) 3957 if out.Values[i] == graphql.Null { 3958 atomic.AddUint32(&invalids, 1) 3959 } 3960 default: 3961 panic("unknown field " + strconv.Quote(field.Name)) 3962 } 3963 } 3964 out.Dispatch() 3965 if invalids > 0 { 3966 return graphql.Null 3967 } 3968 return out 3969 } 3970 3971 var __DirectiveImplementors = []string{"__Directive"} 3972 3973 func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { 3974 fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) 3975 3976 out := graphql.NewFieldSet(fields) 3977 var invalids uint32 3978 for i, field := range fields { 3979 switch field.Name { 3980 case "__typename": 3981 out.Values[i] = graphql.MarshalString("__Directive") 3982 case "name": 3983 out.Values[i] = ec.___Directive_name(ctx, field, obj) 3984 if out.Values[i] == graphql.Null { 3985 invalids++ 3986 } 3987 case "description": 3988 out.Values[i] = ec.___Directive_description(ctx, field, obj) 3989 case "locations": 3990 out.Values[i] = ec.___Directive_locations(ctx, field, obj) 3991 if out.Values[i] == graphql.Null { 3992 invalids++ 3993 } 3994 case "args": 3995 out.Values[i] = ec.___Directive_args(ctx, field, obj) 3996 if out.Values[i] == graphql.Null { 3997 invalids++ 3998 } 3999 default: 4000 panic("unknown field " + strconv.Quote(field.Name)) 4001 } 4002 } 4003 out.Dispatch() 4004 if invalids > 0 { 4005 return graphql.Null 4006 } 4007 return out 4008 } 4009 4010 var __EnumValueImplementors = []string{"__EnumValue"} 4011 4012 func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { 4013 fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) 4014 4015 out := graphql.NewFieldSet(fields) 4016 var invalids uint32 4017 for i, field := range fields { 4018 switch field.Name { 4019 case "__typename": 4020 out.Values[i] = graphql.MarshalString("__EnumValue") 4021 case "name": 4022 out.Values[i] = ec.___EnumValue_name(ctx, field, obj) 4023 if out.Values[i] == graphql.Null { 4024 invalids++ 4025 } 4026 case "description": 4027 out.Values[i] = ec.___EnumValue_description(ctx, field, obj) 4028 case "isDeprecated": 4029 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) 4030 if out.Values[i] == graphql.Null { 4031 invalids++ 4032 } 4033 case "deprecationReason": 4034 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) 4035 default: 4036 panic("unknown field " + strconv.Quote(field.Name)) 4037 } 4038 } 4039 out.Dispatch() 4040 if invalids > 0 { 4041 return graphql.Null 4042 } 4043 return out 4044 } 4045 4046 var __FieldImplementors = []string{"__Field"} 4047 4048 func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { 4049 fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) 4050 4051 out := graphql.NewFieldSet(fields) 4052 var invalids uint32 4053 for i, field := range fields { 4054 switch field.Name { 4055 case "__typename": 4056 out.Values[i] = graphql.MarshalString("__Field") 4057 case "name": 4058 out.Values[i] = ec.___Field_name(ctx, field, obj) 4059 if out.Values[i] == graphql.Null { 4060 invalids++ 4061 } 4062 case "description": 4063 out.Values[i] = ec.___Field_description(ctx, field, obj) 4064 case "args": 4065 out.Values[i] = ec.___Field_args(ctx, field, obj) 4066 if out.Values[i] == graphql.Null { 4067 invalids++ 4068 } 4069 case "type": 4070 out.Values[i] = ec.___Field_type(ctx, field, obj) 4071 if out.Values[i] == graphql.Null { 4072 invalids++ 4073 } 4074 case "isDeprecated": 4075 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) 4076 if out.Values[i] == graphql.Null { 4077 invalids++ 4078 } 4079 case "deprecationReason": 4080 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) 4081 default: 4082 panic("unknown field " + strconv.Quote(field.Name)) 4083 } 4084 } 4085 out.Dispatch() 4086 if invalids > 0 { 4087 return graphql.Null 4088 } 4089 return out 4090 } 4091 4092 var __InputValueImplementors = []string{"__InputValue"} 4093 4094 func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { 4095 fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) 4096 4097 out := graphql.NewFieldSet(fields) 4098 var invalids uint32 4099 for i, field := range fields { 4100 switch field.Name { 4101 case "__typename": 4102 out.Values[i] = graphql.MarshalString("__InputValue") 4103 case "name": 4104 out.Values[i] = ec.___InputValue_name(ctx, field, obj) 4105 if out.Values[i] == graphql.Null { 4106 invalids++ 4107 } 4108 case "description": 4109 out.Values[i] = ec.___InputValue_description(ctx, field, obj) 4110 case "type": 4111 out.Values[i] = ec.___InputValue_type(ctx, field, obj) 4112 if out.Values[i] == graphql.Null { 4113 invalids++ 4114 } 4115 case "defaultValue": 4116 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) 4117 default: 4118 panic("unknown field " + strconv.Quote(field.Name)) 4119 } 4120 } 4121 out.Dispatch() 4122 if invalids > 0 { 4123 return graphql.Null 4124 } 4125 return out 4126 } 4127 4128 var __SchemaImplementors = []string{"__Schema"} 4129 4130 func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { 4131 fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) 4132 4133 out := graphql.NewFieldSet(fields) 4134 var invalids uint32 4135 for i, field := range fields { 4136 switch field.Name { 4137 case "__typename": 4138 out.Values[i] = graphql.MarshalString("__Schema") 4139 case "types": 4140 out.Values[i] = ec.___Schema_types(ctx, field, obj) 4141 if out.Values[i] == graphql.Null { 4142 invalids++ 4143 } 4144 case "queryType": 4145 out.Values[i] = ec.___Schema_queryType(ctx, field, obj) 4146 if out.Values[i] == graphql.Null { 4147 invalids++ 4148 } 4149 case "mutationType": 4150 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) 4151 case "subscriptionType": 4152 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) 4153 case "directives": 4154 out.Values[i] = ec.___Schema_directives(ctx, field, obj) 4155 if out.Values[i] == graphql.Null { 4156 invalids++ 4157 } 4158 default: 4159 panic("unknown field " + strconv.Quote(field.Name)) 4160 } 4161 } 4162 out.Dispatch() 4163 if invalids > 0 { 4164 return graphql.Null 4165 } 4166 return out 4167 } 4168 4169 var __TypeImplementors = []string{"__Type"} 4170 4171 func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { 4172 fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) 4173 4174 out := graphql.NewFieldSet(fields) 4175 var invalids uint32 4176 for i, field := range fields { 4177 switch field.Name { 4178 case "__typename": 4179 out.Values[i] = graphql.MarshalString("__Type") 4180 case "kind": 4181 out.Values[i] = ec.___Type_kind(ctx, field, obj) 4182 if out.Values[i] == graphql.Null { 4183 invalids++ 4184 } 4185 case "name": 4186 out.Values[i] = ec.___Type_name(ctx, field, obj) 4187 case "description": 4188 out.Values[i] = ec.___Type_description(ctx, field, obj) 4189 case "fields": 4190 out.Values[i] = ec.___Type_fields(ctx, field, obj) 4191 case "interfaces": 4192 out.Values[i] = ec.___Type_interfaces(ctx, field, obj) 4193 case "possibleTypes": 4194 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) 4195 case "enumValues": 4196 out.Values[i] = ec.___Type_enumValues(ctx, field, obj) 4197 case "inputFields": 4198 out.Values[i] = ec.___Type_inputFields(ctx, field, obj) 4199 case "ofType": 4200 out.Values[i] = ec.___Type_ofType(ctx, field, obj) 4201 default: 4202 panic("unknown field " + strconv.Quote(field.Name)) 4203 } 4204 } 4205 out.Dispatch() 4206 if invalids > 0 { 4207 return graphql.Null 4208 } 4209 return out 4210 } 4211 4212 // endregion **************************** object.gotpl **************************** 4213 4214 // region ***************************** type.gotpl ***************************** 4215 4216 func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 4217 return graphql.UnmarshalBoolean(v) 4218 } 4219 4220 func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 4221 res := graphql.MarshalBoolean(v) 4222 if res == graphql.Null { 4223 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4224 ec.Errorf(ctx, "must not be null") 4225 } 4226 } 4227 return res 4228 } 4229 4230 func (ec *executionContext) marshalNCharacter2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacter(ctx context.Context, sel ast.SelectionSet, v models.Character) graphql.Marshaler { 4231 if v == nil { 4232 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4233 ec.Errorf(ctx, "must not be null") 4234 } 4235 return graphql.Null 4236 } 4237 return ec._Character(ctx, sel, v) 4238 } 4239 4240 func (ec *executionContext) unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, v interface{}) (models.Episode, error) { 4241 var res models.Episode 4242 return res, res.UnmarshalGQL(v) 4243 } 4244 4245 func (ec *executionContext) marshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, sel ast.SelectionSet, v models.Episode) graphql.Marshaler { 4246 return v 4247 } 4248 4249 func (ec *executionContext) unmarshalNEpisode2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisodeᚄ(ctx context.Context, v interface{}) ([]models.Episode, error) { 4250 var vSlice []interface{} 4251 if v != nil { 4252 if tmp1, ok := v.([]interface{}); ok { 4253 vSlice = tmp1 4254 } else { 4255 vSlice = []interface{}{v} 4256 } 4257 } 4258 var err error 4259 res := make([]models.Episode, len(vSlice)) 4260 for i := range vSlice { 4261 res[i], err = ec.unmarshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, vSlice[i]) 4262 if err != nil { 4263 return nil, err 4264 } 4265 } 4266 return res, nil 4267 } 4268 4269 func (ec *executionContext) marshalNEpisode2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisodeᚄ(ctx context.Context, sel ast.SelectionSet, v []models.Episode) graphql.Marshaler { 4270 ret := make(graphql.Array, len(v)) 4271 var wg sync.WaitGroup 4272 isLen1 := len(v) == 1 4273 if !isLen1 { 4274 wg.Add(len(v)) 4275 } 4276 for i := range v { 4277 i := i 4278 fc := &graphql.FieldContext{ 4279 Index: &i, 4280 Result: &v[i], 4281 } 4282 ctx := graphql.WithFieldContext(ctx, fc) 4283 f := func(i int) { 4284 defer func() { 4285 if r := recover(); r != nil { 4286 ec.Error(ctx, ec.Recover(ctx, r)) 4287 ret = nil 4288 } 4289 }() 4290 if !isLen1 { 4291 defer wg.Done() 4292 } 4293 ret[i] = ec.marshalNEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, sel, v[i]) 4294 } 4295 if isLen1 { 4296 f(i) 4297 } else { 4298 go f(i) 4299 } 4300 4301 } 4302 wg.Wait() 4303 return ret 4304 } 4305 4306 func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { 4307 return graphql.UnmarshalFloat(v) 4308 } 4309 4310 func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { 4311 res := graphql.MarshalFloat(v) 4312 if res == graphql.Null { 4313 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4314 ec.Errorf(ctx, "must not be null") 4315 } 4316 } 4317 return res 4318 } 4319 4320 func (ec *executionContext) marshalNFriendsConnection2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsConnection(ctx context.Context, sel ast.SelectionSet, v models.FriendsConnection) graphql.Marshaler { 4321 return ec._FriendsConnection(ctx, sel, &v) 4322 } 4323 4324 func (ec *executionContext) marshalNFriendsConnection2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsConnection(ctx context.Context, sel ast.SelectionSet, v *models.FriendsConnection) graphql.Marshaler { 4325 if v == nil { 4326 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4327 ec.Errorf(ctx, "must not be null") 4328 } 4329 return graphql.Null 4330 } 4331 return ec._FriendsConnection(ctx, sel, v) 4332 } 4333 4334 func (ec *executionContext) marshalNFriendsEdge2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsEdge(ctx context.Context, sel ast.SelectionSet, v models.FriendsEdge) graphql.Marshaler { 4335 return ec._FriendsEdge(ctx, sel, &v) 4336 } 4337 4338 func (ec *executionContext) marshalNFriendsEdge2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsEdge(ctx context.Context, sel ast.SelectionSet, v *models.FriendsEdge) graphql.Marshaler { 4339 if v == nil { 4340 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4341 ec.Errorf(ctx, "must not be null") 4342 } 4343 return graphql.Null 4344 } 4345 return ec._FriendsEdge(ctx, sel, v) 4346 } 4347 4348 func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { 4349 return graphql.UnmarshalID(v) 4350 } 4351 4352 func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 4353 res := graphql.MarshalID(v) 4354 if res == graphql.Null { 4355 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4356 ec.Errorf(ctx, "must not be null") 4357 } 4358 } 4359 return res 4360 } 4361 4362 func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { 4363 return graphql.UnmarshalInt(v) 4364 } 4365 4366 func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { 4367 res := graphql.MarshalInt(v) 4368 if res == graphql.Null { 4369 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4370 ec.Errorf(ctx, "must not be null") 4371 } 4372 } 4373 return res 4374 } 4375 4376 func (ec *executionContext) unmarshalNInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) { 4377 var vSlice []interface{} 4378 if v != nil { 4379 if tmp1, ok := v.([]interface{}); ok { 4380 vSlice = tmp1 4381 } else { 4382 vSlice = []interface{}{v} 4383 } 4384 } 4385 var err error 4386 res := make([]int, len(vSlice)) 4387 for i := range vSlice { 4388 res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i]) 4389 if err != nil { 4390 return nil, err 4391 } 4392 } 4393 return res, nil 4394 } 4395 4396 func (ec *executionContext) marshalNInt2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler { 4397 ret := make(graphql.Array, len(v)) 4398 for i := range v { 4399 ret[i] = ec.marshalNInt2int(ctx, sel, v[i]) 4400 } 4401 4402 return ret 4403 } 4404 4405 func (ec *executionContext) unmarshalNInt2ᚕᚕintᚄ(ctx context.Context, v interface{}) ([][]int, error) { 4406 var vSlice []interface{} 4407 if v != nil { 4408 if tmp1, ok := v.([]interface{}); ok { 4409 vSlice = tmp1 4410 } else { 4411 vSlice = []interface{}{v} 4412 } 4413 } 4414 var err error 4415 res := make([][]int, len(vSlice)) 4416 for i := range vSlice { 4417 res[i], err = ec.unmarshalNInt2ᚕintᚄ(ctx, vSlice[i]) 4418 if err != nil { 4419 return nil, err 4420 } 4421 } 4422 return res, nil 4423 } 4424 4425 func (ec *executionContext) marshalNInt2ᚕᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v [][]int) graphql.Marshaler { 4426 ret := make(graphql.Array, len(v)) 4427 for i := range v { 4428 ret[i] = ec.marshalNInt2ᚕintᚄ(ctx, sel, v[i]) 4429 } 4430 4431 return ret 4432 } 4433 4434 func (ec *executionContext) marshalNPageInfo2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v models.PageInfo) graphql.Marshaler { 4435 return ec._PageInfo(ctx, sel, &v) 4436 } 4437 4438 func (ec *executionContext) marshalNReview2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx context.Context, sel ast.SelectionSet, v models.Review) graphql.Marshaler { 4439 return ec._Review(ctx, sel, &v) 4440 } 4441 4442 func (ec *executionContext) marshalNReview2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReviewᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Review) graphql.Marshaler { 4443 ret := make(graphql.Array, len(v)) 4444 var wg sync.WaitGroup 4445 isLen1 := len(v) == 1 4446 if !isLen1 { 4447 wg.Add(len(v)) 4448 } 4449 for i := range v { 4450 i := i 4451 fc := &graphql.FieldContext{ 4452 Index: &i, 4453 Result: &v[i], 4454 } 4455 ctx := graphql.WithFieldContext(ctx, fc) 4456 f := func(i int) { 4457 defer func() { 4458 if r := recover(); r != nil { 4459 ec.Error(ctx, ec.Recover(ctx, r)) 4460 ret = nil 4461 } 4462 }() 4463 if !isLen1 { 4464 defer wg.Done() 4465 } 4466 ret[i] = ec.marshalNReview2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx, sel, v[i]) 4467 } 4468 if isLen1 { 4469 f(i) 4470 } else { 4471 go f(i) 4472 } 4473 4474 } 4475 wg.Wait() 4476 return ret 4477 } 4478 4479 func (ec *executionContext) marshalNReview2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx context.Context, sel ast.SelectionSet, v *models.Review) graphql.Marshaler { 4480 if v == nil { 4481 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4482 ec.Errorf(ctx, "must not be null") 4483 } 4484 return graphql.Null 4485 } 4486 return ec._Review(ctx, sel, v) 4487 } 4488 4489 func (ec *executionContext) unmarshalNReviewInput2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx context.Context, v interface{}) (models.Review, error) { 4490 return ec.unmarshalInputReviewInput(ctx, v) 4491 } 4492 4493 func (ec *executionContext) marshalNSearchResult2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐSearchResult(ctx context.Context, sel ast.SelectionSet, v models.SearchResult) graphql.Marshaler { 4494 if v == nil { 4495 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4496 ec.Errorf(ctx, "must not be null") 4497 } 4498 return graphql.Null 4499 } 4500 return ec._SearchResult(ctx, sel, v) 4501 } 4502 4503 func (ec *executionContext) marshalNSearchResult2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐSearchResultᚄ(ctx context.Context, sel ast.SelectionSet, v []models.SearchResult) graphql.Marshaler { 4504 ret := make(graphql.Array, len(v)) 4505 var wg sync.WaitGroup 4506 isLen1 := len(v) == 1 4507 if !isLen1 { 4508 wg.Add(len(v)) 4509 } 4510 for i := range v { 4511 i := i 4512 fc := &graphql.FieldContext{ 4513 Index: &i, 4514 Result: &v[i], 4515 } 4516 ctx := graphql.WithFieldContext(ctx, fc) 4517 f := func(i int) { 4518 defer func() { 4519 if r := recover(); r != nil { 4520 ec.Error(ctx, ec.Recover(ctx, r)) 4521 ret = nil 4522 } 4523 }() 4524 if !isLen1 { 4525 defer wg.Done() 4526 } 4527 ret[i] = ec.marshalNSearchResult2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐSearchResult(ctx, sel, v[i]) 4528 } 4529 if isLen1 { 4530 f(i) 4531 } else { 4532 go f(i) 4533 } 4534 4535 } 4536 wg.Wait() 4537 return ret 4538 } 4539 4540 func (ec *executionContext) marshalNStarship2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarship(ctx context.Context, sel ast.SelectionSet, v models.Starship) graphql.Marshaler { 4541 return ec._Starship(ctx, sel, &v) 4542 } 4543 4544 func (ec *executionContext) marshalNStarship2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarship(ctx context.Context, sel ast.SelectionSet, v *models.Starship) graphql.Marshaler { 4545 if v == nil { 4546 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4547 ec.Errorf(ctx, "must not be null") 4548 } 4549 return graphql.Null 4550 } 4551 return ec._Starship(ctx, sel, v) 4552 } 4553 4554 func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { 4555 return graphql.UnmarshalString(v) 4556 } 4557 4558 func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 4559 res := graphql.MarshalString(v) 4560 if res == graphql.Null { 4561 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4562 ec.Errorf(ctx, "must not be null") 4563 } 4564 } 4565 return res 4566 } 4567 4568 func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { 4569 return ec.___Directive(ctx, sel, &v) 4570 } 4571 4572 func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { 4573 ret := make(graphql.Array, len(v)) 4574 var wg sync.WaitGroup 4575 isLen1 := len(v) == 1 4576 if !isLen1 { 4577 wg.Add(len(v)) 4578 } 4579 for i := range v { 4580 i := i 4581 fc := &graphql.FieldContext{ 4582 Index: &i, 4583 Result: &v[i], 4584 } 4585 ctx := graphql.WithFieldContext(ctx, fc) 4586 f := func(i int) { 4587 defer func() { 4588 if r := recover(); r != nil { 4589 ec.Error(ctx, ec.Recover(ctx, r)) 4590 ret = nil 4591 } 4592 }() 4593 if !isLen1 { 4594 defer wg.Done() 4595 } 4596 ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) 4597 } 4598 if isLen1 { 4599 f(i) 4600 } else { 4601 go f(i) 4602 } 4603 4604 } 4605 wg.Wait() 4606 return ret 4607 } 4608 4609 func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { 4610 return graphql.UnmarshalString(v) 4611 } 4612 4613 func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 4614 res := graphql.MarshalString(v) 4615 if res == graphql.Null { 4616 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4617 ec.Errorf(ctx, "must not be null") 4618 } 4619 } 4620 return res 4621 } 4622 4623 func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { 4624 var vSlice []interface{} 4625 if v != nil { 4626 if tmp1, ok := v.([]interface{}); ok { 4627 vSlice = tmp1 4628 } else { 4629 vSlice = []interface{}{v} 4630 } 4631 } 4632 var err error 4633 res := make([]string, len(vSlice)) 4634 for i := range vSlice { 4635 res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) 4636 if err != nil { 4637 return nil, err 4638 } 4639 } 4640 return res, nil 4641 } 4642 4643 func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { 4644 ret := make(graphql.Array, len(v)) 4645 var wg sync.WaitGroup 4646 isLen1 := len(v) == 1 4647 if !isLen1 { 4648 wg.Add(len(v)) 4649 } 4650 for i := range v { 4651 i := i 4652 fc := &graphql.FieldContext{ 4653 Index: &i, 4654 Result: &v[i], 4655 } 4656 ctx := graphql.WithFieldContext(ctx, fc) 4657 f := func(i int) { 4658 defer func() { 4659 if r := recover(); r != nil { 4660 ec.Error(ctx, ec.Recover(ctx, r)) 4661 ret = nil 4662 } 4663 }() 4664 if !isLen1 { 4665 defer wg.Done() 4666 } 4667 ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) 4668 } 4669 if isLen1 { 4670 f(i) 4671 } else { 4672 go f(i) 4673 } 4674 4675 } 4676 wg.Wait() 4677 return ret 4678 } 4679 4680 func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { 4681 return ec.___EnumValue(ctx, sel, &v) 4682 } 4683 4684 func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { 4685 return ec.___Field(ctx, sel, &v) 4686 } 4687 4688 func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { 4689 return ec.___InputValue(ctx, sel, &v) 4690 } 4691 4692 func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 4693 ret := make(graphql.Array, len(v)) 4694 var wg sync.WaitGroup 4695 isLen1 := len(v) == 1 4696 if !isLen1 { 4697 wg.Add(len(v)) 4698 } 4699 for i := range v { 4700 i := i 4701 fc := &graphql.FieldContext{ 4702 Index: &i, 4703 Result: &v[i], 4704 } 4705 ctx := graphql.WithFieldContext(ctx, fc) 4706 f := func(i int) { 4707 defer func() { 4708 if r := recover(); r != nil { 4709 ec.Error(ctx, ec.Recover(ctx, r)) 4710 ret = nil 4711 } 4712 }() 4713 if !isLen1 { 4714 defer wg.Done() 4715 } 4716 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 4717 } 4718 if isLen1 { 4719 f(i) 4720 } else { 4721 go f(i) 4722 } 4723 4724 } 4725 wg.Wait() 4726 return ret 4727 } 4728 4729 func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { 4730 return ec.___Type(ctx, sel, &v) 4731 } 4732 4733 func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 4734 ret := make(graphql.Array, len(v)) 4735 var wg sync.WaitGroup 4736 isLen1 := len(v) == 1 4737 if !isLen1 { 4738 wg.Add(len(v)) 4739 } 4740 for i := range v { 4741 i := i 4742 fc := &graphql.FieldContext{ 4743 Index: &i, 4744 Result: &v[i], 4745 } 4746 ctx := graphql.WithFieldContext(ctx, fc) 4747 f := func(i int) { 4748 defer func() { 4749 if r := recover(); r != nil { 4750 ec.Error(ctx, ec.Recover(ctx, r)) 4751 ret = nil 4752 } 4753 }() 4754 if !isLen1 { 4755 defer wg.Done() 4756 } 4757 ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 4758 } 4759 if isLen1 { 4760 f(i) 4761 } else { 4762 go f(i) 4763 } 4764 4765 } 4766 wg.Wait() 4767 return ret 4768 } 4769 4770 func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 4771 if v == nil { 4772 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4773 ec.Errorf(ctx, "must not be null") 4774 } 4775 return graphql.Null 4776 } 4777 return ec.___Type(ctx, sel, v) 4778 } 4779 4780 func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { 4781 return graphql.UnmarshalString(v) 4782 } 4783 4784 func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 4785 res := graphql.MarshalString(v) 4786 if res == graphql.Null { 4787 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 4788 ec.Errorf(ctx, "must not be null") 4789 } 4790 } 4791 return res 4792 } 4793 4794 func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 4795 return graphql.UnmarshalBoolean(v) 4796 } 4797 4798 func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 4799 return graphql.MarshalBoolean(v) 4800 } 4801 4802 func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { 4803 if v == nil { 4804 return nil, nil 4805 } 4806 res, err := ec.unmarshalOBoolean2bool(ctx, v) 4807 return &res, err 4808 } 4809 4810 func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { 4811 if v == nil { 4812 return graphql.Null 4813 } 4814 return ec.marshalOBoolean2bool(ctx, sel, *v) 4815 } 4816 4817 func (ec *executionContext) marshalOCharacter2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacter(ctx context.Context, sel ast.SelectionSet, v models.Character) graphql.Marshaler { 4818 if v == nil { 4819 return graphql.Null 4820 } 4821 return ec._Character(ctx, sel, v) 4822 } 4823 4824 func (ec *executionContext) marshalOCharacter2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacterᚄ(ctx context.Context, sel ast.SelectionSet, v []models.Character) graphql.Marshaler { 4825 if v == nil { 4826 return graphql.Null 4827 } 4828 ret := make(graphql.Array, len(v)) 4829 var wg sync.WaitGroup 4830 isLen1 := len(v) == 1 4831 if !isLen1 { 4832 wg.Add(len(v)) 4833 } 4834 for i := range v { 4835 i := i 4836 fc := &graphql.FieldContext{ 4837 Index: &i, 4838 Result: &v[i], 4839 } 4840 ctx := graphql.WithFieldContext(ctx, fc) 4841 f := func(i int) { 4842 defer func() { 4843 if r := recover(); r != nil { 4844 ec.Error(ctx, ec.Recover(ctx, r)) 4845 ret = nil 4846 } 4847 }() 4848 if !isLen1 { 4849 defer wg.Done() 4850 } 4851 ret[i] = ec.marshalNCharacter2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐCharacter(ctx, sel, v[i]) 4852 } 4853 if isLen1 { 4854 f(i) 4855 } else { 4856 go f(i) 4857 } 4858 4859 } 4860 wg.Wait() 4861 return ret 4862 } 4863 4864 func (ec *executionContext) marshalODroid2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐDroid(ctx context.Context, sel ast.SelectionSet, v models.Droid) graphql.Marshaler { 4865 return ec._Droid(ctx, sel, &v) 4866 } 4867 4868 func (ec *executionContext) marshalODroid2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐDroid(ctx context.Context, sel ast.SelectionSet, v *models.Droid) graphql.Marshaler { 4869 if v == nil { 4870 return graphql.Null 4871 } 4872 return ec._Droid(ctx, sel, v) 4873 } 4874 4875 func (ec *executionContext) unmarshalOEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, v interface{}) (models.Episode, error) { 4876 var res models.Episode 4877 return res, res.UnmarshalGQL(v) 4878 } 4879 4880 func (ec *executionContext) marshalOEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, sel ast.SelectionSet, v models.Episode) graphql.Marshaler { 4881 return v 4882 } 4883 4884 func (ec *executionContext) unmarshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, v interface{}) (*models.Episode, error) { 4885 if v == nil { 4886 return nil, nil 4887 } 4888 res, err := ec.unmarshalOEpisode2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx, v) 4889 return &res, err 4890 } 4891 4892 func (ec *executionContext) marshalOEpisode2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐEpisode(ctx context.Context, sel ast.SelectionSet, v *models.Episode) graphql.Marshaler { 4893 if v == nil { 4894 return graphql.Null 4895 } 4896 return v 4897 } 4898 4899 func (ec *executionContext) unmarshalOFloat2float64(ctx context.Context, v interface{}) (float64, error) { 4900 return graphql.UnmarshalFloat(v) 4901 } 4902 4903 func (ec *executionContext) marshalOFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { 4904 return graphql.MarshalFloat(v) 4905 } 4906 4907 func (ec *executionContext) marshalOFriendsEdge2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.FriendsEdge) graphql.Marshaler { 4908 if v == nil { 4909 return graphql.Null 4910 } 4911 ret := make(graphql.Array, len(v)) 4912 var wg sync.WaitGroup 4913 isLen1 := len(v) == 1 4914 if !isLen1 { 4915 wg.Add(len(v)) 4916 } 4917 for i := range v { 4918 i := i 4919 fc := &graphql.FieldContext{ 4920 Index: &i, 4921 Result: &v[i], 4922 } 4923 ctx := graphql.WithFieldContext(ctx, fc) 4924 f := func(i int) { 4925 defer func() { 4926 if r := recover(); r != nil { 4927 ec.Error(ctx, ec.Recover(ctx, r)) 4928 ret = nil 4929 } 4930 }() 4931 if !isLen1 { 4932 defer wg.Done() 4933 } 4934 ret[i] = ec.marshalNFriendsEdge2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐFriendsEdge(ctx, sel, v[i]) 4935 } 4936 if isLen1 { 4937 f(i) 4938 } else { 4939 go f(i) 4940 } 4941 4942 } 4943 wg.Wait() 4944 return ret 4945 } 4946 4947 func (ec *executionContext) marshalOHuman2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐHuman(ctx context.Context, sel ast.SelectionSet, v models.Human) graphql.Marshaler { 4948 return ec._Human(ctx, sel, &v) 4949 } 4950 4951 func (ec *executionContext) marshalOHuman2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐHuman(ctx context.Context, sel ast.SelectionSet, v *models.Human) graphql.Marshaler { 4952 if v == nil { 4953 return graphql.Null 4954 } 4955 return ec._Human(ctx, sel, v) 4956 } 4957 4958 func (ec *executionContext) unmarshalOID2string(ctx context.Context, v interface{}) (string, error) { 4959 return graphql.UnmarshalID(v) 4960 } 4961 4962 func (ec *executionContext) marshalOID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 4963 return graphql.MarshalID(v) 4964 } 4965 4966 func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v interface{}) (*string, error) { 4967 if v == nil { 4968 return nil, nil 4969 } 4970 res, err := ec.unmarshalOID2string(ctx, v) 4971 return &res, err 4972 } 4973 4974 func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { 4975 if v == nil { 4976 return graphql.Null 4977 } 4978 return ec.marshalOID2string(ctx, sel, *v) 4979 } 4980 4981 func (ec *executionContext) unmarshalOInt2int(ctx context.Context, v interface{}) (int, error) { 4982 return graphql.UnmarshalInt(v) 4983 } 4984 4985 func (ec *executionContext) marshalOInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { 4986 return graphql.MarshalInt(v) 4987 } 4988 4989 func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { 4990 if v == nil { 4991 return nil, nil 4992 } 4993 res, err := ec.unmarshalOInt2int(ctx, v) 4994 return &res, err 4995 } 4996 4997 func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { 4998 if v == nil { 4999 return graphql.Null 5000 } 5001 return ec.marshalOInt2int(ctx, sel, *v) 5002 } 5003 5004 func (ec *executionContext) unmarshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx context.Context, v interface{}) (models.LengthUnit, error) { 5005 var res models.LengthUnit 5006 return res, res.UnmarshalGQL(v) 5007 } 5008 5009 func (ec *executionContext) marshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx context.Context, sel ast.SelectionSet, v models.LengthUnit) graphql.Marshaler { 5010 return v 5011 } 5012 5013 func (ec *executionContext) unmarshalOLengthUnit2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx context.Context, v interface{}) (*models.LengthUnit, error) { 5014 if v == nil { 5015 return nil, nil 5016 } 5017 res, err := ec.unmarshalOLengthUnit2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx, v) 5018 return &res, err 5019 } 5020 5021 func (ec *executionContext) marshalOLengthUnit2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐLengthUnit(ctx context.Context, sel ast.SelectionSet, v *models.LengthUnit) graphql.Marshaler { 5022 if v == nil { 5023 return graphql.Null 5024 } 5025 return v 5026 } 5027 5028 func (ec *executionContext) marshalOReview2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx context.Context, sel ast.SelectionSet, v models.Review) graphql.Marshaler { 5029 return ec._Review(ctx, sel, &v) 5030 } 5031 5032 func (ec *executionContext) marshalOReview2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐReview(ctx context.Context, sel ast.SelectionSet, v *models.Review) graphql.Marshaler { 5033 if v == nil { 5034 return graphql.Null 5035 } 5036 return ec._Review(ctx, sel, v) 5037 } 5038 5039 func (ec *executionContext) marshalOStarship2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarship(ctx context.Context, sel ast.SelectionSet, v models.Starship) graphql.Marshaler { 5040 return ec._Starship(ctx, sel, &v) 5041 } 5042 5043 func (ec *executionContext) marshalOStarship2ᚕᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarshipᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.Starship) graphql.Marshaler { 5044 if v == nil { 5045 return graphql.Null 5046 } 5047 ret := make(graphql.Array, len(v)) 5048 var wg sync.WaitGroup 5049 isLen1 := len(v) == 1 5050 if !isLen1 { 5051 wg.Add(len(v)) 5052 } 5053 for i := range v { 5054 i := i 5055 fc := &graphql.FieldContext{ 5056 Index: &i, 5057 Result: &v[i], 5058 } 5059 ctx := graphql.WithFieldContext(ctx, fc) 5060 f := func(i int) { 5061 defer func() { 5062 if r := recover(); r != nil { 5063 ec.Error(ctx, ec.Recover(ctx, r)) 5064 ret = nil 5065 } 5066 }() 5067 if !isLen1 { 5068 defer wg.Done() 5069 } 5070 ret[i] = ec.marshalNStarship2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarship(ctx, sel, v[i]) 5071 } 5072 if isLen1 { 5073 f(i) 5074 } else { 5075 go f(i) 5076 } 5077 5078 } 5079 wg.Wait() 5080 return ret 5081 } 5082 5083 func (ec *executionContext) marshalOStarship2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋstarwarsᚋmodelsᚐStarship(ctx context.Context, sel ast.SelectionSet, v *models.Starship) graphql.Marshaler { 5084 if v == nil { 5085 return graphql.Null 5086 } 5087 return ec._Starship(ctx, sel, v) 5088 } 5089 5090 func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { 5091 return graphql.UnmarshalString(v) 5092 } 5093 5094 func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 5095 return graphql.MarshalString(v) 5096 } 5097 5098 func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { 5099 if v == nil { 5100 return nil, nil 5101 } 5102 res, err := ec.unmarshalOString2string(ctx, v) 5103 return &res, err 5104 } 5105 5106 func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { 5107 if v == nil { 5108 return graphql.Null 5109 } 5110 return ec.marshalOString2string(ctx, sel, *v) 5111 } 5112 5113 func (ec *executionContext) unmarshalOTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { 5114 return graphql.UnmarshalTime(v) 5115 } 5116 5117 func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { 5118 return graphql.MarshalTime(v) 5119 } 5120 5121 func (ec *executionContext) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) { 5122 if v == nil { 5123 return nil, nil 5124 } 5125 res, err := ec.unmarshalOTime2timeᚐTime(ctx, v) 5126 return &res, err 5127 } 5128 5129 func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { 5130 if v == nil { 5131 return graphql.Null 5132 } 5133 return ec.marshalOTime2timeᚐTime(ctx, sel, *v) 5134 } 5135 5136 func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { 5137 if v == nil { 5138 return graphql.Null 5139 } 5140 ret := make(graphql.Array, len(v)) 5141 var wg sync.WaitGroup 5142 isLen1 := len(v) == 1 5143 if !isLen1 { 5144 wg.Add(len(v)) 5145 } 5146 for i := range v { 5147 i := i 5148 fc := &graphql.FieldContext{ 5149 Index: &i, 5150 Result: &v[i], 5151 } 5152 ctx := graphql.WithFieldContext(ctx, fc) 5153 f := func(i int) { 5154 defer func() { 5155 if r := recover(); r != nil { 5156 ec.Error(ctx, ec.Recover(ctx, r)) 5157 ret = nil 5158 } 5159 }() 5160 if !isLen1 { 5161 defer wg.Done() 5162 } 5163 ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) 5164 } 5165 if isLen1 { 5166 f(i) 5167 } else { 5168 go f(i) 5169 } 5170 5171 } 5172 wg.Wait() 5173 return ret 5174 } 5175 5176 func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { 5177 if v == nil { 5178 return graphql.Null 5179 } 5180 ret := make(graphql.Array, len(v)) 5181 var wg sync.WaitGroup 5182 isLen1 := len(v) == 1 5183 if !isLen1 { 5184 wg.Add(len(v)) 5185 } 5186 for i := range v { 5187 i := i 5188 fc := &graphql.FieldContext{ 5189 Index: &i, 5190 Result: &v[i], 5191 } 5192 ctx := graphql.WithFieldContext(ctx, fc) 5193 f := func(i int) { 5194 defer func() { 5195 if r := recover(); r != nil { 5196 ec.Error(ctx, ec.Recover(ctx, r)) 5197 ret = nil 5198 } 5199 }() 5200 if !isLen1 { 5201 defer wg.Done() 5202 } 5203 ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) 5204 } 5205 if isLen1 { 5206 f(i) 5207 } else { 5208 go f(i) 5209 } 5210 5211 } 5212 wg.Wait() 5213 return ret 5214 } 5215 5216 func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 5217 if v == nil { 5218 return graphql.Null 5219 } 5220 ret := make(graphql.Array, len(v)) 5221 var wg sync.WaitGroup 5222 isLen1 := len(v) == 1 5223 if !isLen1 { 5224 wg.Add(len(v)) 5225 } 5226 for i := range v { 5227 i := i 5228 fc := &graphql.FieldContext{ 5229 Index: &i, 5230 Result: &v[i], 5231 } 5232 ctx := graphql.WithFieldContext(ctx, fc) 5233 f := func(i int) { 5234 defer func() { 5235 if r := recover(); r != nil { 5236 ec.Error(ctx, ec.Recover(ctx, r)) 5237 ret = nil 5238 } 5239 }() 5240 if !isLen1 { 5241 defer wg.Done() 5242 } 5243 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 5244 } 5245 if isLen1 { 5246 f(i) 5247 } else { 5248 go f(i) 5249 } 5250 5251 } 5252 wg.Wait() 5253 return ret 5254 } 5255 5256 func (ec *executionContext) marshalO__Schema2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v introspection.Schema) graphql.Marshaler { 5257 return ec.___Schema(ctx, sel, &v) 5258 } 5259 5260 func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { 5261 if v == nil { 5262 return graphql.Null 5263 } 5264 return ec.___Schema(ctx, sel, v) 5265 } 5266 5267 func (ec *executionContext) marshalO__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { 5268 return ec.___Type(ctx, sel, &v) 5269 } 5270 5271 func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 5272 if v == nil { 5273 return graphql.Null 5274 } 5275 ret := make(graphql.Array, len(v)) 5276 var wg sync.WaitGroup 5277 isLen1 := len(v) == 1 5278 if !isLen1 { 5279 wg.Add(len(v)) 5280 } 5281 for i := range v { 5282 i := i 5283 fc := &graphql.FieldContext{ 5284 Index: &i, 5285 Result: &v[i], 5286 } 5287 ctx := graphql.WithFieldContext(ctx, fc) 5288 f := func(i int) { 5289 defer func() { 5290 if r := recover(); r != nil { 5291 ec.Error(ctx, ec.Recover(ctx, r)) 5292 ret = nil 5293 } 5294 }() 5295 if !isLen1 { 5296 defer wg.Done() 5297 } 5298 ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 5299 } 5300 if isLen1 { 5301 f(i) 5302 } else { 5303 go f(i) 5304 } 5305 5306 } 5307 wg.Wait() 5308 return ret 5309 } 5310 5311 func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 5312 if v == nil { 5313 return graphql.Null 5314 } 5315 return ec.___Type(ctx, sel, v) 5316 } 5317 5318 // endregion ***************************** type.gotpl *****************************