github.com/nathanstitt/genqlient@v0.3.1-0.20211028004951-a2bda3c41ab8/internal/integration/server/gqlgen_exec.go (about) 1 // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. 2 3 package server 4 5 import ( 6 "bytes" 7 "context" 8 "errors" 9 "fmt" 10 "strconv" 11 "sync" 12 "sync/atomic" 13 14 "github.com/99designs/gqlgen/graphql" 15 "github.com/99designs/gqlgen/graphql/introspection" 16 gqlparser "github.com/vektah/gqlparser/v2" 17 "github.com/vektah/gqlparser/v2/ast" 18 ) 19 20 // region ************************** generated!.gotpl ************************** 21 22 // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. 23 func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { 24 return &executableSchema{ 25 resolvers: cfg.Resolvers, 26 directives: cfg.Directives, 27 complexity: cfg.Complexity, 28 } 29 } 30 31 type Config struct { 32 Resolvers ResolverRoot 33 Directives DirectiveRoot 34 Complexity ComplexityRoot 35 } 36 37 type ResolverRoot interface { 38 Query() QueryResolver 39 } 40 41 type DirectiveRoot struct { 42 } 43 44 type ComplexityRoot struct { 45 Animal struct { 46 Hair func(childComplexity int) int 47 ID func(childComplexity int) int 48 Name func(childComplexity int) int 49 Owner func(childComplexity int) int 50 Species func(childComplexity int) int 51 } 52 53 BeingsHair struct { 54 HasHair func(childComplexity int) int 55 } 56 57 Hair struct { 58 Color func(childComplexity int) int 59 } 60 61 Query struct { 62 Being func(childComplexity int, id string) int 63 Beings func(childComplexity int, ids []string) int 64 Fail func(childComplexity int) int 65 LotteryWinner func(childComplexity int, number int) int 66 Me func(childComplexity int) int 67 User func(childComplexity int, id *string) int 68 UserSearch func(childComplexity int, birthdate *string, id *string) int 69 UsersBornOn func(childComplexity int, date string) int 70 UsersBornOnDates func(childComplexity int, dates []string) int 71 } 72 73 User struct { 74 Birthdate func(childComplexity int) int 75 Friends func(childComplexity int) int 76 Hair func(childComplexity int) int 77 ID func(childComplexity int) int 78 LuckyNumber func(childComplexity int) int 79 Name func(childComplexity int) int 80 } 81 } 82 83 type QueryResolver interface { 84 Me(ctx context.Context) (*User, error) 85 User(ctx context.Context, id *string) (*User, error) 86 Being(ctx context.Context, id string) (Being, error) 87 Beings(ctx context.Context, ids []string) ([]Being, error) 88 LotteryWinner(ctx context.Context, number int) (Lucky, error) 89 UsersBornOn(ctx context.Context, date string) ([]*User, error) 90 UsersBornOnDates(ctx context.Context, dates []string) ([]*User, error) 91 UserSearch(ctx context.Context, birthdate *string, id *string) ([]*User, error) 92 Fail(ctx context.Context) (*bool, error) 93 } 94 95 type executableSchema struct { 96 resolvers ResolverRoot 97 directives DirectiveRoot 98 complexity ComplexityRoot 99 } 100 101 func (e *executableSchema) Schema() *ast.Schema { 102 return parsedSchema 103 } 104 105 func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { 106 ec := executionContext{nil, e} 107 _ = ec 108 switch typeName + "." + field { 109 110 case "Animal.hair": 111 if e.complexity.Animal.Hair == nil { 112 break 113 } 114 115 return e.complexity.Animal.Hair(childComplexity), true 116 117 case "Animal.id": 118 if e.complexity.Animal.ID == nil { 119 break 120 } 121 122 return e.complexity.Animal.ID(childComplexity), true 123 124 case "Animal.name": 125 if e.complexity.Animal.Name == nil { 126 break 127 } 128 129 return e.complexity.Animal.Name(childComplexity), true 130 131 case "Animal.owner": 132 if e.complexity.Animal.Owner == nil { 133 break 134 } 135 136 return e.complexity.Animal.Owner(childComplexity), true 137 138 case "Animal.species": 139 if e.complexity.Animal.Species == nil { 140 break 141 } 142 143 return e.complexity.Animal.Species(childComplexity), true 144 145 case "BeingsHair.hasHair": 146 if e.complexity.BeingsHair.HasHair == nil { 147 break 148 } 149 150 return e.complexity.BeingsHair.HasHair(childComplexity), true 151 152 case "Hair.color": 153 if e.complexity.Hair.Color == nil { 154 break 155 } 156 157 return e.complexity.Hair.Color(childComplexity), true 158 159 case "Query.being": 160 if e.complexity.Query.Being == nil { 161 break 162 } 163 164 args, err := ec.field_Query_being_args(context.TODO(), rawArgs) 165 if err != nil { 166 return 0, false 167 } 168 169 return e.complexity.Query.Being(childComplexity, args["id"].(string)), true 170 171 case "Query.beings": 172 if e.complexity.Query.Beings == nil { 173 break 174 } 175 176 args, err := ec.field_Query_beings_args(context.TODO(), rawArgs) 177 if err != nil { 178 return 0, false 179 } 180 181 return e.complexity.Query.Beings(childComplexity, args["ids"].([]string)), true 182 183 case "Query.fail": 184 if e.complexity.Query.Fail == nil { 185 break 186 } 187 188 return e.complexity.Query.Fail(childComplexity), true 189 190 case "Query.lotteryWinner": 191 if e.complexity.Query.LotteryWinner == nil { 192 break 193 } 194 195 args, err := ec.field_Query_lotteryWinner_args(context.TODO(), rawArgs) 196 if err != nil { 197 return 0, false 198 } 199 200 return e.complexity.Query.LotteryWinner(childComplexity, args["number"].(int)), true 201 202 case "Query.me": 203 if e.complexity.Query.Me == nil { 204 break 205 } 206 207 return e.complexity.Query.Me(childComplexity), true 208 209 case "Query.user": 210 if e.complexity.Query.User == nil { 211 break 212 } 213 214 args, err := ec.field_Query_user_args(context.TODO(), rawArgs) 215 if err != nil { 216 return 0, false 217 } 218 219 return e.complexity.Query.User(childComplexity, args["id"].(*string)), true 220 221 case "Query.userSearch": 222 if e.complexity.Query.UserSearch == nil { 223 break 224 } 225 226 args, err := ec.field_Query_userSearch_args(context.TODO(), rawArgs) 227 if err != nil { 228 return 0, false 229 } 230 231 return e.complexity.Query.UserSearch(childComplexity, args["birthdate"].(*string), args["id"].(*string)), true 232 233 case "Query.usersBornOn": 234 if e.complexity.Query.UsersBornOn == nil { 235 break 236 } 237 238 args, err := ec.field_Query_usersBornOn_args(context.TODO(), rawArgs) 239 if err != nil { 240 return 0, false 241 } 242 243 return e.complexity.Query.UsersBornOn(childComplexity, args["date"].(string)), true 244 245 case "Query.usersBornOnDates": 246 if e.complexity.Query.UsersBornOnDates == nil { 247 break 248 } 249 250 args, err := ec.field_Query_usersBornOnDates_args(context.TODO(), rawArgs) 251 if err != nil { 252 return 0, false 253 } 254 255 return e.complexity.Query.UsersBornOnDates(childComplexity, args["dates"].([]string)), true 256 257 case "User.birthdate": 258 if e.complexity.User.Birthdate == nil { 259 break 260 } 261 262 return e.complexity.User.Birthdate(childComplexity), true 263 264 case "User.friends": 265 if e.complexity.User.Friends == nil { 266 break 267 } 268 269 return e.complexity.User.Friends(childComplexity), true 270 271 case "User.hair": 272 if e.complexity.User.Hair == nil { 273 break 274 } 275 276 return e.complexity.User.Hair(childComplexity), true 277 278 case "User.id": 279 if e.complexity.User.ID == nil { 280 break 281 } 282 283 return e.complexity.User.ID(childComplexity), true 284 285 case "User.luckyNumber": 286 if e.complexity.User.LuckyNumber == nil { 287 break 288 } 289 290 return e.complexity.User.LuckyNumber(childComplexity), true 291 292 case "User.name": 293 if e.complexity.User.Name == nil { 294 break 295 } 296 297 return e.complexity.User.Name(childComplexity), true 298 299 } 300 return 0, false 301 } 302 303 func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { 304 rc := graphql.GetOperationContext(ctx) 305 ec := executionContext{rc, e} 306 first := true 307 308 switch rc.Operation.Operation { 309 case ast.Query: 310 return func(ctx context.Context) *graphql.Response { 311 if !first { 312 return nil 313 } 314 first = false 315 data := ec._Query(ctx, rc.Operation.SelectionSet) 316 var buf bytes.Buffer 317 data.MarshalGQL(&buf) 318 319 return &graphql.Response{ 320 Data: buf.Bytes(), 321 } 322 } 323 324 default: 325 return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) 326 } 327 } 328 329 type executionContext struct { 330 *graphql.OperationContext 331 *executableSchema 332 } 333 334 func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { 335 if ec.DisableIntrospection { 336 return nil, errors.New("introspection disabled") 337 } 338 return introspection.WrapSchema(parsedSchema), nil 339 } 340 341 func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { 342 if ec.DisableIntrospection { 343 return nil, errors.New("introspection disabled") 344 } 345 return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil 346 } 347 348 var sources = []*ast.Source{ 349 {Name: "../schema.graphql", Input: `scalar Date 350 351 type Query { 352 me: User 353 user(id: ID): User 354 being(id: ID!): Being 355 beings(ids: [ID!]!): [Being]! 356 lotteryWinner(number: Int!): Lucky 357 usersBornOn(date: Date!): [User!]! 358 usersBornOnDates(dates: [Date!]!): [User!]! 359 userSearch(birthdate: Date, id: ID): [User] 360 fail: Boolean 361 } 362 363 type User implements Being & Lucky { 364 id: ID! 365 name: String! 366 luckyNumber: Int 367 hair: Hair 368 birthdate: Date 369 friends: [User!]! 370 } 371 372 type Hair { color: String } # silly name to confuse the name-generator 373 374 type Animal implements Being { 375 id: ID! 376 name: String! 377 species: Species! 378 owner: Being 379 hair: BeingsHair 380 } 381 382 type BeingsHair { hasHair: Boolean! } # silly name to confuse the name-generator 383 384 enum Species { 385 DOG 386 COELACANTH 387 } 388 389 interface Being { 390 id: ID! 391 name: String! 392 } 393 394 interface Lucky { 395 luckyNumber: Int 396 } 397 `, BuiltIn: false}, 398 } 399 var parsedSchema = gqlparser.MustLoadSchema(sources...) 400 401 // endregion ************************** generated!.gotpl ************************** 402 403 // region ***************************** args.gotpl ***************************** 404 405 func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 406 var err error 407 args := map[string]interface{}{} 408 var arg0 string 409 if tmp, ok := rawArgs["name"]; ok { 410 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) 411 arg0, err = ec.unmarshalNString2string(ctx, tmp) 412 if err != nil { 413 return nil, err 414 } 415 } 416 args["name"] = arg0 417 return args, nil 418 } 419 420 func (ec *executionContext) field_Query_being_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 421 var err error 422 args := map[string]interface{}{} 423 var arg0 string 424 if tmp, ok := rawArgs["id"]; ok { 425 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) 426 arg0, err = ec.unmarshalNID2string(ctx, tmp) 427 if err != nil { 428 return nil, err 429 } 430 } 431 args["id"] = arg0 432 return args, nil 433 } 434 435 func (ec *executionContext) field_Query_beings_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 436 var err error 437 args := map[string]interface{}{} 438 var arg0 []string 439 if tmp, ok := rawArgs["ids"]; ok { 440 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids")) 441 arg0, err = ec.unmarshalNID2ᚕstringᚄ(ctx, tmp) 442 if err != nil { 443 return nil, err 444 } 445 } 446 args["ids"] = arg0 447 return args, nil 448 } 449 450 func (ec *executionContext) field_Query_lotteryWinner_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 451 var err error 452 args := map[string]interface{}{} 453 var arg0 int 454 if tmp, ok := rawArgs["number"]; ok { 455 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("number")) 456 arg0, err = ec.unmarshalNInt2int(ctx, tmp) 457 if err != nil { 458 return nil, err 459 } 460 } 461 args["number"] = arg0 462 return args, nil 463 } 464 465 func (ec *executionContext) field_Query_userSearch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 466 var err error 467 args := map[string]interface{}{} 468 var arg0 *string 469 if tmp, ok := rawArgs["birthdate"]; ok { 470 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("birthdate")) 471 arg0, err = ec.unmarshalODate2ᚖstring(ctx, tmp) 472 if err != nil { 473 return nil, err 474 } 475 } 476 args["birthdate"] = arg0 477 var arg1 *string 478 if tmp, ok := rawArgs["id"]; ok { 479 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) 480 arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) 481 if err != nil { 482 return nil, err 483 } 484 } 485 args["id"] = arg1 486 return args, nil 487 } 488 489 func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 490 var err error 491 args := map[string]interface{}{} 492 var arg0 *string 493 if tmp, ok := rawArgs["id"]; ok { 494 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) 495 arg0, err = ec.unmarshalOID2ᚖstring(ctx, tmp) 496 if err != nil { 497 return nil, err 498 } 499 } 500 args["id"] = arg0 501 return args, nil 502 } 503 504 func (ec *executionContext) field_Query_usersBornOnDates_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 505 var err error 506 args := map[string]interface{}{} 507 var arg0 []string 508 if tmp, ok := rawArgs["dates"]; ok { 509 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dates")) 510 arg0, err = ec.unmarshalNDate2ᚕstringᚄ(ctx, tmp) 511 if err != nil { 512 return nil, err 513 } 514 } 515 args["dates"] = arg0 516 return args, nil 517 } 518 519 func (ec *executionContext) field_Query_usersBornOn_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 520 var err error 521 args := map[string]interface{}{} 522 var arg0 string 523 if tmp, ok := rawArgs["date"]; ok { 524 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("date")) 525 arg0, err = ec.unmarshalNDate2string(ctx, tmp) 526 if err != nil { 527 return nil, err 528 } 529 } 530 args["date"] = arg0 531 return args, nil 532 } 533 534 func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 535 var err error 536 args := map[string]interface{}{} 537 var arg0 bool 538 if tmp, ok := rawArgs["includeDeprecated"]; ok { 539 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) 540 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 541 if err != nil { 542 return nil, err 543 } 544 } 545 args["includeDeprecated"] = arg0 546 return args, nil 547 } 548 549 func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 550 var err error 551 args := map[string]interface{}{} 552 var arg0 bool 553 if tmp, ok := rawArgs["includeDeprecated"]; ok { 554 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) 555 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 556 if err != nil { 557 return nil, err 558 } 559 } 560 args["includeDeprecated"] = arg0 561 return args, nil 562 } 563 564 // endregion ***************************** args.gotpl ***************************** 565 566 // region ************************** directives.gotpl ************************** 567 568 // endregion ************************** directives.gotpl ************************** 569 570 // region **************************** field.gotpl ***************************** 571 572 func (ec *executionContext) _Animal_id(ctx context.Context, field graphql.CollectedField, obj *Animal) (ret graphql.Marshaler) { 573 defer func() { 574 if r := recover(); r != nil { 575 ec.Error(ctx, ec.Recover(ctx, r)) 576 ret = graphql.Null 577 } 578 }() 579 fc := &graphql.FieldContext{ 580 Object: "Animal", 581 Field: field, 582 Args: nil, 583 IsMethod: false, 584 IsResolver: false, 585 } 586 587 ctx = graphql.WithFieldContext(ctx, fc) 588 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 589 ctx = rctx // use context from middleware stack in children 590 return obj.ID, nil 591 }) 592 if err != nil { 593 ec.Error(ctx, err) 594 return graphql.Null 595 } 596 if resTmp == nil { 597 if !graphql.HasFieldError(ctx, fc) { 598 ec.Errorf(ctx, "must not be null") 599 } 600 return graphql.Null 601 } 602 res := resTmp.(string) 603 fc.Result = res 604 return ec.marshalNID2string(ctx, field.Selections, res) 605 } 606 607 func (ec *executionContext) _Animal_name(ctx context.Context, field graphql.CollectedField, obj *Animal) (ret graphql.Marshaler) { 608 defer func() { 609 if r := recover(); r != nil { 610 ec.Error(ctx, ec.Recover(ctx, r)) 611 ret = graphql.Null 612 } 613 }() 614 fc := &graphql.FieldContext{ 615 Object: "Animal", 616 Field: field, 617 Args: nil, 618 IsMethod: false, 619 IsResolver: false, 620 } 621 622 ctx = graphql.WithFieldContext(ctx, fc) 623 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 624 ctx = rctx // use context from middleware stack in children 625 return obj.Name, nil 626 }) 627 if err != nil { 628 ec.Error(ctx, err) 629 return graphql.Null 630 } 631 if resTmp == nil { 632 if !graphql.HasFieldError(ctx, fc) { 633 ec.Errorf(ctx, "must not be null") 634 } 635 return graphql.Null 636 } 637 res := resTmp.(string) 638 fc.Result = res 639 return ec.marshalNString2string(ctx, field.Selections, res) 640 } 641 642 func (ec *executionContext) _Animal_species(ctx context.Context, field graphql.CollectedField, obj *Animal) (ret graphql.Marshaler) { 643 defer func() { 644 if r := recover(); r != nil { 645 ec.Error(ctx, ec.Recover(ctx, r)) 646 ret = graphql.Null 647 } 648 }() 649 fc := &graphql.FieldContext{ 650 Object: "Animal", 651 Field: field, 652 Args: nil, 653 IsMethod: false, 654 IsResolver: false, 655 } 656 657 ctx = graphql.WithFieldContext(ctx, fc) 658 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 659 ctx = rctx // use context from middleware stack in children 660 return obj.Species, nil 661 }) 662 if err != nil { 663 ec.Error(ctx, err) 664 return graphql.Null 665 } 666 if resTmp == nil { 667 if !graphql.HasFieldError(ctx, fc) { 668 ec.Errorf(ctx, "must not be null") 669 } 670 return graphql.Null 671 } 672 res := resTmp.(Species) 673 fc.Result = res 674 return ec.marshalNSpecies2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐSpecies(ctx, field.Selections, res) 675 } 676 677 func (ec *executionContext) _Animal_owner(ctx context.Context, field graphql.CollectedField, obj *Animal) (ret graphql.Marshaler) { 678 defer func() { 679 if r := recover(); r != nil { 680 ec.Error(ctx, ec.Recover(ctx, r)) 681 ret = graphql.Null 682 } 683 }() 684 fc := &graphql.FieldContext{ 685 Object: "Animal", 686 Field: field, 687 Args: nil, 688 IsMethod: false, 689 IsResolver: false, 690 } 691 692 ctx = graphql.WithFieldContext(ctx, fc) 693 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 694 ctx = rctx // use context from middleware stack in children 695 return obj.Owner, nil 696 }) 697 if err != nil { 698 ec.Error(ctx, err) 699 return graphql.Null 700 } 701 if resTmp == nil { 702 return graphql.Null 703 } 704 res := resTmp.(Being) 705 fc.Result = res 706 return ec.marshalOBeing2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeing(ctx, field.Selections, res) 707 } 708 709 func (ec *executionContext) _Animal_hair(ctx context.Context, field graphql.CollectedField, obj *Animal) (ret graphql.Marshaler) { 710 defer func() { 711 if r := recover(); r != nil { 712 ec.Error(ctx, ec.Recover(ctx, r)) 713 ret = graphql.Null 714 } 715 }() 716 fc := &graphql.FieldContext{ 717 Object: "Animal", 718 Field: field, 719 Args: nil, 720 IsMethod: false, 721 IsResolver: false, 722 } 723 724 ctx = graphql.WithFieldContext(ctx, fc) 725 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 726 ctx = rctx // use context from middleware stack in children 727 return obj.Hair, nil 728 }) 729 if err != nil { 730 ec.Error(ctx, err) 731 return graphql.Null 732 } 733 if resTmp == nil { 734 return graphql.Null 735 } 736 res := resTmp.(*BeingsHair) 737 fc.Result = res 738 return ec.marshalOBeingsHair2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeingsHair(ctx, field.Selections, res) 739 } 740 741 func (ec *executionContext) _BeingsHair_hasHair(ctx context.Context, field graphql.CollectedField, obj *BeingsHair) (ret graphql.Marshaler) { 742 defer func() { 743 if r := recover(); r != nil { 744 ec.Error(ctx, ec.Recover(ctx, r)) 745 ret = graphql.Null 746 } 747 }() 748 fc := &graphql.FieldContext{ 749 Object: "BeingsHair", 750 Field: field, 751 Args: nil, 752 IsMethod: false, 753 IsResolver: false, 754 } 755 756 ctx = graphql.WithFieldContext(ctx, fc) 757 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 758 ctx = rctx // use context from middleware stack in children 759 return obj.HasHair, nil 760 }) 761 if err != nil { 762 ec.Error(ctx, err) 763 return graphql.Null 764 } 765 if resTmp == nil { 766 if !graphql.HasFieldError(ctx, fc) { 767 ec.Errorf(ctx, "must not be null") 768 } 769 return graphql.Null 770 } 771 res := resTmp.(bool) 772 fc.Result = res 773 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 774 } 775 776 func (ec *executionContext) _Hair_color(ctx context.Context, field graphql.CollectedField, obj *Hair) (ret graphql.Marshaler) { 777 defer func() { 778 if r := recover(); r != nil { 779 ec.Error(ctx, ec.Recover(ctx, r)) 780 ret = graphql.Null 781 } 782 }() 783 fc := &graphql.FieldContext{ 784 Object: "Hair", 785 Field: field, 786 Args: nil, 787 IsMethod: false, 788 IsResolver: false, 789 } 790 791 ctx = graphql.WithFieldContext(ctx, fc) 792 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 793 ctx = rctx // use context from middleware stack in children 794 return obj.Color, nil 795 }) 796 if err != nil { 797 ec.Error(ctx, err) 798 return graphql.Null 799 } 800 if resTmp == nil { 801 return graphql.Null 802 } 803 res := resTmp.(*string) 804 fc.Result = res 805 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 806 } 807 808 func (ec *executionContext) _Query_me(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 809 defer func() { 810 if r := recover(); r != nil { 811 ec.Error(ctx, ec.Recover(ctx, r)) 812 ret = graphql.Null 813 } 814 }() 815 fc := &graphql.FieldContext{ 816 Object: "Query", 817 Field: field, 818 Args: nil, 819 IsMethod: true, 820 IsResolver: true, 821 } 822 823 ctx = graphql.WithFieldContext(ctx, fc) 824 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 825 ctx = rctx // use context from middleware stack in children 826 return ec.resolvers.Query().Me(rctx) 827 }) 828 if err != nil { 829 ec.Error(ctx, err) 830 return graphql.Null 831 } 832 if resTmp == nil { 833 return graphql.Null 834 } 835 res := resTmp.(*User) 836 fc.Result = res 837 return ec.marshalOUser2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx, field.Selections, res) 838 } 839 840 func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 841 defer func() { 842 if r := recover(); r != nil { 843 ec.Error(ctx, ec.Recover(ctx, r)) 844 ret = graphql.Null 845 } 846 }() 847 fc := &graphql.FieldContext{ 848 Object: "Query", 849 Field: field, 850 Args: nil, 851 IsMethod: true, 852 IsResolver: true, 853 } 854 855 ctx = graphql.WithFieldContext(ctx, fc) 856 rawArgs := field.ArgumentMap(ec.Variables) 857 args, err := ec.field_Query_user_args(ctx, rawArgs) 858 if err != nil { 859 ec.Error(ctx, err) 860 return graphql.Null 861 } 862 fc.Args = args 863 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 864 ctx = rctx // use context from middleware stack in children 865 return ec.resolvers.Query().User(rctx, args["id"].(*string)) 866 }) 867 if err != nil { 868 ec.Error(ctx, err) 869 return graphql.Null 870 } 871 if resTmp == nil { 872 return graphql.Null 873 } 874 res := resTmp.(*User) 875 fc.Result = res 876 return ec.marshalOUser2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx, field.Selections, res) 877 } 878 879 func (ec *executionContext) _Query_being(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 880 defer func() { 881 if r := recover(); r != nil { 882 ec.Error(ctx, ec.Recover(ctx, r)) 883 ret = graphql.Null 884 } 885 }() 886 fc := &graphql.FieldContext{ 887 Object: "Query", 888 Field: field, 889 Args: nil, 890 IsMethod: true, 891 IsResolver: true, 892 } 893 894 ctx = graphql.WithFieldContext(ctx, fc) 895 rawArgs := field.ArgumentMap(ec.Variables) 896 args, err := ec.field_Query_being_args(ctx, rawArgs) 897 if err != nil { 898 ec.Error(ctx, err) 899 return graphql.Null 900 } 901 fc.Args = args 902 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 903 ctx = rctx // use context from middleware stack in children 904 return ec.resolvers.Query().Being(rctx, args["id"].(string)) 905 }) 906 if err != nil { 907 ec.Error(ctx, err) 908 return graphql.Null 909 } 910 if resTmp == nil { 911 return graphql.Null 912 } 913 res := resTmp.(Being) 914 fc.Result = res 915 return ec.marshalOBeing2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeing(ctx, field.Selections, res) 916 } 917 918 func (ec *executionContext) _Query_beings(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 919 defer func() { 920 if r := recover(); r != nil { 921 ec.Error(ctx, ec.Recover(ctx, r)) 922 ret = graphql.Null 923 } 924 }() 925 fc := &graphql.FieldContext{ 926 Object: "Query", 927 Field: field, 928 Args: nil, 929 IsMethod: true, 930 IsResolver: true, 931 } 932 933 ctx = graphql.WithFieldContext(ctx, fc) 934 rawArgs := field.ArgumentMap(ec.Variables) 935 args, err := ec.field_Query_beings_args(ctx, rawArgs) 936 if err != nil { 937 ec.Error(ctx, err) 938 return graphql.Null 939 } 940 fc.Args = args 941 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 942 ctx = rctx // use context from middleware stack in children 943 return ec.resolvers.Query().Beings(rctx, args["ids"].([]string)) 944 }) 945 if err != nil { 946 ec.Error(ctx, err) 947 return graphql.Null 948 } 949 if resTmp == nil { 950 if !graphql.HasFieldError(ctx, fc) { 951 ec.Errorf(ctx, "must not be null") 952 } 953 return graphql.Null 954 } 955 res := resTmp.([]Being) 956 fc.Result = res 957 return ec.marshalNBeing2ᚕgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeing(ctx, field.Selections, res) 958 } 959 960 func (ec *executionContext) _Query_lotteryWinner(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 961 defer func() { 962 if r := recover(); r != nil { 963 ec.Error(ctx, ec.Recover(ctx, r)) 964 ret = graphql.Null 965 } 966 }() 967 fc := &graphql.FieldContext{ 968 Object: "Query", 969 Field: field, 970 Args: nil, 971 IsMethod: true, 972 IsResolver: true, 973 } 974 975 ctx = graphql.WithFieldContext(ctx, fc) 976 rawArgs := field.ArgumentMap(ec.Variables) 977 args, err := ec.field_Query_lotteryWinner_args(ctx, rawArgs) 978 if err != nil { 979 ec.Error(ctx, err) 980 return graphql.Null 981 } 982 fc.Args = args 983 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 984 ctx = rctx // use context from middleware stack in children 985 return ec.resolvers.Query().LotteryWinner(rctx, args["number"].(int)) 986 }) 987 if err != nil { 988 ec.Error(ctx, err) 989 return graphql.Null 990 } 991 if resTmp == nil { 992 return graphql.Null 993 } 994 res := resTmp.(Lucky) 995 fc.Result = res 996 return ec.marshalOLucky2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐLucky(ctx, field.Selections, res) 997 } 998 999 func (ec *executionContext) _Query_usersBornOn(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1000 defer func() { 1001 if r := recover(); r != nil { 1002 ec.Error(ctx, ec.Recover(ctx, r)) 1003 ret = graphql.Null 1004 } 1005 }() 1006 fc := &graphql.FieldContext{ 1007 Object: "Query", 1008 Field: field, 1009 Args: nil, 1010 IsMethod: true, 1011 IsResolver: true, 1012 } 1013 1014 ctx = graphql.WithFieldContext(ctx, fc) 1015 rawArgs := field.ArgumentMap(ec.Variables) 1016 args, err := ec.field_Query_usersBornOn_args(ctx, rawArgs) 1017 if err != nil { 1018 ec.Error(ctx, err) 1019 return graphql.Null 1020 } 1021 fc.Args = args 1022 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1023 ctx = rctx // use context from middleware stack in children 1024 return ec.resolvers.Query().UsersBornOn(rctx, args["date"].(string)) 1025 }) 1026 if err != nil { 1027 ec.Error(ctx, err) 1028 return graphql.Null 1029 } 1030 if resTmp == nil { 1031 if !graphql.HasFieldError(ctx, fc) { 1032 ec.Errorf(ctx, "must not be null") 1033 } 1034 return graphql.Null 1035 } 1036 res := resTmp.([]*User) 1037 fc.Result = res 1038 return ec.marshalNUser2ᚕᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUserᚄ(ctx, field.Selections, res) 1039 } 1040 1041 func (ec *executionContext) _Query_usersBornOnDates(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1042 defer func() { 1043 if r := recover(); r != nil { 1044 ec.Error(ctx, ec.Recover(ctx, r)) 1045 ret = graphql.Null 1046 } 1047 }() 1048 fc := &graphql.FieldContext{ 1049 Object: "Query", 1050 Field: field, 1051 Args: nil, 1052 IsMethod: true, 1053 IsResolver: true, 1054 } 1055 1056 ctx = graphql.WithFieldContext(ctx, fc) 1057 rawArgs := field.ArgumentMap(ec.Variables) 1058 args, err := ec.field_Query_usersBornOnDates_args(ctx, rawArgs) 1059 if err != nil { 1060 ec.Error(ctx, err) 1061 return graphql.Null 1062 } 1063 fc.Args = args 1064 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1065 ctx = rctx // use context from middleware stack in children 1066 return ec.resolvers.Query().UsersBornOnDates(rctx, args["dates"].([]string)) 1067 }) 1068 if err != nil { 1069 ec.Error(ctx, err) 1070 return graphql.Null 1071 } 1072 if resTmp == nil { 1073 if !graphql.HasFieldError(ctx, fc) { 1074 ec.Errorf(ctx, "must not be null") 1075 } 1076 return graphql.Null 1077 } 1078 res := resTmp.([]*User) 1079 fc.Result = res 1080 return ec.marshalNUser2ᚕᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUserᚄ(ctx, field.Selections, res) 1081 } 1082 1083 func (ec *executionContext) _Query_userSearch(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1084 defer func() { 1085 if r := recover(); r != nil { 1086 ec.Error(ctx, ec.Recover(ctx, r)) 1087 ret = graphql.Null 1088 } 1089 }() 1090 fc := &graphql.FieldContext{ 1091 Object: "Query", 1092 Field: field, 1093 Args: nil, 1094 IsMethod: true, 1095 IsResolver: true, 1096 } 1097 1098 ctx = graphql.WithFieldContext(ctx, fc) 1099 rawArgs := field.ArgumentMap(ec.Variables) 1100 args, err := ec.field_Query_userSearch_args(ctx, rawArgs) 1101 if err != nil { 1102 ec.Error(ctx, err) 1103 return graphql.Null 1104 } 1105 fc.Args = args 1106 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1107 ctx = rctx // use context from middleware stack in children 1108 return ec.resolvers.Query().UserSearch(rctx, args["birthdate"].(*string), args["id"].(*string)) 1109 }) 1110 if err != nil { 1111 ec.Error(ctx, err) 1112 return graphql.Null 1113 } 1114 if resTmp == nil { 1115 return graphql.Null 1116 } 1117 res := resTmp.([]*User) 1118 fc.Result = res 1119 return ec.marshalOUser2ᚕᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx, field.Selections, res) 1120 } 1121 1122 func (ec *executionContext) _Query_fail(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1123 defer func() { 1124 if r := recover(); r != nil { 1125 ec.Error(ctx, ec.Recover(ctx, r)) 1126 ret = graphql.Null 1127 } 1128 }() 1129 fc := &graphql.FieldContext{ 1130 Object: "Query", 1131 Field: field, 1132 Args: nil, 1133 IsMethod: true, 1134 IsResolver: true, 1135 } 1136 1137 ctx = graphql.WithFieldContext(ctx, fc) 1138 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1139 ctx = rctx // use context from middleware stack in children 1140 return ec.resolvers.Query().Fail(rctx) 1141 }) 1142 if err != nil { 1143 ec.Error(ctx, err) 1144 return graphql.Null 1145 } 1146 if resTmp == nil { 1147 return graphql.Null 1148 } 1149 res := resTmp.(*bool) 1150 fc.Result = res 1151 return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) 1152 } 1153 1154 func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1155 defer func() { 1156 if r := recover(); r != nil { 1157 ec.Error(ctx, ec.Recover(ctx, r)) 1158 ret = graphql.Null 1159 } 1160 }() 1161 fc := &graphql.FieldContext{ 1162 Object: "Query", 1163 Field: field, 1164 Args: nil, 1165 IsMethod: true, 1166 IsResolver: false, 1167 } 1168 1169 ctx = graphql.WithFieldContext(ctx, fc) 1170 rawArgs := field.ArgumentMap(ec.Variables) 1171 args, err := ec.field_Query___type_args(ctx, rawArgs) 1172 if err != nil { 1173 ec.Error(ctx, err) 1174 return graphql.Null 1175 } 1176 fc.Args = args 1177 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1178 ctx = rctx // use context from middleware stack in children 1179 return ec.introspectType(args["name"].(string)) 1180 }) 1181 if err != nil { 1182 ec.Error(ctx, err) 1183 return graphql.Null 1184 } 1185 if resTmp == nil { 1186 return graphql.Null 1187 } 1188 res := resTmp.(*introspection.Type) 1189 fc.Result = res 1190 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1191 } 1192 1193 func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 1194 defer func() { 1195 if r := recover(); r != nil { 1196 ec.Error(ctx, ec.Recover(ctx, r)) 1197 ret = graphql.Null 1198 } 1199 }() 1200 fc := &graphql.FieldContext{ 1201 Object: "Query", 1202 Field: field, 1203 Args: nil, 1204 IsMethod: true, 1205 IsResolver: false, 1206 } 1207 1208 ctx = graphql.WithFieldContext(ctx, fc) 1209 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1210 ctx = rctx // use context from middleware stack in children 1211 return ec.introspectSchema() 1212 }) 1213 if err != nil { 1214 ec.Error(ctx, err) 1215 return graphql.Null 1216 } 1217 if resTmp == nil { 1218 return graphql.Null 1219 } 1220 res := resTmp.(*introspection.Schema) 1221 fc.Result = res 1222 return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) 1223 } 1224 1225 func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *User) (ret graphql.Marshaler) { 1226 defer func() { 1227 if r := recover(); r != nil { 1228 ec.Error(ctx, ec.Recover(ctx, r)) 1229 ret = graphql.Null 1230 } 1231 }() 1232 fc := &graphql.FieldContext{ 1233 Object: "User", 1234 Field: field, 1235 Args: nil, 1236 IsMethod: false, 1237 IsResolver: false, 1238 } 1239 1240 ctx = graphql.WithFieldContext(ctx, fc) 1241 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1242 ctx = rctx // use context from middleware stack in children 1243 return obj.ID, nil 1244 }) 1245 if err != nil { 1246 ec.Error(ctx, err) 1247 return graphql.Null 1248 } 1249 if resTmp == nil { 1250 if !graphql.HasFieldError(ctx, fc) { 1251 ec.Errorf(ctx, "must not be null") 1252 } 1253 return graphql.Null 1254 } 1255 res := resTmp.(string) 1256 fc.Result = res 1257 return ec.marshalNID2string(ctx, field.Selections, res) 1258 } 1259 1260 func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *User) (ret graphql.Marshaler) { 1261 defer func() { 1262 if r := recover(); r != nil { 1263 ec.Error(ctx, ec.Recover(ctx, r)) 1264 ret = graphql.Null 1265 } 1266 }() 1267 fc := &graphql.FieldContext{ 1268 Object: "User", 1269 Field: field, 1270 Args: nil, 1271 IsMethod: false, 1272 IsResolver: false, 1273 } 1274 1275 ctx = graphql.WithFieldContext(ctx, fc) 1276 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1277 ctx = rctx // use context from middleware stack in children 1278 return obj.Name, nil 1279 }) 1280 if err != nil { 1281 ec.Error(ctx, err) 1282 return graphql.Null 1283 } 1284 if resTmp == nil { 1285 if !graphql.HasFieldError(ctx, fc) { 1286 ec.Errorf(ctx, "must not be null") 1287 } 1288 return graphql.Null 1289 } 1290 res := resTmp.(string) 1291 fc.Result = res 1292 return ec.marshalNString2string(ctx, field.Selections, res) 1293 } 1294 1295 func (ec *executionContext) _User_luckyNumber(ctx context.Context, field graphql.CollectedField, obj *User) (ret graphql.Marshaler) { 1296 defer func() { 1297 if r := recover(); r != nil { 1298 ec.Error(ctx, ec.Recover(ctx, r)) 1299 ret = graphql.Null 1300 } 1301 }() 1302 fc := &graphql.FieldContext{ 1303 Object: "User", 1304 Field: field, 1305 Args: nil, 1306 IsMethod: false, 1307 IsResolver: false, 1308 } 1309 1310 ctx = graphql.WithFieldContext(ctx, fc) 1311 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1312 ctx = rctx // use context from middleware stack in children 1313 return obj.LuckyNumber, nil 1314 }) 1315 if err != nil { 1316 ec.Error(ctx, err) 1317 return graphql.Null 1318 } 1319 if resTmp == nil { 1320 return graphql.Null 1321 } 1322 res := resTmp.(*int) 1323 fc.Result = res 1324 return ec.marshalOInt2ᚖint(ctx, field.Selections, res) 1325 } 1326 1327 func (ec *executionContext) _User_hair(ctx context.Context, field graphql.CollectedField, obj *User) (ret graphql.Marshaler) { 1328 defer func() { 1329 if r := recover(); r != nil { 1330 ec.Error(ctx, ec.Recover(ctx, r)) 1331 ret = graphql.Null 1332 } 1333 }() 1334 fc := &graphql.FieldContext{ 1335 Object: "User", 1336 Field: field, 1337 Args: nil, 1338 IsMethod: false, 1339 IsResolver: false, 1340 } 1341 1342 ctx = graphql.WithFieldContext(ctx, fc) 1343 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1344 ctx = rctx // use context from middleware stack in children 1345 return obj.Hair, nil 1346 }) 1347 if err != nil { 1348 ec.Error(ctx, err) 1349 return graphql.Null 1350 } 1351 if resTmp == nil { 1352 return graphql.Null 1353 } 1354 res := resTmp.(*Hair) 1355 fc.Result = res 1356 return ec.marshalOHair2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐHair(ctx, field.Selections, res) 1357 } 1358 1359 func (ec *executionContext) _User_birthdate(ctx context.Context, field graphql.CollectedField, obj *User) (ret graphql.Marshaler) { 1360 defer func() { 1361 if r := recover(); r != nil { 1362 ec.Error(ctx, ec.Recover(ctx, r)) 1363 ret = graphql.Null 1364 } 1365 }() 1366 fc := &graphql.FieldContext{ 1367 Object: "User", 1368 Field: field, 1369 Args: nil, 1370 IsMethod: false, 1371 IsResolver: false, 1372 } 1373 1374 ctx = graphql.WithFieldContext(ctx, fc) 1375 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1376 ctx = rctx // use context from middleware stack in children 1377 return obj.Birthdate, nil 1378 }) 1379 if err != nil { 1380 ec.Error(ctx, err) 1381 return graphql.Null 1382 } 1383 if resTmp == nil { 1384 return graphql.Null 1385 } 1386 res := resTmp.(*string) 1387 fc.Result = res 1388 return ec.marshalODate2ᚖstring(ctx, field.Selections, res) 1389 } 1390 1391 func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *User) (ret graphql.Marshaler) { 1392 defer func() { 1393 if r := recover(); r != nil { 1394 ec.Error(ctx, ec.Recover(ctx, r)) 1395 ret = graphql.Null 1396 } 1397 }() 1398 fc := &graphql.FieldContext{ 1399 Object: "User", 1400 Field: field, 1401 Args: nil, 1402 IsMethod: false, 1403 IsResolver: false, 1404 } 1405 1406 ctx = graphql.WithFieldContext(ctx, fc) 1407 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1408 ctx = rctx // use context from middleware stack in children 1409 return obj.Friends, nil 1410 }) 1411 if err != nil { 1412 ec.Error(ctx, err) 1413 return graphql.Null 1414 } 1415 if resTmp == nil { 1416 if !graphql.HasFieldError(ctx, fc) { 1417 ec.Errorf(ctx, "must not be null") 1418 } 1419 return graphql.Null 1420 } 1421 res := resTmp.([]*User) 1422 fc.Result = res 1423 return ec.marshalNUser2ᚕᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUserᚄ(ctx, field.Selections, res) 1424 } 1425 1426 func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 1427 defer func() { 1428 if r := recover(); r != nil { 1429 ec.Error(ctx, ec.Recover(ctx, r)) 1430 ret = graphql.Null 1431 } 1432 }() 1433 fc := &graphql.FieldContext{ 1434 Object: "__Directive", 1435 Field: field, 1436 Args: nil, 1437 IsMethod: false, 1438 IsResolver: false, 1439 } 1440 1441 ctx = graphql.WithFieldContext(ctx, fc) 1442 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1443 ctx = rctx // use context from middleware stack in children 1444 return obj.Name, nil 1445 }) 1446 if err != nil { 1447 ec.Error(ctx, err) 1448 return graphql.Null 1449 } 1450 if resTmp == nil { 1451 if !graphql.HasFieldError(ctx, fc) { 1452 ec.Errorf(ctx, "must not be null") 1453 } 1454 return graphql.Null 1455 } 1456 res := resTmp.(string) 1457 fc.Result = res 1458 return ec.marshalNString2string(ctx, field.Selections, res) 1459 } 1460 1461 func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 1462 defer func() { 1463 if r := recover(); r != nil { 1464 ec.Error(ctx, ec.Recover(ctx, r)) 1465 ret = graphql.Null 1466 } 1467 }() 1468 fc := &graphql.FieldContext{ 1469 Object: "__Directive", 1470 Field: field, 1471 Args: nil, 1472 IsMethod: false, 1473 IsResolver: false, 1474 } 1475 1476 ctx = graphql.WithFieldContext(ctx, fc) 1477 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1478 ctx = rctx // use context from middleware stack in children 1479 return obj.Description, nil 1480 }) 1481 if err != nil { 1482 ec.Error(ctx, err) 1483 return graphql.Null 1484 } 1485 if resTmp == nil { 1486 return graphql.Null 1487 } 1488 res := resTmp.(string) 1489 fc.Result = res 1490 return ec.marshalOString2string(ctx, field.Selections, res) 1491 } 1492 1493 func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 1494 defer func() { 1495 if r := recover(); r != nil { 1496 ec.Error(ctx, ec.Recover(ctx, r)) 1497 ret = graphql.Null 1498 } 1499 }() 1500 fc := &graphql.FieldContext{ 1501 Object: "__Directive", 1502 Field: field, 1503 Args: nil, 1504 IsMethod: false, 1505 IsResolver: false, 1506 } 1507 1508 ctx = graphql.WithFieldContext(ctx, fc) 1509 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1510 ctx = rctx // use context from middleware stack in children 1511 return obj.Locations, nil 1512 }) 1513 if err != nil { 1514 ec.Error(ctx, err) 1515 return graphql.Null 1516 } 1517 if resTmp == nil { 1518 if !graphql.HasFieldError(ctx, fc) { 1519 ec.Errorf(ctx, "must not be null") 1520 } 1521 return graphql.Null 1522 } 1523 res := resTmp.([]string) 1524 fc.Result = res 1525 return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) 1526 } 1527 1528 func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 1529 defer func() { 1530 if r := recover(); r != nil { 1531 ec.Error(ctx, ec.Recover(ctx, r)) 1532 ret = graphql.Null 1533 } 1534 }() 1535 fc := &graphql.FieldContext{ 1536 Object: "__Directive", 1537 Field: field, 1538 Args: nil, 1539 IsMethod: false, 1540 IsResolver: false, 1541 } 1542 1543 ctx = graphql.WithFieldContext(ctx, fc) 1544 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1545 ctx = rctx // use context from middleware stack in children 1546 return obj.Args, nil 1547 }) 1548 if err != nil { 1549 ec.Error(ctx, err) 1550 return graphql.Null 1551 } 1552 if resTmp == nil { 1553 if !graphql.HasFieldError(ctx, fc) { 1554 ec.Errorf(ctx, "must not be null") 1555 } 1556 return graphql.Null 1557 } 1558 res := resTmp.([]introspection.InputValue) 1559 fc.Result = res 1560 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 1561 } 1562 1563 func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1564 defer func() { 1565 if r := recover(); r != nil { 1566 ec.Error(ctx, ec.Recover(ctx, r)) 1567 ret = graphql.Null 1568 } 1569 }() 1570 fc := &graphql.FieldContext{ 1571 Object: "__EnumValue", 1572 Field: field, 1573 Args: nil, 1574 IsMethod: false, 1575 IsResolver: false, 1576 } 1577 1578 ctx = graphql.WithFieldContext(ctx, fc) 1579 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1580 ctx = rctx // use context from middleware stack in children 1581 return obj.Name, nil 1582 }) 1583 if err != nil { 1584 ec.Error(ctx, err) 1585 return graphql.Null 1586 } 1587 if resTmp == nil { 1588 if !graphql.HasFieldError(ctx, fc) { 1589 ec.Errorf(ctx, "must not be null") 1590 } 1591 return graphql.Null 1592 } 1593 res := resTmp.(string) 1594 fc.Result = res 1595 return ec.marshalNString2string(ctx, field.Selections, res) 1596 } 1597 1598 func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1599 defer func() { 1600 if r := recover(); r != nil { 1601 ec.Error(ctx, ec.Recover(ctx, r)) 1602 ret = graphql.Null 1603 } 1604 }() 1605 fc := &graphql.FieldContext{ 1606 Object: "__EnumValue", 1607 Field: field, 1608 Args: nil, 1609 IsMethod: false, 1610 IsResolver: false, 1611 } 1612 1613 ctx = graphql.WithFieldContext(ctx, fc) 1614 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1615 ctx = rctx // use context from middleware stack in children 1616 return obj.Description, nil 1617 }) 1618 if err != nil { 1619 ec.Error(ctx, err) 1620 return graphql.Null 1621 } 1622 if resTmp == nil { 1623 return graphql.Null 1624 } 1625 res := resTmp.(string) 1626 fc.Result = res 1627 return ec.marshalOString2string(ctx, field.Selections, res) 1628 } 1629 1630 func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1631 defer func() { 1632 if r := recover(); r != nil { 1633 ec.Error(ctx, ec.Recover(ctx, r)) 1634 ret = graphql.Null 1635 } 1636 }() 1637 fc := &graphql.FieldContext{ 1638 Object: "__EnumValue", 1639 Field: field, 1640 Args: nil, 1641 IsMethod: true, 1642 IsResolver: false, 1643 } 1644 1645 ctx = graphql.WithFieldContext(ctx, fc) 1646 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1647 ctx = rctx // use context from middleware stack in children 1648 return obj.IsDeprecated(), nil 1649 }) 1650 if err != nil { 1651 ec.Error(ctx, err) 1652 return graphql.Null 1653 } 1654 if resTmp == nil { 1655 if !graphql.HasFieldError(ctx, fc) { 1656 ec.Errorf(ctx, "must not be null") 1657 } 1658 return graphql.Null 1659 } 1660 res := resTmp.(bool) 1661 fc.Result = res 1662 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 1663 } 1664 1665 func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1666 defer func() { 1667 if r := recover(); r != nil { 1668 ec.Error(ctx, ec.Recover(ctx, r)) 1669 ret = graphql.Null 1670 } 1671 }() 1672 fc := &graphql.FieldContext{ 1673 Object: "__EnumValue", 1674 Field: field, 1675 Args: nil, 1676 IsMethod: true, 1677 IsResolver: false, 1678 } 1679 1680 ctx = graphql.WithFieldContext(ctx, fc) 1681 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1682 ctx = rctx // use context from middleware stack in children 1683 return obj.DeprecationReason(), nil 1684 }) 1685 if err != nil { 1686 ec.Error(ctx, err) 1687 return graphql.Null 1688 } 1689 if resTmp == nil { 1690 return graphql.Null 1691 } 1692 res := resTmp.(*string) 1693 fc.Result = res 1694 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1695 } 1696 1697 func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (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: "__Field", 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.Name, 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.marshalNString2string(ctx, field.Selections, res) 1730 } 1731 1732 func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (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: "__Field", 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.Description, nil 1751 }) 1752 if err != nil { 1753 ec.Error(ctx, err) 1754 return graphql.Null 1755 } 1756 if resTmp == nil { 1757 return graphql.Null 1758 } 1759 res := resTmp.(string) 1760 fc.Result = res 1761 return ec.marshalOString2string(ctx, field.Selections, res) 1762 } 1763 1764 func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1765 defer func() { 1766 if r := recover(); r != nil { 1767 ec.Error(ctx, ec.Recover(ctx, r)) 1768 ret = graphql.Null 1769 } 1770 }() 1771 fc := &graphql.FieldContext{ 1772 Object: "__Field", 1773 Field: field, 1774 Args: nil, 1775 IsMethod: false, 1776 IsResolver: false, 1777 } 1778 1779 ctx = graphql.WithFieldContext(ctx, fc) 1780 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1781 ctx = rctx // use context from middleware stack in children 1782 return obj.Args, nil 1783 }) 1784 if err != nil { 1785 ec.Error(ctx, err) 1786 return graphql.Null 1787 } 1788 if resTmp == nil { 1789 if !graphql.HasFieldError(ctx, fc) { 1790 ec.Errorf(ctx, "must not be null") 1791 } 1792 return graphql.Null 1793 } 1794 res := resTmp.([]introspection.InputValue) 1795 fc.Result = res 1796 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 1797 } 1798 1799 func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1800 defer func() { 1801 if r := recover(); r != nil { 1802 ec.Error(ctx, ec.Recover(ctx, r)) 1803 ret = graphql.Null 1804 } 1805 }() 1806 fc := &graphql.FieldContext{ 1807 Object: "__Field", 1808 Field: field, 1809 Args: nil, 1810 IsMethod: false, 1811 IsResolver: false, 1812 } 1813 1814 ctx = graphql.WithFieldContext(ctx, fc) 1815 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1816 ctx = rctx // use context from middleware stack in children 1817 return obj.Type, nil 1818 }) 1819 if err != nil { 1820 ec.Error(ctx, err) 1821 return graphql.Null 1822 } 1823 if resTmp == nil { 1824 if !graphql.HasFieldError(ctx, fc) { 1825 ec.Errorf(ctx, "must not be null") 1826 } 1827 return graphql.Null 1828 } 1829 res := resTmp.(*introspection.Type) 1830 fc.Result = res 1831 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1832 } 1833 1834 func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1835 defer func() { 1836 if r := recover(); r != nil { 1837 ec.Error(ctx, ec.Recover(ctx, r)) 1838 ret = graphql.Null 1839 } 1840 }() 1841 fc := &graphql.FieldContext{ 1842 Object: "__Field", 1843 Field: field, 1844 Args: nil, 1845 IsMethod: true, 1846 IsResolver: false, 1847 } 1848 1849 ctx = graphql.WithFieldContext(ctx, fc) 1850 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1851 ctx = rctx // use context from middleware stack in children 1852 return obj.IsDeprecated(), nil 1853 }) 1854 if err != nil { 1855 ec.Error(ctx, err) 1856 return graphql.Null 1857 } 1858 if resTmp == nil { 1859 if !graphql.HasFieldError(ctx, fc) { 1860 ec.Errorf(ctx, "must not be null") 1861 } 1862 return graphql.Null 1863 } 1864 res := resTmp.(bool) 1865 fc.Result = res 1866 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 1867 } 1868 1869 func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1870 defer func() { 1871 if r := recover(); r != nil { 1872 ec.Error(ctx, ec.Recover(ctx, r)) 1873 ret = graphql.Null 1874 } 1875 }() 1876 fc := &graphql.FieldContext{ 1877 Object: "__Field", 1878 Field: field, 1879 Args: nil, 1880 IsMethod: true, 1881 IsResolver: false, 1882 } 1883 1884 ctx = graphql.WithFieldContext(ctx, fc) 1885 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1886 ctx = rctx // use context from middleware stack in children 1887 return obj.DeprecationReason(), nil 1888 }) 1889 if err != nil { 1890 ec.Error(ctx, err) 1891 return graphql.Null 1892 } 1893 if resTmp == nil { 1894 return graphql.Null 1895 } 1896 res := resTmp.(*string) 1897 fc.Result = res 1898 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1899 } 1900 1901 func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1902 defer func() { 1903 if r := recover(); r != nil { 1904 ec.Error(ctx, ec.Recover(ctx, r)) 1905 ret = graphql.Null 1906 } 1907 }() 1908 fc := &graphql.FieldContext{ 1909 Object: "__InputValue", 1910 Field: field, 1911 Args: nil, 1912 IsMethod: false, 1913 IsResolver: false, 1914 } 1915 1916 ctx = graphql.WithFieldContext(ctx, fc) 1917 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1918 ctx = rctx // use context from middleware stack in children 1919 return obj.Name, nil 1920 }) 1921 if err != nil { 1922 ec.Error(ctx, err) 1923 return graphql.Null 1924 } 1925 if resTmp == nil { 1926 if !graphql.HasFieldError(ctx, fc) { 1927 ec.Errorf(ctx, "must not be null") 1928 } 1929 return graphql.Null 1930 } 1931 res := resTmp.(string) 1932 fc.Result = res 1933 return ec.marshalNString2string(ctx, field.Selections, res) 1934 } 1935 1936 func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1937 defer func() { 1938 if r := recover(); r != nil { 1939 ec.Error(ctx, ec.Recover(ctx, r)) 1940 ret = graphql.Null 1941 } 1942 }() 1943 fc := &graphql.FieldContext{ 1944 Object: "__InputValue", 1945 Field: field, 1946 Args: nil, 1947 IsMethod: false, 1948 IsResolver: false, 1949 } 1950 1951 ctx = graphql.WithFieldContext(ctx, fc) 1952 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1953 ctx = rctx // use context from middleware stack in children 1954 return obj.Description, nil 1955 }) 1956 if err != nil { 1957 ec.Error(ctx, err) 1958 return graphql.Null 1959 } 1960 if resTmp == nil { 1961 return graphql.Null 1962 } 1963 res := resTmp.(string) 1964 fc.Result = res 1965 return ec.marshalOString2string(ctx, field.Selections, res) 1966 } 1967 1968 func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1969 defer func() { 1970 if r := recover(); r != nil { 1971 ec.Error(ctx, ec.Recover(ctx, r)) 1972 ret = graphql.Null 1973 } 1974 }() 1975 fc := &graphql.FieldContext{ 1976 Object: "__InputValue", 1977 Field: field, 1978 Args: nil, 1979 IsMethod: false, 1980 IsResolver: false, 1981 } 1982 1983 ctx = graphql.WithFieldContext(ctx, fc) 1984 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1985 ctx = rctx // use context from middleware stack in children 1986 return obj.Type, nil 1987 }) 1988 if err != nil { 1989 ec.Error(ctx, err) 1990 return graphql.Null 1991 } 1992 if resTmp == nil { 1993 if !graphql.HasFieldError(ctx, fc) { 1994 ec.Errorf(ctx, "must not be null") 1995 } 1996 return graphql.Null 1997 } 1998 res := resTmp.(*introspection.Type) 1999 fc.Result = res 2000 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2001 } 2002 2003 func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (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: "__InputValue", 2012 Field: field, 2013 Args: nil, 2014 IsMethod: false, 2015 IsResolver: false, 2016 } 2017 2018 ctx = graphql.WithFieldContext(ctx, fc) 2019 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2020 ctx = rctx // use context from middleware stack in children 2021 return obj.DefaultValue, nil 2022 }) 2023 if err != nil { 2024 ec.Error(ctx, err) 2025 return graphql.Null 2026 } 2027 if resTmp == nil { 2028 return graphql.Null 2029 } 2030 res := resTmp.(*string) 2031 fc.Result = res 2032 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2033 } 2034 2035 func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2036 defer func() { 2037 if r := recover(); r != nil { 2038 ec.Error(ctx, ec.Recover(ctx, r)) 2039 ret = graphql.Null 2040 } 2041 }() 2042 fc := &graphql.FieldContext{ 2043 Object: "__Schema", 2044 Field: field, 2045 Args: nil, 2046 IsMethod: true, 2047 IsResolver: false, 2048 } 2049 2050 ctx = graphql.WithFieldContext(ctx, fc) 2051 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2052 ctx = rctx // use context from middleware stack in children 2053 return obj.Types(), nil 2054 }) 2055 if err != nil { 2056 ec.Error(ctx, err) 2057 return graphql.Null 2058 } 2059 if resTmp == nil { 2060 if !graphql.HasFieldError(ctx, fc) { 2061 ec.Errorf(ctx, "must not be null") 2062 } 2063 return graphql.Null 2064 } 2065 res := resTmp.([]introspection.Type) 2066 fc.Result = res 2067 return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 2068 } 2069 2070 func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2071 defer func() { 2072 if r := recover(); r != nil { 2073 ec.Error(ctx, ec.Recover(ctx, r)) 2074 ret = graphql.Null 2075 } 2076 }() 2077 fc := &graphql.FieldContext{ 2078 Object: "__Schema", 2079 Field: field, 2080 Args: nil, 2081 IsMethod: true, 2082 IsResolver: false, 2083 } 2084 2085 ctx = graphql.WithFieldContext(ctx, fc) 2086 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2087 ctx = rctx // use context from middleware stack in children 2088 return obj.QueryType(), nil 2089 }) 2090 if err != nil { 2091 ec.Error(ctx, err) 2092 return graphql.Null 2093 } 2094 if resTmp == nil { 2095 if !graphql.HasFieldError(ctx, fc) { 2096 ec.Errorf(ctx, "must not be null") 2097 } 2098 return graphql.Null 2099 } 2100 res := resTmp.(*introspection.Type) 2101 fc.Result = res 2102 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2103 } 2104 2105 func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2106 defer func() { 2107 if r := recover(); r != nil { 2108 ec.Error(ctx, ec.Recover(ctx, r)) 2109 ret = graphql.Null 2110 } 2111 }() 2112 fc := &graphql.FieldContext{ 2113 Object: "__Schema", 2114 Field: field, 2115 Args: nil, 2116 IsMethod: true, 2117 IsResolver: false, 2118 } 2119 2120 ctx = graphql.WithFieldContext(ctx, fc) 2121 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2122 ctx = rctx // use context from middleware stack in children 2123 return obj.MutationType(), nil 2124 }) 2125 if err != nil { 2126 ec.Error(ctx, err) 2127 return graphql.Null 2128 } 2129 if resTmp == nil { 2130 return graphql.Null 2131 } 2132 res := resTmp.(*introspection.Type) 2133 fc.Result = res 2134 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2135 } 2136 2137 func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2138 defer func() { 2139 if r := recover(); r != nil { 2140 ec.Error(ctx, ec.Recover(ctx, r)) 2141 ret = graphql.Null 2142 } 2143 }() 2144 fc := &graphql.FieldContext{ 2145 Object: "__Schema", 2146 Field: field, 2147 Args: nil, 2148 IsMethod: true, 2149 IsResolver: false, 2150 } 2151 2152 ctx = graphql.WithFieldContext(ctx, fc) 2153 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2154 ctx = rctx // use context from middleware stack in children 2155 return obj.SubscriptionType(), nil 2156 }) 2157 if err != nil { 2158 ec.Error(ctx, err) 2159 return graphql.Null 2160 } 2161 if resTmp == nil { 2162 return graphql.Null 2163 } 2164 res := resTmp.(*introspection.Type) 2165 fc.Result = res 2166 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2167 } 2168 2169 func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2170 defer func() { 2171 if r := recover(); r != nil { 2172 ec.Error(ctx, ec.Recover(ctx, r)) 2173 ret = graphql.Null 2174 } 2175 }() 2176 fc := &graphql.FieldContext{ 2177 Object: "__Schema", 2178 Field: field, 2179 Args: nil, 2180 IsMethod: true, 2181 IsResolver: false, 2182 } 2183 2184 ctx = graphql.WithFieldContext(ctx, fc) 2185 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2186 ctx = rctx // use context from middleware stack in children 2187 return obj.Directives(), nil 2188 }) 2189 if err != nil { 2190 ec.Error(ctx, err) 2191 return graphql.Null 2192 } 2193 if resTmp == nil { 2194 if !graphql.HasFieldError(ctx, fc) { 2195 ec.Errorf(ctx, "must not be null") 2196 } 2197 return graphql.Null 2198 } 2199 res := resTmp.([]introspection.Directive) 2200 fc.Result = res 2201 return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) 2202 } 2203 2204 func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2205 defer func() { 2206 if r := recover(); r != nil { 2207 ec.Error(ctx, ec.Recover(ctx, r)) 2208 ret = graphql.Null 2209 } 2210 }() 2211 fc := &graphql.FieldContext{ 2212 Object: "__Type", 2213 Field: field, 2214 Args: nil, 2215 IsMethod: true, 2216 IsResolver: false, 2217 } 2218 2219 ctx = graphql.WithFieldContext(ctx, fc) 2220 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2221 ctx = rctx // use context from middleware stack in children 2222 return obj.Kind(), nil 2223 }) 2224 if err != nil { 2225 ec.Error(ctx, err) 2226 return graphql.Null 2227 } 2228 if resTmp == nil { 2229 if !graphql.HasFieldError(ctx, fc) { 2230 ec.Errorf(ctx, "must not be null") 2231 } 2232 return graphql.Null 2233 } 2234 res := resTmp.(string) 2235 fc.Result = res 2236 return ec.marshalN__TypeKind2string(ctx, field.Selections, res) 2237 } 2238 2239 func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2240 defer func() { 2241 if r := recover(); r != nil { 2242 ec.Error(ctx, ec.Recover(ctx, r)) 2243 ret = graphql.Null 2244 } 2245 }() 2246 fc := &graphql.FieldContext{ 2247 Object: "__Type", 2248 Field: field, 2249 Args: nil, 2250 IsMethod: true, 2251 IsResolver: false, 2252 } 2253 2254 ctx = graphql.WithFieldContext(ctx, fc) 2255 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2256 ctx = rctx // use context from middleware stack in children 2257 return obj.Name(), nil 2258 }) 2259 if err != nil { 2260 ec.Error(ctx, err) 2261 return graphql.Null 2262 } 2263 if resTmp == nil { 2264 return graphql.Null 2265 } 2266 res := resTmp.(*string) 2267 fc.Result = res 2268 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2269 } 2270 2271 func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2272 defer func() { 2273 if r := recover(); r != nil { 2274 ec.Error(ctx, ec.Recover(ctx, r)) 2275 ret = graphql.Null 2276 } 2277 }() 2278 fc := &graphql.FieldContext{ 2279 Object: "__Type", 2280 Field: field, 2281 Args: nil, 2282 IsMethod: true, 2283 IsResolver: false, 2284 } 2285 2286 ctx = graphql.WithFieldContext(ctx, fc) 2287 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2288 ctx = rctx // use context from middleware stack in children 2289 return obj.Description(), nil 2290 }) 2291 if err != nil { 2292 ec.Error(ctx, err) 2293 return graphql.Null 2294 } 2295 if resTmp == nil { 2296 return graphql.Null 2297 } 2298 res := resTmp.(string) 2299 fc.Result = res 2300 return ec.marshalOString2string(ctx, field.Selections, res) 2301 } 2302 2303 func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2304 defer func() { 2305 if r := recover(); r != nil { 2306 ec.Error(ctx, ec.Recover(ctx, r)) 2307 ret = graphql.Null 2308 } 2309 }() 2310 fc := &graphql.FieldContext{ 2311 Object: "__Type", 2312 Field: field, 2313 Args: nil, 2314 IsMethod: true, 2315 IsResolver: false, 2316 } 2317 2318 ctx = graphql.WithFieldContext(ctx, fc) 2319 rawArgs := field.ArgumentMap(ec.Variables) 2320 args, err := ec.field___Type_fields_args(ctx, rawArgs) 2321 if err != nil { 2322 ec.Error(ctx, err) 2323 return graphql.Null 2324 } 2325 fc.Args = args 2326 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2327 ctx = rctx // use context from middleware stack in children 2328 return obj.Fields(args["includeDeprecated"].(bool)), nil 2329 }) 2330 if err != nil { 2331 ec.Error(ctx, err) 2332 return graphql.Null 2333 } 2334 if resTmp == nil { 2335 return graphql.Null 2336 } 2337 res := resTmp.([]introspection.Field) 2338 fc.Result = res 2339 return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) 2340 } 2341 2342 func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2343 defer func() { 2344 if r := recover(); r != nil { 2345 ec.Error(ctx, ec.Recover(ctx, r)) 2346 ret = graphql.Null 2347 } 2348 }() 2349 fc := &graphql.FieldContext{ 2350 Object: "__Type", 2351 Field: field, 2352 Args: nil, 2353 IsMethod: true, 2354 IsResolver: false, 2355 } 2356 2357 ctx = graphql.WithFieldContext(ctx, fc) 2358 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2359 ctx = rctx // use context from middleware stack in children 2360 return obj.Interfaces(), nil 2361 }) 2362 if err != nil { 2363 ec.Error(ctx, err) 2364 return graphql.Null 2365 } 2366 if resTmp == nil { 2367 return graphql.Null 2368 } 2369 res := resTmp.([]introspection.Type) 2370 fc.Result = res 2371 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 2372 } 2373 2374 func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2375 defer func() { 2376 if r := recover(); r != nil { 2377 ec.Error(ctx, ec.Recover(ctx, r)) 2378 ret = graphql.Null 2379 } 2380 }() 2381 fc := &graphql.FieldContext{ 2382 Object: "__Type", 2383 Field: field, 2384 Args: nil, 2385 IsMethod: true, 2386 IsResolver: false, 2387 } 2388 2389 ctx = graphql.WithFieldContext(ctx, fc) 2390 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2391 ctx = rctx // use context from middleware stack in children 2392 return obj.PossibleTypes(), nil 2393 }) 2394 if err != nil { 2395 ec.Error(ctx, err) 2396 return graphql.Null 2397 } 2398 if resTmp == nil { 2399 return graphql.Null 2400 } 2401 res := resTmp.([]introspection.Type) 2402 fc.Result = res 2403 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 2404 } 2405 2406 func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2407 defer func() { 2408 if r := recover(); r != nil { 2409 ec.Error(ctx, ec.Recover(ctx, r)) 2410 ret = graphql.Null 2411 } 2412 }() 2413 fc := &graphql.FieldContext{ 2414 Object: "__Type", 2415 Field: field, 2416 Args: nil, 2417 IsMethod: true, 2418 IsResolver: false, 2419 } 2420 2421 ctx = graphql.WithFieldContext(ctx, fc) 2422 rawArgs := field.ArgumentMap(ec.Variables) 2423 args, err := ec.field___Type_enumValues_args(ctx, rawArgs) 2424 if err != nil { 2425 ec.Error(ctx, err) 2426 return graphql.Null 2427 } 2428 fc.Args = args 2429 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2430 ctx = rctx // use context from middleware stack in children 2431 return obj.EnumValues(args["includeDeprecated"].(bool)), nil 2432 }) 2433 if err != nil { 2434 ec.Error(ctx, err) 2435 return graphql.Null 2436 } 2437 if resTmp == nil { 2438 return graphql.Null 2439 } 2440 res := resTmp.([]introspection.EnumValue) 2441 fc.Result = res 2442 return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) 2443 } 2444 2445 func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2446 defer func() { 2447 if r := recover(); r != nil { 2448 ec.Error(ctx, ec.Recover(ctx, r)) 2449 ret = graphql.Null 2450 } 2451 }() 2452 fc := &graphql.FieldContext{ 2453 Object: "__Type", 2454 Field: field, 2455 Args: nil, 2456 IsMethod: true, 2457 IsResolver: false, 2458 } 2459 2460 ctx = graphql.WithFieldContext(ctx, fc) 2461 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2462 ctx = rctx // use context from middleware stack in children 2463 return obj.InputFields(), nil 2464 }) 2465 if err != nil { 2466 ec.Error(ctx, err) 2467 return graphql.Null 2468 } 2469 if resTmp == nil { 2470 return graphql.Null 2471 } 2472 res := resTmp.([]introspection.InputValue) 2473 fc.Result = res 2474 return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 2475 } 2476 2477 func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2478 defer func() { 2479 if r := recover(); r != nil { 2480 ec.Error(ctx, ec.Recover(ctx, r)) 2481 ret = graphql.Null 2482 } 2483 }() 2484 fc := &graphql.FieldContext{ 2485 Object: "__Type", 2486 Field: field, 2487 Args: nil, 2488 IsMethod: true, 2489 IsResolver: false, 2490 } 2491 2492 ctx = graphql.WithFieldContext(ctx, fc) 2493 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2494 ctx = rctx // use context from middleware stack in children 2495 return obj.OfType(), nil 2496 }) 2497 if err != nil { 2498 ec.Error(ctx, err) 2499 return graphql.Null 2500 } 2501 if resTmp == nil { 2502 return graphql.Null 2503 } 2504 res := resTmp.(*introspection.Type) 2505 fc.Result = res 2506 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2507 } 2508 2509 // endregion **************************** field.gotpl ***************************** 2510 2511 // region **************************** input.gotpl ***************************** 2512 2513 // endregion **************************** input.gotpl ***************************** 2514 2515 // region ************************** interface.gotpl *************************** 2516 2517 func (ec *executionContext) _Being(ctx context.Context, sel ast.SelectionSet, obj Being) graphql.Marshaler { 2518 switch obj := (obj).(type) { 2519 case nil: 2520 return graphql.Null 2521 case User: 2522 return ec._User(ctx, sel, &obj) 2523 case *User: 2524 if obj == nil { 2525 return graphql.Null 2526 } 2527 return ec._User(ctx, sel, obj) 2528 case Animal: 2529 return ec._Animal(ctx, sel, &obj) 2530 case *Animal: 2531 if obj == nil { 2532 return graphql.Null 2533 } 2534 return ec._Animal(ctx, sel, obj) 2535 default: 2536 panic(fmt.Errorf("unexpected type %T", obj)) 2537 } 2538 } 2539 2540 func (ec *executionContext) _Lucky(ctx context.Context, sel ast.SelectionSet, obj Lucky) graphql.Marshaler { 2541 switch obj := (obj).(type) { 2542 case nil: 2543 return graphql.Null 2544 case User: 2545 return ec._User(ctx, sel, &obj) 2546 case *User: 2547 if obj == nil { 2548 return graphql.Null 2549 } 2550 return ec._User(ctx, sel, obj) 2551 default: 2552 panic(fmt.Errorf("unexpected type %T", obj)) 2553 } 2554 } 2555 2556 // endregion ************************** interface.gotpl *************************** 2557 2558 // region **************************** object.gotpl **************************** 2559 2560 var animalImplementors = []string{"Animal", "Being"} 2561 2562 func (ec *executionContext) _Animal(ctx context.Context, sel ast.SelectionSet, obj *Animal) graphql.Marshaler { 2563 fields := graphql.CollectFields(ec.OperationContext, sel, animalImplementors) 2564 2565 out := graphql.NewFieldSet(fields) 2566 var invalids uint32 2567 for i, field := range fields { 2568 switch field.Name { 2569 case "__typename": 2570 out.Values[i] = graphql.MarshalString("Animal") 2571 case "id": 2572 out.Values[i] = ec._Animal_id(ctx, field, obj) 2573 if out.Values[i] == graphql.Null { 2574 invalids++ 2575 } 2576 case "name": 2577 out.Values[i] = ec._Animal_name(ctx, field, obj) 2578 if out.Values[i] == graphql.Null { 2579 invalids++ 2580 } 2581 case "species": 2582 out.Values[i] = ec._Animal_species(ctx, field, obj) 2583 if out.Values[i] == graphql.Null { 2584 invalids++ 2585 } 2586 case "owner": 2587 out.Values[i] = ec._Animal_owner(ctx, field, obj) 2588 case "hair": 2589 out.Values[i] = ec._Animal_hair(ctx, field, obj) 2590 default: 2591 panic("unknown field " + strconv.Quote(field.Name)) 2592 } 2593 } 2594 out.Dispatch() 2595 if invalids > 0 { 2596 return graphql.Null 2597 } 2598 return out 2599 } 2600 2601 var beingsHairImplementors = []string{"BeingsHair"} 2602 2603 func (ec *executionContext) _BeingsHair(ctx context.Context, sel ast.SelectionSet, obj *BeingsHair) graphql.Marshaler { 2604 fields := graphql.CollectFields(ec.OperationContext, sel, beingsHairImplementors) 2605 2606 out := graphql.NewFieldSet(fields) 2607 var invalids uint32 2608 for i, field := range fields { 2609 switch field.Name { 2610 case "__typename": 2611 out.Values[i] = graphql.MarshalString("BeingsHair") 2612 case "hasHair": 2613 out.Values[i] = ec._BeingsHair_hasHair(ctx, field, obj) 2614 if out.Values[i] == graphql.Null { 2615 invalids++ 2616 } 2617 default: 2618 panic("unknown field " + strconv.Quote(field.Name)) 2619 } 2620 } 2621 out.Dispatch() 2622 if invalids > 0 { 2623 return graphql.Null 2624 } 2625 return out 2626 } 2627 2628 var hairImplementors = []string{"Hair"} 2629 2630 func (ec *executionContext) _Hair(ctx context.Context, sel ast.SelectionSet, obj *Hair) graphql.Marshaler { 2631 fields := graphql.CollectFields(ec.OperationContext, sel, hairImplementors) 2632 2633 out := graphql.NewFieldSet(fields) 2634 var invalids uint32 2635 for i, field := range fields { 2636 switch field.Name { 2637 case "__typename": 2638 out.Values[i] = graphql.MarshalString("Hair") 2639 case "color": 2640 out.Values[i] = ec._Hair_color(ctx, field, obj) 2641 default: 2642 panic("unknown field " + strconv.Quote(field.Name)) 2643 } 2644 } 2645 out.Dispatch() 2646 if invalids > 0 { 2647 return graphql.Null 2648 } 2649 return out 2650 } 2651 2652 var queryImplementors = []string{"Query"} 2653 2654 func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 2655 fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) 2656 2657 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ 2658 Object: "Query", 2659 }) 2660 2661 out := graphql.NewFieldSet(fields) 2662 var invalids uint32 2663 for i, field := range fields { 2664 switch field.Name { 2665 case "__typename": 2666 out.Values[i] = graphql.MarshalString("Query") 2667 case "me": 2668 field := field 2669 out.Concurrently(i, func() (res graphql.Marshaler) { 2670 defer func() { 2671 if r := recover(); r != nil { 2672 ec.Error(ctx, ec.Recover(ctx, r)) 2673 } 2674 }() 2675 res = ec._Query_me(ctx, field) 2676 return res 2677 }) 2678 case "user": 2679 field := field 2680 out.Concurrently(i, func() (res graphql.Marshaler) { 2681 defer func() { 2682 if r := recover(); r != nil { 2683 ec.Error(ctx, ec.Recover(ctx, r)) 2684 } 2685 }() 2686 res = ec._Query_user(ctx, field) 2687 return res 2688 }) 2689 case "being": 2690 field := field 2691 out.Concurrently(i, func() (res graphql.Marshaler) { 2692 defer func() { 2693 if r := recover(); r != nil { 2694 ec.Error(ctx, ec.Recover(ctx, r)) 2695 } 2696 }() 2697 res = ec._Query_being(ctx, field) 2698 return res 2699 }) 2700 case "beings": 2701 field := field 2702 out.Concurrently(i, func() (res graphql.Marshaler) { 2703 defer func() { 2704 if r := recover(); r != nil { 2705 ec.Error(ctx, ec.Recover(ctx, r)) 2706 } 2707 }() 2708 res = ec._Query_beings(ctx, field) 2709 if res == graphql.Null { 2710 atomic.AddUint32(&invalids, 1) 2711 } 2712 return res 2713 }) 2714 case "lotteryWinner": 2715 field := field 2716 out.Concurrently(i, func() (res graphql.Marshaler) { 2717 defer func() { 2718 if r := recover(); r != nil { 2719 ec.Error(ctx, ec.Recover(ctx, r)) 2720 } 2721 }() 2722 res = ec._Query_lotteryWinner(ctx, field) 2723 return res 2724 }) 2725 case "usersBornOn": 2726 field := field 2727 out.Concurrently(i, func() (res graphql.Marshaler) { 2728 defer func() { 2729 if r := recover(); r != nil { 2730 ec.Error(ctx, ec.Recover(ctx, r)) 2731 } 2732 }() 2733 res = ec._Query_usersBornOn(ctx, field) 2734 if res == graphql.Null { 2735 atomic.AddUint32(&invalids, 1) 2736 } 2737 return res 2738 }) 2739 case "usersBornOnDates": 2740 field := field 2741 out.Concurrently(i, func() (res graphql.Marshaler) { 2742 defer func() { 2743 if r := recover(); r != nil { 2744 ec.Error(ctx, ec.Recover(ctx, r)) 2745 } 2746 }() 2747 res = ec._Query_usersBornOnDates(ctx, field) 2748 if res == graphql.Null { 2749 atomic.AddUint32(&invalids, 1) 2750 } 2751 return res 2752 }) 2753 case "userSearch": 2754 field := field 2755 out.Concurrently(i, func() (res graphql.Marshaler) { 2756 defer func() { 2757 if r := recover(); r != nil { 2758 ec.Error(ctx, ec.Recover(ctx, r)) 2759 } 2760 }() 2761 res = ec._Query_userSearch(ctx, field) 2762 return res 2763 }) 2764 case "fail": 2765 field := field 2766 out.Concurrently(i, func() (res graphql.Marshaler) { 2767 defer func() { 2768 if r := recover(); r != nil { 2769 ec.Error(ctx, ec.Recover(ctx, r)) 2770 } 2771 }() 2772 res = ec._Query_fail(ctx, field) 2773 return res 2774 }) 2775 case "__type": 2776 out.Values[i] = ec._Query___type(ctx, field) 2777 case "__schema": 2778 out.Values[i] = ec._Query___schema(ctx, field) 2779 default: 2780 panic("unknown field " + strconv.Quote(field.Name)) 2781 } 2782 } 2783 out.Dispatch() 2784 if invalids > 0 { 2785 return graphql.Null 2786 } 2787 return out 2788 } 2789 2790 var userImplementors = []string{"User", "Being", "Lucky"} 2791 2792 func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *User) graphql.Marshaler { 2793 fields := graphql.CollectFields(ec.OperationContext, sel, userImplementors) 2794 2795 out := graphql.NewFieldSet(fields) 2796 var invalids uint32 2797 for i, field := range fields { 2798 switch field.Name { 2799 case "__typename": 2800 out.Values[i] = graphql.MarshalString("User") 2801 case "id": 2802 out.Values[i] = ec._User_id(ctx, field, obj) 2803 if out.Values[i] == graphql.Null { 2804 invalids++ 2805 } 2806 case "name": 2807 out.Values[i] = ec._User_name(ctx, field, obj) 2808 if out.Values[i] == graphql.Null { 2809 invalids++ 2810 } 2811 case "luckyNumber": 2812 out.Values[i] = ec._User_luckyNumber(ctx, field, obj) 2813 case "hair": 2814 out.Values[i] = ec._User_hair(ctx, field, obj) 2815 case "birthdate": 2816 out.Values[i] = ec._User_birthdate(ctx, field, obj) 2817 case "friends": 2818 out.Values[i] = ec._User_friends(ctx, field, obj) 2819 if out.Values[i] == graphql.Null { 2820 invalids++ 2821 } 2822 default: 2823 panic("unknown field " + strconv.Quote(field.Name)) 2824 } 2825 } 2826 out.Dispatch() 2827 if invalids > 0 { 2828 return graphql.Null 2829 } 2830 return out 2831 } 2832 2833 var __DirectiveImplementors = []string{"__Directive"} 2834 2835 func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { 2836 fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) 2837 2838 out := graphql.NewFieldSet(fields) 2839 var invalids uint32 2840 for i, field := range fields { 2841 switch field.Name { 2842 case "__typename": 2843 out.Values[i] = graphql.MarshalString("__Directive") 2844 case "name": 2845 out.Values[i] = ec.___Directive_name(ctx, field, obj) 2846 if out.Values[i] == graphql.Null { 2847 invalids++ 2848 } 2849 case "description": 2850 out.Values[i] = ec.___Directive_description(ctx, field, obj) 2851 case "locations": 2852 out.Values[i] = ec.___Directive_locations(ctx, field, obj) 2853 if out.Values[i] == graphql.Null { 2854 invalids++ 2855 } 2856 case "args": 2857 out.Values[i] = ec.___Directive_args(ctx, field, obj) 2858 if out.Values[i] == graphql.Null { 2859 invalids++ 2860 } 2861 default: 2862 panic("unknown field " + strconv.Quote(field.Name)) 2863 } 2864 } 2865 out.Dispatch() 2866 if invalids > 0 { 2867 return graphql.Null 2868 } 2869 return out 2870 } 2871 2872 var __EnumValueImplementors = []string{"__EnumValue"} 2873 2874 func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { 2875 fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) 2876 2877 out := graphql.NewFieldSet(fields) 2878 var invalids uint32 2879 for i, field := range fields { 2880 switch field.Name { 2881 case "__typename": 2882 out.Values[i] = graphql.MarshalString("__EnumValue") 2883 case "name": 2884 out.Values[i] = ec.___EnumValue_name(ctx, field, obj) 2885 if out.Values[i] == graphql.Null { 2886 invalids++ 2887 } 2888 case "description": 2889 out.Values[i] = ec.___EnumValue_description(ctx, field, obj) 2890 case "isDeprecated": 2891 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) 2892 if out.Values[i] == graphql.Null { 2893 invalids++ 2894 } 2895 case "deprecationReason": 2896 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) 2897 default: 2898 panic("unknown field " + strconv.Quote(field.Name)) 2899 } 2900 } 2901 out.Dispatch() 2902 if invalids > 0 { 2903 return graphql.Null 2904 } 2905 return out 2906 } 2907 2908 var __FieldImplementors = []string{"__Field"} 2909 2910 func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { 2911 fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) 2912 2913 out := graphql.NewFieldSet(fields) 2914 var invalids uint32 2915 for i, field := range fields { 2916 switch field.Name { 2917 case "__typename": 2918 out.Values[i] = graphql.MarshalString("__Field") 2919 case "name": 2920 out.Values[i] = ec.___Field_name(ctx, field, obj) 2921 if out.Values[i] == graphql.Null { 2922 invalids++ 2923 } 2924 case "description": 2925 out.Values[i] = ec.___Field_description(ctx, field, obj) 2926 case "args": 2927 out.Values[i] = ec.___Field_args(ctx, field, obj) 2928 if out.Values[i] == graphql.Null { 2929 invalids++ 2930 } 2931 case "type": 2932 out.Values[i] = ec.___Field_type(ctx, field, obj) 2933 if out.Values[i] == graphql.Null { 2934 invalids++ 2935 } 2936 case "isDeprecated": 2937 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) 2938 if out.Values[i] == graphql.Null { 2939 invalids++ 2940 } 2941 case "deprecationReason": 2942 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) 2943 default: 2944 panic("unknown field " + strconv.Quote(field.Name)) 2945 } 2946 } 2947 out.Dispatch() 2948 if invalids > 0 { 2949 return graphql.Null 2950 } 2951 return out 2952 } 2953 2954 var __InputValueImplementors = []string{"__InputValue"} 2955 2956 func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { 2957 fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) 2958 2959 out := graphql.NewFieldSet(fields) 2960 var invalids uint32 2961 for i, field := range fields { 2962 switch field.Name { 2963 case "__typename": 2964 out.Values[i] = graphql.MarshalString("__InputValue") 2965 case "name": 2966 out.Values[i] = ec.___InputValue_name(ctx, field, obj) 2967 if out.Values[i] == graphql.Null { 2968 invalids++ 2969 } 2970 case "description": 2971 out.Values[i] = ec.___InputValue_description(ctx, field, obj) 2972 case "type": 2973 out.Values[i] = ec.___InputValue_type(ctx, field, obj) 2974 if out.Values[i] == graphql.Null { 2975 invalids++ 2976 } 2977 case "defaultValue": 2978 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) 2979 default: 2980 panic("unknown field " + strconv.Quote(field.Name)) 2981 } 2982 } 2983 out.Dispatch() 2984 if invalids > 0 { 2985 return graphql.Null 2986 } 2987 return out 2988 } 2989 2990 var __SchemaImplementors = []string{"__Schema"} 2991 2992 func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { 2993 fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) 2994 2995 out := graphql.NewFieldSet(fields) 2996 var invalids uint32 2997 for i, field := range fields { 2998 switch field.Name { 2999 case "__typename": 3000 out.Values[i] = graphql.MarshalString("__Schema") 3001 case "types": 3002 out.Values[i] = ec.___Schema_types(ctx, field, obj) 3003 if out.Values[i] == graphql.Null { 3004 invalids++ 3005 } 3006 case "queryType": 3007 out.Values[i] = ec.___Schema_queryType(ctx, field, obj) 3008 if out.Values[i] == graphql.Null { 3009 invalids++ 3010 } 3011 case "mutationType": 3012 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) 3013 case "subscriptionType": 3014 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) 3015 case "directives": 3016 out.Values[i] = ec.___Schema_directives(ctx, field, obj) 3017 if out.Values[i] == graphql.Null { 3018 invalids++ 3019 } 3020 default: 3021 panic("unknown field " + strconv.Quote(field.Name)) 3022 } 3023 } 3024 out.Dispatch() 3025 if invalids > 0 { 3026 return graphql.Null 3027 } 3028 return out 3029 } 3030 3031 var __TypeImplementors = []string{"__Type"} 3032 3033 func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { 3034 fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) 3035 3036 out := graphql.NewFieldSet(fields) 3037 var invalids uint32 3038 for i, field := range fields { 3039 switch field.Name { 3040 case "__typename": 3041 out.Values[i] = graphql.MarshalString("__Type") 3042 case "kind": 3043 out.Values[i] = ec.___Type_kind(ctx, field, obj) 3044 if out.Values[i] == graphql.Null { 3045 invalids++ 3046 } 3047 case "name": 3048 out.Values[i] = ec.___Type_name(ctx, field, obj) 3049 case "description": 3050 out.Values[i] = ec.___Type_description(ctx, field, obj) 3051 case "fields": 3052 out.Values[i] = ec.___Type_fields(ctx, field, obj) 3053 case "interfaces": 3054 out.Values[i] = ec.___Type_interfaces(ctx, field, obj) 3055 case "possibleTypes": 3056 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) 3057 case "enumValues": 3058 out.Values[i] = ec.___Type_enumValues(ctx, field, obj) 3059 case "inputFields": 3060 out.Values[i] = ec.___Type_inputFields(ctx, field, obj) 3061 case "ofType": 3062 out.Values[i] = ec.___Type_ofType(ctx, field, obj) 3063 default: 3064 panic("unknown field " + strconv.Quote(field.Name)) 3065 } 3066 } 3067 out.Dispatch() 3068 if invalids > 0 { 3069 return graphql.Null 3070 } 3071 return out 3072 } 3073 3074 // endregion **************************** object.gotpl **************************** 3075 3076 // region ***************************** type.gotpl ***************************** 3077 3078 func (ec *executionContext) marshalNBeing2ᚕgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeing(ctx context.Context, sel ast.SelectionSet, v []Being) graphql.Marshaler { 3079 ret := make(graphql.Array, len(v)) 3080 var wg sync.WaitGroup 3081 isLen1 := len(v) == 1 3082 if !isLen1 { 3083 wg.Add(len(v)) 3084 } 3085 for i := range v { 3086 i := i 3087 fc := &graphql.FieldContext{ 3088 Index: &i, 3089 Result: &v[i], 3090 } 3091 ctx := graphql.WithFieldContext(ctx, fc) 3092 f := func(i int) { 3093 defer func() { 3094 if r := recover(); r != nil { 3095 ec.Error(ctx, ec.Recover(ctx, r)) 3096 ret = nil 3097 } 3098 }() 3099 if !isLen1 { 3100 defer wg.Done() 3101 } 3102 ret[i] = ec.marshalOBeing2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeing(ctx, sel, v[i]) 3103 } 3104 if isLen1 { 3105 f(i) 3106 } else { 3107 go f(i) 3108 } 3109 3110 } 3111 wg.Wait() 3112 return ret 3113 } 3114 3115 func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 3116 res, err := graphql.UnmarshalBoolean(v) 3117 return res, graphql.ErrorOnPath(ctx, err) 3118 } 3119 3120 func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 3121 res := graphql.MarshalBoolean(v) 3122 if res == graphql.Null { 3123 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3124 ec.Errorf(ctx, "must not be null") 3125 } 3126 } 3127 return res 3128 } 3129 3130 func (ec *executionContext) unmarshalNDate2string(ctx context.Context, v interface{}) (string, error) { 3131 res, err := graphql.UnmarshalString(v) 3132 return res, graphql.ErrorOnPath(ctx, err) 3133 } 3134 3135 func (ec *executionContext) marshalNDate2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3136 res := graphql.MarshalString(v) 3137 if res == graphql.Null { 3138 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3139 ec.Errorf(ctx, "must not be null") 3140 } 3141 } 3142 return res 3143 } 3144 3145 func (ec *executionContext) unmarshalNDate2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { 3146 var vSlice []interface{} 3147 if v != nil { 3148 if tmp1, ok := v.([]interface{}); ok { 3149 vSlice = tmp1 3150 } else { 3151 vSlice = []interface{}{v} 3152 } 3153 } 3154 var err error 3155 res := make([]string, len(vSlice)) 3156 for i := range vSlice { 3157 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) 3158 res[i], err = ec.unmarshalNDate2string(ctx, vSlice[i]) 3159 if err != nil { 3160 return nil, err 3161 } 3162 } 3163 return res, nil 3164 } 3165 3166 func (ec *executionContext) marshalNDate2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { 3167 ret := make(graphql.Array, len(v)) 3168 for i := range v { 3169 ret[i] = ec.marshalNDate2string(ctx, sel, v[i]) 3170 } 3171 3172 return ret 3173 } 3174 3175 func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { 3176 res, err := graphql.UnmarshalID(v) 3177 return res, graphql.ErrorOnPath(ctx, err) 3178 } 3179 3180 func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3181 res := graphql.MarshalID(v) 3182 if res == graphql.Null { 3183 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3184 ec.Errorf(ctx, "must not be null") 3185 } 3186 } 3187 return res 3188 } 3189 3190 func (ec *executionContext) unmarshalNID2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { 3191 var vSlice []interface{} 3192 if v != nil { 3193 if tmp1, ok := v.([]interface{}); ok { 3194 vSlice = tmp1 3195 } else { 3196 vSlice = []interface{}{v} 3197 } 3198 } 3199 var err error 3200 res := make([]string, len(vSlice)) 3201 for i := range vSlice { 3202 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) 3203 res[i], err = ec.unmarshalNID2string(ctx, vSlice[i]) 3204 if err != nil { 3205 return nil, err 3206 } 3207 } 3208 return res, nil 3209 } 3210 3211 func (ec *executionContext) marshalNID2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { 3212 ret := make(graphql.Array, len(v)) 3213 for i := range v { 3214 ret[i] = ec.marshalNID2string(ctx, sel, v[i]) 3215 } 3216 3217 return ret 3218 } 3219 3220 func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { 3221 res, err := graphql.UnmarshalInt(v) 3222 return res, graphql.ErrorOnPath(ctx, err) 3223 } 3224 3225 func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { 3226 res := graphql.MarshalInt(v) 3227 if res == graphql.Null { 3228 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3229 ec.Errorf(ctx, "must not be null") 3230 } 3231 } 3232 return res 3233 } 3234 3235 func (ec *executionContext) unmarshalNSpecies2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐSpecies(ctx context.Context, v interface{}) (Species, error) { 3236 var res Species 3237 err := res.UnmarshalGQL(v) 3238 return res, graphql.ErrorOnPath(ctx, err) 3239 } 3240 3241 func (ec *executionContext) marshalNSpecies2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐSpecies(ctx context.Context, sel ast.SelectionSet, v Species) graphql.Marshaler { 3242 return v 3243 } 3244 3245 func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { 3246 res, err := graphql.UnmarshalString(v) 3247 return res, graphql.ErrorOnPath(ctx, err) 3248 } 3249 3250 func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3251 res := graphql.MarshalString(v) 3252 if res == graphql.Null { 3253 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3254 ec.Errorf(ctx, "must not be null") 3255 } 3256 } 3257 return res 3258 } 3259 3260 func (ec *executionContext) marshalNUser2ᚕᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUserᚄ(ctx context.Context, sel ast.SelectionSet, v []*User) graphql.Marshaler { 3261 ret := make(graphql.Array, len(v)) 3262 var wg sync.WaitGroup 3263 isLen1 := len(v) == 1 3264 if !isLen1 { 3265 wg.Add(len(v)) 3266 } 3267 for i := range v { 3268 i := i 3269 fc := &graphql.FieldContext{ 3270 Index: &i, 3271 Result: &v[i], 3272 } 3273 ctx := graphql.WithFieldContext(ctx, fc) 3274 f := func(i int) { 3275 defer func() { 3276 if r := recover(); r != nil { 3277 ec.Error(ctx, ec.Recover(ctx, r)) 3278 ret = nil 3279 } 3280 }() 3281 if !isLen1 { 3282 defer wg.Done() 3283 } 3284 ret[i] = ec.marshalNUser2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx, sel, v[i]) 3285 } 3286 if isLen1 { 3287 f(i) 3288 } else { 3289 go f(i) 3290 } 3291 3292 } 3293 wg.Wait() 3294 return ret 3295 } 3296 3297 func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx context.Context, sel ast.SelectionSet, v *User) graphql.Marshaler { 3298 if v == nil { 3299 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3300 ec.Errorf(ctx, "must not be null") 3301 } 3302 return graphql.Null 3303 } 3304 return ec._User(ctx, sel, v) 3305 } 3306 3307 func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { 3308 return ec.___Directive(ctx, sel, &v) 3309 } 3310 3311 func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { 3312 ret := make(graphql.Array, len(v)) 3313 var wg sync.WaitGroup 3314 isLen1 := len(v) == 1 3315 if !isLen1 { 3316 wg.Add(len(v)) 3317 } 3318 for i := range v { 3319 i := i 3320 fc := &graphql.FieldContext{ 3321 Index: &i, 3322 Result: &v[i], 3323 } 3324 ctx := graphql.WithFieldContext(ctx, fc) 3325 f := func(i int) { 3326 defer func() { 3327 if r := recover(); r != nil { 3328 ec.Error(ctx, ec.Recover(ctx, r)) 3329 ret = nil 3330 } 3331 }() 3332 if !isLen1 { 3333 defer wg.Done() 3334 } 3335 ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) 3336 } 3337 if isLen1 { 3338 f(i) 3339 } else { 3340 go f(i) 3341 } 3342 3343 } 3344 wg.Wait() 3345 return ret 3346 } 3347 3348 func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { 3349 res, err := graphql.UnmarshalString(v) 3350 return res, graphql.ErrorOnPath(ctx, err) 3351 } 3352 3353 func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3354 res := graphql.MarshalString(v) 3355 if res == graphql.Null { 3356 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3357 ec.Errorf(ctx, "must not be null") 3358 } 3359 } 3360 return res 3361 } 3362 3363 func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { 3364 var vSlice []interface{} 3365 if v != nil { 3366 if tmp1, ok := v.([]interface{}); ok { 3367 vSlice = tmp1 3368 } else { 3369 vSlice = []interface{}{v} 3370 } 3371 } 3372 var err error 3373 res := make([]string, len(vSlice)) 3374 for i := range vSlice { 3375 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) 3376 res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) 3377 if err != nil { 3378 return nil, err 3379 } 3380 } 3381 return res, nil 3382 } 3383 3384 func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { 3385 ret := make(graphql.Array, len(v)) 3386 var wg sync.WaitGroup 3387 isLen1 := len(v) == 1 3388 if !isLen1 { 3389 wg.Add(len(v)) 3390 } 3391 for i := range v { 3392 i := i 3393 fc := &graphql.FieldContext{ 3394 Index: &i, 3395 Result: &v[i], 3396 } 3397 ctx := graphql.WithFieldContext(ctx, fc) 3398 f := func(i int) { 3399 defer func() { 3400 if r := recover(); r != nil { 3401 ec.Error(ctx, ec.Recover(ctx, r)) 3402 ret = nil 3403 } 3404 }() 3405 if !isLen1 { 3406 defer wg.Done() 3407 } 3408 ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) 3409 } 3410 if isLen1 { 3411 f(i) 3412 } else { 3413 go f(i) 3414 } 3415 3416 } 3417 wg.Wait() 3418 return ret 3419 } 3420 3421 func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { 3422 return ec.___EnumValue(ctx, sel, &v) 3423 } 3424 3425 func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { 3426 return ec.___Field(ctx, sel, &v) 3427 } 3428 3429 func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { 3430 return ec.___InputValue(ctx, sel, &v) 3431 } 3432 3433 func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 3434 ret := make(graphql.Array, len(v)) 3435 var wg sync.WaitGroup 3436 isLen1 := len(v) == 1 3437 if !isLen1 { 3438 wg.Add(len(v)) 3439 } 3440 for i := range v { 3441 i := i 3442 fc := &graphql.FieldContext{ 3443 Index: &i, 3444 Result: &v[i], 3445 } 3446 ctx := graphql.WithFieldContext(ctx, fc) 3447 f := func(i int) { 3448 defer func() { 3449 if r := recover(); r != nil { 3450 ec.Error(ctx, ec.Recover(ctx, r)) 3451 ret = nil 3452 } 3453 }() 3454 if !isLen1 { 3455 defer wg.Done() 3456 } 3457 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 3458 } 3459 if isLen1 { 3460 f(i) 3461 } else { 3462 go f(i) 3463 } 3464 3465 } 3466 wg.Wait() 3467 return ret 3468 } 3469 3470 func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { 3471 return ec.___Type(ctx, sel, &v) 3472 } 3473 3474 func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 3475 ret := make(graphql.Array, len(v)) 3476 var wg sync.WaitGroup 3477 isLen1 := len(v) == 1 3478 if !isLen1 { 3479 wg.Add(len(v)) 3480 } 3481 for i := range v { 3482 i := i 3483 fc := &graphql.FieldContext{ 3484 Index: &i, 3485 Result: &v[i], 3486 } 3487 ctx := graphql.WithFieldContext(ctx, fc) 3488 f := func(i int) { 3489 defer func() { 3490 if r := recover(); r != nil { 3491 ec.Error(ctx, ec.Recover(ctx, r)) 3492 ret = nil 3493 } 3494 }() 3495 if !isLen1 { 3496 defer wg.Done() 3497 } 3498 ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 3499 } 3500 if isLen1 { 3501 f(i) 3502 } else { 3503 go f(i) 3504 } 3505 3506 } 3507 wg.Wait() 3508 return ret 3509 } 3510 3511 func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 3512 if v == nil { 3513 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3514 ec.Errorf(ctx, "must not be null") 3515 } 3516 return graphql.Null 3517 } 3518 return ec.___Type(ctx, sel, v) 3519 } 3520 3521 func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { 3522 res, err := graphql.UnmarshalString(v) 3523 return res, graphql.ErrorOnPath(ctx, err) 3524 } 3525 3526 func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3527 res := graphql.MarshalString(v) 3528 if res == graphql.Null { 3529 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3530 ec.Errorf(ctx, "must not be null") 3531 } 3532 } 3533 return res 3534 } 3535 3536 func (ec *executionContext) marshalOBeing2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeing(ctx context.Context, sel ast.SelectionSet, v Being) graphql.Marshaler { 3537 if v == nil { 3538 return graphql.Null 3539 } 3540 return ec._Being(ctx, sel, v) 3541 } 3542 3543 func (ec *executionContext) marshalOBeingsHair2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐBeingsHair(ctx context.Context, sel ast.SelectionSet, v *BeingsHair) graphql.Marshaler { 3544 if v == nil { 3545 return graphql.Null 3546 } 3547 return ec._BeingsHair(ctx, sel, v) 3548 } 3549 3550 func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 3551 res, err := graphql.UnmarshalBoolean(v) 3552 return res, graphql.ErrorOnPath(ctx, err) 3553 } 3554 3555 func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 3556 return graphql.MarshalBoolean(v) 3557 } 3558 3559 func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { 3560 if v == nil { 3561 return nil, nil 3562 } 3563 res, err := graphql.UnmarshalBoolean(v) 3564 return &res, graphql.ErrorOnPath(ctx, err) 3565 } 3566 3567 func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { 3568 if v == nil { 3569 return graphql.Null 3570 } 3571 return graphql.MarshalBoolean(*v) 3572 } 3573 3574 func (ec *executionContext) unmarshalODate2ᚖstring(ctx context.Context, v interface{}) (*string, error) { 3575 if v == nil { 3576 return nil, nil 3577 } 3578 res, err := graphql.UnmarshalString(v) 3579 return &res, graphql.ErrorOnPath(ctx, err) 3580 } 3581 3582 func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { 3583 if v == nil { 3584 return graphql.Null 3585 } 3586 return graphql.MarshalString(*v) 3587 } 3588 3589 func (ec *executionContext) marshalOHair2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐHair(ctx context.Context, sel ast.SelectionSet, v *Hair) graphql.Marshaler { 3590 if v == nil { 3591 return graphql.Null 3592 } 3593 return ec._Hair(ctx, sel, v) 3594 } 3595 3596 func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v interface{}) (*string, error) { 3597 if v == nil { 3598 return nil, nil 3599 } 3600 res, err := graphql.UnmarshalID(v) 3601 return &res, graphql.ErrorOnPath(ctx, err) 3602 } 3603 3604 func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { 3605 if v == nil { 3606 return graphql.Null 3607 } 3608 return graphql.MarshalID(*v) 3609 } 3610 3611 func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { 3612 if v == nil { 3613 return nil, nil 3614 } 3615 res, err := graphql.UnmarshalInt(v) 3616 return &res, graphql.ErrorOnPath(ctx, err) 3617 } 3618 3619 func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { 3620 if v == nil { 3621 return graphql.Null 3622 } 3623 return graphql.MarshalInt(*v) 3624 } 3625 3626 func (ec *executionContext) marshalOLucky2githubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐLucky(ctx context.Context, sel ast.SelectionSet, v Lucky) graphql.Marshaler { 3627 if v == nil { 3628 return graphql.Null 3629 } 3630 return ec._Lucky(ctx, sel, v) 3631 } 3632 3633 func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { 3634 res, err := graphql.UnmarshalString(v) 3635 return res, graphql.ErrorOnPath(ctx, err) 3636 } 3637 3638 func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3639 return graphql.MarshalString(v) 3640 } 3641 3642 func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { 3643 if v == nil { 3644 return nil, nil 3645 } 3646 res, err := graphql.UnmarshalString(v) 3647 return &res, graphql.ErrorOnPath(ctx, err) 3648 } 3649 3650 func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { 3651 if v == nil { 3652 return graphql.Null 3653 } 3654 return graphql.MarshalString(*v) 3655 } 3656 3657 func (ec *executionContext) marshalOUser2ᚕᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx context.Context, sel ast.SelectionSet, v []*User) graphql.Marshaler { 3658 if v == nil { 3659 return graphql.Null 3660 } 3661 ret := make(graphql.Array, len(v)) 3662 var wg sync.WaitGroup 3663 isLen1 := len(v) == 1 3664 if !isLen1 { 3665 wg.Add(len(v)) 3666 } 3667 for i := range v { 3668 i := i 3669 fc := &graphql.FieldContext{ 3670 Index: &i, 3671 Result: &v[i], 3672 } 3673 ctx := graphql.WithFieldContext(ctx, fc) 3674 f := func(i int) { 3675 defer func() { 3676 if r := recover(); r != nil { 3677 ec.Error(ctx, ec.Recover(ctx, r)) 3678 ret = nil 3679 } 3680 }() 3681 if !isLen1 { 3682 defer wg.Done() 3683 } 3684 ret[i] = ec.marshalOUser2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx, sel, v[i]) 3685 } 3686 if isLen1 { 3687 f(i) 3688 } else { 3689 go f(i) 3690 } 3691 3692 } 3693 wg.Wait() 3694 return ret 3695 } 3696 3697 func (ec *executionContext) marshalOUser2ᚖgithubᚗcomᚋKhanᚋgenqlientᚋinternalᚋintegrationᚋserverᚐUser(ctx context.Context, sel ast.SelectionSet, v *User) graphql.Marshaler { 3698 if v == nil { 3699 return graphql.Null 3700 } 3701 return ec._User(ctx, sel, v) 3702 } 3703 3704 func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { 3705 if v == nil { 3706 return graphql.Null 3707 } 3708 ret := make(graphql.Array, len(v)) 3709 var wg sync.WaitGroup 3710 isLen1 := len(v) == 1 3711 if !isLen1 { 3712 wg.Add(len(v)) 3713 } 3714 for i := range v { 3715 i := i 3716 fc := &graphql.FieldContext{ 3717 Index: &i, 3718 Result: &v[i], 3719 } 3720 ctx := graphql.WithFieldContext(ctx, fc) 3721 f := func(i int) { 3722 defer func() { 3723 if r := recover(); r != nil { 3724 ec.Error(ctx, ec.Recover(ctx, r)) 3725 ret = nil 3726 } 3727 }() 3728 if !isLen1 { 3729 defer wg.Done() 3730 } 3731 ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) 3732 } 3733 if isLen1 { 3734 f(i) 3735 } else { 3736 go f(i) 3737 } 3738 3739 } 3740 wg.Wait() 3741 return ret 3742 } 3743 3744 func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { 3745 if v == nil { 3746 return graphql.Null 3747 } 3748 ret := make(graphql.Array, len(v)) 3749 var wg sync.WaitGroup 3750 isLen1 := len(v) == 1 3751 if !isLen1 { 3752 wg.Add(len(v)) 3753 } 3754 for i := range v { 3755 i := i 3756 fc := &graphql.FieldContext{ 3757 Index: &i, 3758 Result: &v[i], 3759 } 3760 ctx := graphql.WithFieldContext(ctx, fc) 3761 f := func(i int) { 3762 defer func() { 3763 if r := recover(); r != nil { 3764 ec.Error(ctx, ec.Recover(ctx, r)) 3765 ret = nil 3766 } 3767 }() 3768 if !isLen1 { 3769 defer wg.Done() 3770 } 3771 ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) 3772 } 3773 if isLen1 { 3774 f(i) 3775 } else { 3776 go f(i) 3777 } 3778 3779 } 3780 wg.Wait() 3781 return ret 3782 } 3783 3784 func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 3785 if v == nil { 3786 return graphql.Null 3787 } 3788 ret := make(graphql.Array, len(v)) 3789 var wg sync.WaitGroup 3790 isLen1 := len(v) == 1 3791 if !isLen1 { 3792 wg.Add(len(v)) 3793 } 3794 for i := range v { 3795 i := i 3796 fc := &graphql.FieldContext{ 3797 Index: &i, 3798 Result: &v[i], 3799 } 3800 ctx := graphql.WithFieldContext(ctx, fc) 3801 f := func(i int) { 3802 defer func() { 3803 if r := recover(); r != nil { 3804 ec.Error(ctx, ec.Recover(ctx, r)) 3805 ret = nil 3806 } 3807 }() 3808 if !isLen1 { 3809 defer wg.Done() 3810 } 3811 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 3812 } 3813 if isLen1 { 3814 f(i) 3815 } else { 3816 go f(i) 3817 } 3818 3819 } 3820 wg.Wait() 3821 return ret 3822 } 3823 3824 func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { 3825 if v == nil { 3826 return graphql.Null 3827 } 3828 return ec.___Schema(ctx, sel, v) 3829 } 3830 3831 func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 3832 if v == nil { 3833 return graphql.Null 3834 } 3835 ret := make(graphql.Array, len(v)) 3836 var wg sync.WaitGroup 3837 isLen1 := len(v) == 1 3838 if !isLen1 { 3839 wg.Add(len(v)) 3840 } 3841 for i := range v { 3842 i := i 3843 fc := &graphql.FieldContext{ 3844 Index: &i, 3845 Result: &v[i], 3846 } 3847 ctx := graphql.WithFieldContext(ctx, fc) 3848 f := func(i int) { 3849 defer func() { 3850 if r := recover(); r != nil { 3851 ec.Error(ctx, ec.Recover(ctx, r)) 3852 ret = nil 3853 } 3854 }() 3855 if !isLen1 { 3856 defer wg.Done() 3857 } 3858 ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 3859 } 3860 if isLen1 { 3861 f(i) 3862 } else { 3863 go f(i) 3864 } 3865 3866 } 3867 wg.Wait() 3868 return ret 3869 } 3870 3871 func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 3872 if v == nil { 3873 return graphql.Null 3874 } 3875 return ec.___Type(ctx, sel, v) 3876 } 3877 3878 // endregion ***************************** type.gotpl *****************************