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