github.com/plages-ai/gqlgen@v0.7.2/codegen/testserver/generated.go (about) 1 // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. 2 3 package testserver 4 5 import ( 6 "bytes" 7 "context" 8 "errors" 9 "fmt" 10 "strconv" 11 "sync" 12 13 introspection1 "github.com/99designs/gqlgen/codegen/testserver/introspection" 14 "github.com/99designs/gqlgen/codegen/testserver/invalid-packagename" 15 "github.com/99designs/gqlgen/graphql" 16 "github.com/99designs/gqlgen/graphql/introspection" 17 "github.com/vektah/gqlparser" 18 "github.com/vektah/gqlparser/ast" 19 ) 20 21 // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. 22 func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { 23 return &executableSchema{ 24 resolvers: cfg.Resolvers, 25 directives: cfg.Directives, 26 complexity: cfg.Complexity, 27 } 28 } 29 30 type Config struct { 31 Resolvers ResolverRoot 32 Directives DirectiveRoot 33 Complexity ComplexityRoot 34 } 35 36 type ResolverRoot interface { 37 ForcedResolver() ForcedResolverResolver 38 ModelMethods() ModelMethodsResolver 39 Query() QueryResolver 40 Subscription() SubscriptionResolver 41 User() UserResolver 42 } 43 44 type DirectiveRoot struct { 45 } 46 47 type ComplexityRoot struct { 48 Circle struct { 49 Radius func(childComplexity int) int 50 Area func(childComplexity int) int 51 } 52 53 EmbeddedPointer struct { 54 Id func(childComplexity int) int 55 Title func(childComplexity int) int 56 } 57 58 Error struct { 59 Id func(childComplexity int) int 60 ErrorOnNonRequiredField func(childComplexity int) int 61 ErrorOnRequiredField func(childComplexity int) int 62 NilOnRequiredField func(childComplexity int) int 63 } 64 65 ForcedResolver struct { 66 Field func(childComplexity int) int 67 } 68 69 InnerObject struct { 70 Id func(childComplexity int) int 71 } 72 73 InvalidIdentifier struct { 74 Id func(childComplexity int) int 75 } 76 77 It struct { 78 Id func(childComplexity int) int 79 } 80 81 ModelMethods struct { 82 ResolverField func(childComplexity int) int 83 NoContext func(childComplexity int) int 84 WithContext func(childComplexity int) int 85 } 86 87 OuterObject struct { 88 Inner func(childComplexity int) int 89 } 90 91 Query struct { 92 InvalidIdentifier func(childComplexity int) int 93 Collision func(childComplexity int) int 94 MapInput func(childComplexity int, input *map[string]interface{}) int 95 Recursive func(childComplexity int, input *RecursiveInputSlice) int 96 NestedInputs func(childComplexity int, input [][]*OuterInput) int 97 NestedOutputs func(childComplexity int) int 98 Keywords func(childComplexity int, input *Keywords) int 99 Shapes func(childComplexity int) int 100 ErrorBubble func(childComplexity int) int 101 ModelMethods func(childComplexity int) int 102 Valid func(childComplexity int) int 103 User func(childComplexity int, id int) int 104 NullableArg func(childComplexity int, arg *int) int 105 KeywordArgs func(childComplexity int, breakArg string, defaultArg string, funcArg string, interfaceArg string, selectArg string, caseArg string, deferArg string, goArg string, mapArg string, structArg string, chanArg string, elseArg string, gotoArg string, packageArg string, switchArg string, constArg string, fallthroughArg string, ifArg string, rangeArg string, typeArg string, continueArg string, forArg string, importArg string, returnArg string, varArg string) int 106 } 107 108 Rectangle struct { 109 Length func(childComplexity int) int 110 Width func(childComplexity int) int 111 Area func(childComplexity int) int 112 } 113 114 Subscription struct { 115 Updated func(childComplexity int) int 116 InitPayload func(childComplexity int) int 117 } 118 119 User struct { 120 Id func(childComplexity int) int 121 Friends func(childComplexity int) int 122 } 123 } 124 125 type ForcedResolverResolver interface { 126 Field(ctx context.Context, obj *ForcedResolver) (*Circle, error) 127 } 128 type ModelMethodsResolver interface { 129 ResolverField(ctx context.Context, obj *ModelMethods) (bool, error) 130 } 131 type QueryResolver interface { 132 InvalidIdentifier(ctx context.Context) (*invalid_packagename.InvalidIdentifier, error) 133 Collision(ctx context.Context) (*introspection1.It, error) 134 MapInput(ctx context.Context, input *map[string]interface{}) (*bool, error) 135 Recursive(ctx context.Context, input *RecursiveInputSlice) (*bool, error) 136 NestedInputs(ctx context.Context, input [][]*OuterInput) (*bool, error) 137 NestedOutputs(ctx context.Context) ([][]*OuterObject, error) 138 Keywords(ctx context.Context, input *Keywords) (bool, error) 139 Shapes(ctx context.Context) ([]*Shape, error) 140 ErrorBubble(ctx context.Context) (*Error, error) 141 ModelMethods(ctx context.Context) (*ModelMethods, error) 142 Valid(ctx context.Context) (string, error) 143 User(ctx context.Context, id int) (User, error) 144 NullableArg(ctx context.Context, arg *int) (*string, error) 145 KeywordArgs(ctx context.Context, breakArg string, defaultArg string, funcArg string, interfaceArg string, selectArg string, caseArg string, deferArg string, goArg string, mapArg string, structArg string, chanArg string, elseArg string, gotoArg string, packageArg string, switchArg string, constArg string, fallthroughArg string, ifArg string, rangeArg string, typeArg string, continueArg string, forArg string, importArg string, returnArg string, varArg string) (bool, error) 146 } 147 type SubscriptionResolver interface { 148 Updated(ctx context.Context) (<-chan string, error) 149 InitPayload(ctx context.Context) (<-chan string, error) 150 } 151 type UserResolver interface { 152 Friends(ctx context.Context, obj *User) ([]User, error) 153 } 154 155 func field_Query_mapInput_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 156 args := map[string]interface{}{} 157 var arg0 *map[string]interface{} 158 if tmp, ok := rawArgs["input"]; ok { 159 var err error 160 var ptr1 map[string]interface{} 161 if tmp != nil { 162 ptr1 = tmp.(map[string]interface{}) 163 arg0 = &ptr1 164 } 165 166 if err != nil { 167 return nil, err 168 } 169 } 170 args["input"] = arg0 171 return args, nil 172 173 } 174 175 func field_Query_recursive_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 176 args := map[string]interface{}{} 177 var arg0 *RecursiveInputSlice 178 if tmp, ok := rawArgs["input"]; ok { 179 var err error 180 var ptr1 RecursiveInputSlice 181 if tmp != nil { 182 ptr1, err = UnmarshalRecursiveInputSlice(tmp) 183 arg0 = &ptr1 184 } 185 186 if err != nil { 187 return nil, err 188 } 189 } 190 args["input"] = arg0 191 return args, nil 192 193 } 194 195 func field_Query_nestedInputs_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 196 args := map[string]interface{}{} 197 var arg0 [][]*OuterInput 198 if tmp, ok := rawArgs["input"]; ok { 199 var err error 200 var rawIf1 []interface{} 201 if tmp != nil { 202 if tmp1, ok := tmp.([]interface{}); ok { 203 rawIf1 = tmp1 204 } else { 205 rawIf1 = []interface{}{tmp} 206 } 207 } 208 arg0 = make([][]*OuterInput, len(rawIf1)) 209 for idx1 := range rawIf1 { 210 var rawIf2 []interface{} 211 if rawIf1[idx1] != nil { 212 if tmp1, ok := rawIf1[idx1].([]interface{}); ok { 213 rawIf2 = tmp1 214 } else { 215 rawIf2 = []interface{}{rawIf1[idx1]} 216 } 217 } 218 arg0[idx1] = make([]*OuterInput, len(rawIf2)) 219 for idx2 := range rawIf2 { 220 var ptr3 OuterInput 221 if rawIf2[idx2] != nil { 222 ptr3, err = UnmarshalOuterInput(rawIf2[idx2]) 223 arg0[idx1][idx2] = &ptr3 224 } 225 } 226 } 227 if err != nil { 228 return nil, err 229 } 230 } 231 args["input"] = arg0 232 return args, nil 233 234 } 235 236 func field_Query_keywords_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 237 args := map[string]interface{}{} 238 var arg0 *Keywords 239 if tmp, ok := rawArgs["input"]; ok { 240 var err error 241 var ptr1 Keywords 242 if tmp != nil { 243 ptr1, err = UnmarshalKeywords(tmp) 244 arg0 = &ptr1 245 } 246 247 if err != nil { 248 return nil, err 249 } 250 } 251 args["input"] = arg0 252 return args, nil 253 254 } 255 256 func field_Query_user_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 257 args := map[string]interface{}{} 258 var arg0 int 259 if tmp, ok := rawArgs["id"]; ok { 260 var err error 261 arg0, err = graphql.UnmarshalInt(tmp) 262 if err != nil { 263 return nil, err 264 } 265 } 266 args["id"] = arg0 267 return args, nil 268 269 } 270 271 func field_Query_nullableArg_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 272 args := map[string]interface{}{} 273 var arg0 *int 274 if tmp, ok := rawArgs["arg"]; ok { 275 var err error 276 var ptr1 int 277 if tmp != nil { 278 ptr1, err = graphql.UnmarshalInt(tmp) 279 arg0 = &ptr1 280 } 281 282 if err != nil { 283 return nil, err 284 } 285 } 286 args["arg"] = arg0 287 return args, nil 288 289 } 290 291 func field_Query_keywordArgs_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 292 args := map[string]interface{}{} 293 var arg0 string 294 if tmp, ok := rawArgs["break"]; ok { 295 var err error 296 arg0, err = graphql.UnmarshalString(tmp) 297 if err != nil { 298 return nil, err 299 } 300 } 301 args["break"] = arg0 302 var arg1 string 303 if tmp, ok := rawArgs["default"]; ok { 304 var err error 305 arg1, err = graphql.UnmarshalString(tmp) 306 if err != nil { 307 return nil, err 308 } 309 } 310 args["default"] = arg1 311 var arg2 string 312 if tmp, ok := rawArgs["func"]; ok { 313 var err error 314 arg2, err = graphql.UnmarshalString(tmp) 315 if err != nil { 316 return nil, err 317 } 318 } 319 args["func"] = arg2 320 var arg3 string 321 if tmp, ok := rawArgs["interface"]; ok { 322 var err error 323 arg3, err = graphql.UnmarshalString(tmp) 324 if err != nil { 325 return nil, err 326 } 327 } 328 args["interface"] = arg3 329 var arg4 string 330 if tmp, ok := rawArgs["select"]; ok { 331 var err error 332 arg4, err = graphql.UnmarshalString(tmp) 333 if err != nil { 334 return nil, err 335 } 336 } 337 args["select"] = arg4 338 var arg5 string 339 if tmp, ok := rawArgs["case"]; ok { 340 var err error 341 arg5, err = graphql.UnmarshalString(tmp) 342 if err != nil { 343 return nil, err 344 } 345 } 346 args["case"] = arg5 347 var arg6 string 348 if tmp, ok := rawArgs["defer"]; ok { 349 var err error 350 arg6, err = graphql.UnmarshalString(tmp) 351 if err != nil { 352 return nil, err 353 } 354 } 355 args["defer"] = arg6 356 var arg7 string 357 if tmp, ok := rawArgs["go"]; ok { 358 var err error 359 arg7, err = graphql.UnmarshalString(tmp) 360 if err != nil { 361 return nil, err 362 } 363 } 364 args["go"] = arg7 365 var arg8 string 366 if tmp, ok := rawArgs["map"]; ok { 367 var err error 368 arg8, err = graphql.UnmarshalString(tmp) 369 if err != nil { 370 return nil, err 371 } 372 } 373 args["map"] = arg8 374 var arg9 string 375 if tmp, ok := rawArgs["struct"]; ok { 376 var err error 377 arg9, err = graphql.UnmarshalString(tmp) 378 if err != nil { 379 return nil, err 380 } 381 } 382 args["struct"] = arg9 383 var arg10 string 384 if tmp, ok := rawArgs["chan"]; ok { 385 var err error 386 arg10, err = graphql.UnmarshalString(tmp) 387 if err != nil { 388 return nil, err 389 } 390 } 391 args["chan"] = arg10 392 var arg11 string 393 if tmp, ok := rawArgs["else"]; ok { 394 var err error 395 arg11, err = graphql.UnmarshalString(tmp) 396 if err != nil { 397 return nil, err 398 } 399 } 400 args["else"] = arg11 401 var arg12 string 402 if tmp, ok := rawArgs["goto"]; ok { 403 var err error 404 arg12, err = graphql.UnmarshalString(tmp) 405 if err != nil { 406 return nil, err 407 } 408 } 409 args["goto"] = arg12 410 var arg13 string 411 if tmp, ok := rawArgs["package"]; ok { 412 var err error 413 arg13, err = graphql.UnmarshalString(tmp) 414 if err != nil { 415 return nil, err 416 } 417 } 418 args["package"] = arg13 419 var arg14 string 420 if tmp, ok := rawArgs["switch"]; ok { 421 var err error 422 arg14, err = graphql.UnmarshalString(tmp) 423 if err != nil { 424 return nil, err 425 } 426 } 427 args["switch"] = arg14 428 var arg15 string 429 if tmp, ok := rawArgs["const"]; ok { 430 var err error 431 arg15, err = graphql.UnmarshalString(tmp) 432 if err != nil { 433 return nil, err 434 } 435 } 436 args["const"] = arg15 437 var arg16 string 438 if tmp, ok := rawArgs["fallthrough"]; ok { 439 var err error 440 arg16, err = graphql.UnmarshalString(tmp) 441 if err != nil { 442 return nil, err 443 } 444 } 445 args["fallthrough"] = arg16 446 var arg17 string 447 if tmp, ok := rawArgs["if"]; ok { 448 var err error 449 arg17, err = graphql.UnmarshalString(tmp) 450 if err != nil { 451 return nil, err 452 } 453 } 454 args["if"] = arg17 455 var arg18 string 456 if tmp, ok := rawArgs["range"]; ok { 457 var err error 458 arg18, err = graphql.UnmarshalString(tmp) 459 if err != nil { 460 return nil, err 461 } 462 } 463 args["range"] = arg18 464 var arg19 string 465 if tmp, ok := rawArgs["type"]; ok { 466 var err error 467 arg19, err = graphql.UnmarshalString(tmp) 468 if err != nil { 469 return nil, err 470 } 471 } 472 args["type"] = arg19 473 var arg20 string 474 if tmp, ok := rawArgs["continue"]; ok { 475 var err error 476 arg20, err = graphql.UnmarshalString(tmp) 477 if err != nil { 478 return nil, err 479 } 480 } 481 args["continue"] = arg20 482 var arg21 string 483 if tmp, ok := rawArgs["for"]; ok { 484 var err error 485 arg21, err = graphql.UnmarshalString(tmp) 486 if err != nil { 487 return nil, err 488 } 489 } 490 args["for"] = arg21 491 var arg22 string 492 if tmp, ok := rawArgs["import"]; ok { 493 var err error 494 arg22, err = graphql.UnmarshalString(tmp) 495 if err != nil { 496 return nil, err 497 } 498 } 499 args["import"] = arg22 500 var arg23 string 501 if tmp, ok := rawArgs["return"]; ok { 502 var err error 503 arg23, err = graphql.UnmarshalString(tmp) 504 if err != nil { 505 return nil, err 506 } 507 } 508 args["return"] = arg23 509 var arg24 string 510 if tmp, ok := rawArgs["var"]; ok { 511 var err error 512 arg24, err = graphql.UnmarshalString(tmp) 513 if err != nil { 514 return nil, err 515 } 516 } 517 args["var"] = arg24 518 return args, nil 519 520 } 521 522 func field_Query___type_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 523 args := map[string]interface{}{} 524 var arg0 string 525 if tmp, ok := rawArgs["name"]; ok { 526 var err error 527 arg0, err = graphql.UnmarshalString(tmp) 528 if err != nil { 529 return nil, err 530 } 531 } 532 args["name"] = arg0 533 return args, nil 534 535 } 536 537 func field___Type_fields_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 538 args := map[string]interface{}{} 539 var arg0 bool 540 if tmp, ok := rawArgs["includeDeprecated"]; ok { 541 var err error 542 arg0, err = graphql.UnmarshalBoolean(tmp) 543 if err != nil { 544 return nil, err 545 } 546 } 547 args["includeDeprecated"] = arg0 548 return args, nil 549 550 } 551 552 func field___Type_enumValues_args(rawArgs map[string]interface{}) (map[string]interface{}, error) { 553 args := map[string]interface{}{} 554 var arg0 bool 555 if tmp, ok := rawArgs["includeDeprecated"]; ok { 556 var err error 557 arg0, err = graphql.UnmarshalBoolean(tmp) 558 if err != nil { 559 return nil, err 560 } 561 } 562 args["includeDeprecated"] = arg0 563 return args, nil 564 565 } 566 567 type executableSchema struct { 568 resolvers ResolverRoot 569 directives DirectiveRoot 570 complexity ComplexityRoot 571 } 572 573 func (e *executableSchema) Schema() *ast.Schema { 574 return parsedSchema 575 } 576 577 func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { 578 switch typeName + "." + field { 579 580 case "Circle.radius": 581 if e.complexity.Circle.Radius == nil { 582 break 583 } 584 585 return e.complexity.Circle.Radius(childComplexity), true 586 587 case "Circle.area": 588 if e.complexity.Circle.Area == nil { 589 break 590 } 591 592 return e.complexity.Circle.Area(childComplexity), true 593 594 case "EmbeddedPointer.ID": 595 if e.complexity.EmbeddedPointer.Id == nil { 596 break 597 } 598 599 return e.complexity.EmbeddedPointer.Id(childComplexity), true 600 601 case "EmbeddedPointer.Title": 602 if e.complexity.EmbeddedPointer.Title == nil { 603 break 604 } 605 606 return e.complexity.EmbeddedPointer.Title(childComplexity), true 607 608 case "Error.id": 609 if e.complexity.Error.Id == nil { 610 break 611 } 612 613 return e.complexity.Error.Id(childComplexity), true 614 615 case "Error.errorOnNonRequiredField": 616 if e.complexity.Error.ErrorOnNonRequiredField == nil { 617 break 618 } 619 620 return e.complexity.Error.ErrorOnNonRequiredField(childComplexity), true 621 622 case "Error.errorOnRequiredField": 623 if e.complexity.Error.ErrorOnRequiredField == nil { 624 break 625 } 626 627 return e.complexity.Error.ErrorOnRequiredField(childComplexity), true 628 629 case "Error.nilOnRequiredField": 630 if e.complexity.Error.NilOnRequiredField == nil { 631 break 632 } 633 634 return e.complexity.Error.NilOnRequiredField(childComplexity), true 635 636 case "ForcedResolver.field": 637 if e.complexity.ForcedResolver.Field == nil { 638 break 639 } 640 641 return e.complexity.ForcedResolver.Field(childComplexity), true 642 643 case "InnerObject.id": 644 if e.complexity.InnerObject.Id == nil { 645 break 646 } 647 648 return e.complexity.InnerObject.Id(childComplexity), true 649 650 case "InvalidIdentifier.id": 651 if e.complexity.InvalidIdentifier.Id == nil { 652 break 653 } 654 655 return e.complexity.InvalidIdentifier.Id(childComplexity), true 656 657 case "It.id": 658 if e.complexity.It.Id == nil { 659 break 660 } 661 662 return e.complexity.It.Id(childComplexity), true 663 664 case "ModelMethods.resolverField": 665 if e.complexity.ModelMethods.ResolverField == nil { 666 break 667 } 668 669 return e.complexity.ModelMethods.ResolverField(childComplexity), true 670 671 case "ModelMethods.noContext": 672 if e.complexity.ModelMethods.NoContext == nil { 673 break 674 } 675 676 return e.complexity.ModelMethods.NoContext(childComplexity), true 677 678 case "ModelMethods.withContext": 679 if e.complexity.ModelMethods.WithContext == nil { 680 break 681 } 682 683 return e.complexity.ModelMethods.WithContext(childComplexity), true 684 685 case "OuterObject.inner": 686 if e.complexity.OuterObject.Inner == nil { 687 break 688 } 689 690 return e.complexity.OuterObject.Inner(childComplexity), true 691 692 case "Query.invalidIdentifier": 693 if e.complexity.Query.InvalidIdentifier == nil { 694 break 695 } 696 697 return e.complexity.Query.InvalidIdentifier(childComplexity), true 698 699 case "Query.collision": 700 if e.complexity.Query.Collision == nil { 701 break 702 } 703 704 return e.complexity.Query.Collision(childComplexity), true 705 706 case "Query.mapInput": 707 if e.complexity.Query.MapInput == nil { 708 break 709 } 710 711 args, err := field_Query_mapInput_args(rawArgs) 712 if err != nil { 713 return 0, false 714 } 715 716 return e.complexity.Query.MapInput(childComplexity, args["input"].(*map[string]interface{})), true 717 718 case "Query.recursive": 719 if e.complexity.Query.Recursive == nil { 720 break 721 } 722 723 args, err := field_Query_recursive_args(rawArgs) 724 if err != nil { 725 return 0, false 726 } 727 728 return e.complexity.Query.Recursive(childComplexity, args["input"].(*RecursiveInputSlice)), true 729 730 case "Query.nestedInputs": 731 if e.complexity.Query.NestedInputs == nil { 732 break 733 } 734 735 args, err := field_Query_nestedInputs_args(rawArgs) 736 if err != nil { 737 return 0, false 738 } 739 740 return e.complexity.Query.NestedInputs(childComplexity, args["input"].([][]*OuterInput)), true 741 742 case "Query.nestedOutputs": 743 if e.complexity.Query.NestedOutputs == nil { 744 break 745 } 746 747 return e.complexity.Query.NestedOutputs(childComplexity), true 748 749 case "Query.keywords": 750 if e.complexity.Query.Keywords == nil { 751 break 752 } 753 754 args, err := field_Query_keywords_args(rawArgs) 755 if err != nil { 756 return 0, false 757 } 758 759 return e.complexity.Query.Keywords(childComplexity, args["input"].(*Keywords)), true 760 761 case "Query.shapes": 762 if e.complexity.Query.Shapes == nil { 763 break 764 } 765 766 return e.complexity.Query.Shapes(childComplexity), true 767 768 case "Query.errorBubble": 769 if e.complexity.Query.ErrorBubble == nil { 770 break 771 } 772 773 return e.complexity.Query.ErrorBubble(childComplexity), true 774 775 case "Query.modelMethods": 776 if e.complexity.Query.ModelMethods == nil { 777 break 778 } 779 780 return e.complexity.Query.ModelMethods(childComplexity), true 781 782 case "Query.valid": 783 if e.complexity.Query.Valid == nil { 784 break 785 } 786 787 return e.complexity.Query.Valid(childComplexity), true 788 789 case "Query.user": 790 if e.complexity.Query.User == nil { 791 break 792 } 793 794 args, err := field_Query_user_args(rawArgs) 795 if err != nil { 796 return 0, false 797 } 798 799 return e.complexity.Query.User(childComplexity, args["id"].(int)), true 800 801 case "Query.nullableArg": 802 if e.complexity.Query.NullableArg == nil { 803 break 804 } 805 806 args, err := field_Query_nullableArg_args(rawArgs) 807 if err != nil { 808 return 0, false 809 } 810 811 return e.complexity.Query.NullableArg(childComplexity, args["arg"].(*int)), true 812 813 case "Query.keywordArgs": 814 if e.complexity.Query.KeywordArgs == nil { 815 break 816 } 817 818 args, err := field_Query_keywordArgs_args(rawArgs) 819 if err != nil { 820 return 0, false 821 } 822 823 return e.complexity.Query.KeywordArgs(childComplexity, args["break"].(string), args["default"].(string), args["func"].(string), args["interface"].(string), args["select"].(string), args["case"].(string), args["defer"].(string), args["go"].(string), args["map"].(string), args["struct"].(string), args["chan"].(string), args["else"].(string), args["goto"].(string), args["package"].(string), args["switch"].(string), args["const"].(string), args["fallthrough"].(string), args["if"].(string), args["range"].(string), args["type"].(string), args["continue"].(string), args["for"].(string), args["import"].(string), args["return"].(string), args["var"].(string)), true 824 825 case "Rectangle.length": 826 if e.complexity.Rectangle.Length == nil { 827 break 828 } 829 830 return e.complexity.Rectangle.Length(childComplexity), true 831 832 case "Rectangle.width": 833 if e.complexity.Rectangle.Width == nil { 834 break 835 } 836 837 return e.complexity.Rectangle.Width(childComplexity), true 838 839 case "Rectangle.area": 840 if e.complexity.Rectangle.Area == nil { 841 break 842 } 843 844 return e.complexity.Rectangle.Area(childComplexity), true 845 846 case "Subscription.updated": 847 if e.complexity.Subscription.Updated == nil { 848 break 849 } 850 851 return e.complexity.Subscription.Updated(childComplexity), true 852 853 case "Subscription.initPayload": 854 if e.complexity.Subscription.InitPayload == nil { 855 break 856 } 857 858 return e.complexity.Subscription.InitPayload(childComplexity), true 859 860 case "User.id": 861 if e.complexity.User.Id == nil { 862 break 863 } 864 865 return e.complexity.User.Id(childComplexity), true 866 867 case "User.friends": 868 if e.complexity.User.Friends == nil { 869 break 870 } 871 872 return e.complexity.User.Friends(childComplexity), true 873 874 } 875 return 0, false 876 } 877 878 func (e *executableSchema) Query(ctx context.Context, op *ast.OperationDefinition) *graphql.Response { 879 ec := executionContext{graphql.GetRequestContext(ctx), e} 880 881 buf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte { 882 data := ec._Query(ctx, op.SelectionSet) 883 var buf bytes.Buffer 884 data.MarshalGQL(&buf) 885 return buf.Bytes() 886 }) 887 888 return &graphql.Response{ 889 Data: buf, 890 Errors: ec.Errors, 891 Extensions: ec.Extensions} 892 } 893 894 func (e *executableSchema) Mutation(ctx context.Context, op *ast.OperationDefinition) *graphql.Response { 895 return graphql.ErrorResponse(ctx, "mutations are not supported") 896 } 897 898 func (e *executableSchema) Subscription(ctx context.Context, op *ast.OperationDefinition) func() *graphql.Response { 899 ec := executionContext{graphql.GetRequestContext(ctx), e} 900 901 next := ec._Subscription(ctx, op.SelectionSet) 902 if ec.Errors != nil { 903 return graphql.OneShot(&graphql.Response{Data: []byte("null"), Errors: ec.Errors}) 904 } 905 906 var buf bytes.Buffer 907 return func() *graphql.Response { 908 buf := ec.RequestMiddleware(ctx, func(ctx context.Context) []byte { 909 buf.Reset() 910 data := next() 911 912 if data == nil { 913 return nil 914 } 915 data.MarshalGQL(&buf) 916 return buf.Bytes() 917 }) 918 919 if buf == nil { 920 return nil 921 } 922 923 return &graphql.Response{ 924 Data: buf, 925 Errors: ec.Errors, 926 Extensions: ec.Extensions, 927 } 928 } 929 } 930 931 type executionContext struct { 932 *graphql.RequestContext 933 *executableSchema 934 } 935 936 var circleImplementors = []string{"Circle", "Shape"} 937 938 // nolint: gocyclo, errcheck, gas, goconst 939 func (ec *executionContext) _Circle(ctx context.Context, sel ast.SelectionSet, obj *Circle) graphql.Marshaler { 940 fields := graphql.CollectFields(ctx, sel, circleImplementors) 941 942 out := graphql.NewOrderedMap(len(fields)) 943 invalid := false 944 for i, field := range fields { 945 out.Keys[i] = field.Alias 946 947 switch field.Name { 948 case "__typename": 949 out.Values[i] = graphql.MarshalString("Circle") 950 case "radius": 951 out.Values[i] = ec._Circle_radius(ctx, field, obj) 952 case "area": 953 out.Values[i] = ec._Circle_area(ctx, field, obj) 954 default: 955 panic("unknown field " + strconv.Quote(field.Name)) 956 } 957 } 958 959 if invalid { 960 return graphql.Null 961 } 962 return out 963 } 964 965 // nolint: vetshadow 966 func (ec *executionContext) _Circle_radius(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { 967 ctx = ec.Tracer.StartFieldExecution(ctx, field) 968 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 969 rctx := &graphql.ResolverContext{ 970 Object: "Circle", 971 Args: nil, 972 Field: field, 973 } 974 ctx = graphql.WithResolverContext(ctx, rctx) 975 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 976 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 977 ctx = rctx // use context from middleware stack in children 978 return obj.Radius, nil 979 }) 980 if resTmp == nil { 981 return graphql.Null 982 } 983 res := resTmp.(float64) 984 rctx.Result = res 985 ctx = ec.Tracer.StartFieldChildExecution(ctx) 986 return graphql.MarshalFloat(res) 987 } 988 989 // nolint: vetshadow 990 func (ec *executionContext) _Circle_area(ctx context.Context, field graphql.CollectedField, obj *Circle) graphql.Marshaler { 991 ctx = ec.Tracer.StartFieldExecution(ctx, field) 992 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 993 rctx := &graphql.ResolverContext{ 994 Object: "Circle", 995 Args: nil, 996 Field: field, 997 } 998 ctx = graphql.WithResolverContext(ctx, rctx) 999 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1000 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1001 ctx = rctx // use context from middleware stack in children 1002 return obj.Area(), nil 1003 }) 1004 if resTmp == nil { 1005 return graphql.Null 1006 } 1007 res := resTmp.(float64) 1008 rctx.Result = res 1009 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1010 return graphql.MarshalFloat(res) 1011 } 1012 1013 var embeddedPointerImplementors = []string{"EmbeddedPointer"} 1014 1015 // nolint: gocyclo, errcheck, gas, goconst 1016 func (ec *executionContext) _EmbeddedPointer(ctx context.Context, sel ast.SelectionSet, obj *EmbeddedPointerModel) graphql.Marshaler { 1017 fields := graphql.CollectFields(ctx, sel, embeddedPointerImplementors) 1018 1019 out := graphql.NewOrderedMap(len(fields)) 1020 invalid := false 1021 for i, field := range fields { 1022 out.Keys[i] = field.Alias 1023 1024 switch field.Name { 1025 case "__typename": 1026 out.Values[i] = graphql.MarshalString("EmbeddedPointer") 1027 case "ID": 1028 out.Values[i] = ec._EmbeddedPointer_ID(ctx, field, obj) 1029 case "Title": 1030 out.Values[i] = ec._EmbeddedPointer_Title(ctx, field, obj) 1031 default: 1032 panic("unknown field " + strconv.Quote(field.Name)) 1033 } 1034 } 1035 1036 if invalid { 1037 return graphql.Null 1038 } 1039 return out 1040 } 1041 1042 // nolint: vetshadow 1043 func (ec *executionContext) _EmbeddedPointer_ID(ctx context.Context, field graphql.CollectedField, obj *EmbeddedPointerModel) graphql.Marshaler { 1044 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1045 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1046 rctx := &graphql.ResolverContext{ 1047 Object: "EmbeddedPointer", 1048 Args: nil, 1049 Field: field, 1050 } 1051 ctx = graphql.WithResolverContext(ctx, rctx) 1052 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1053 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1054 ctx = rctx // use context from middleware stack in children 1055 return obj.ID, nil 1056 }) 1057 if resTmp == nil { 1058 return graphql.Null 1059 } 1060 res := resTmp.(string) 1061 rctx.Result = res 1062 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1063 return graphql.MarshalString(res) 1064 } 1065 1066 // nolint: vetshadow 1067 func (ec *executionContext) _EmbeddedPointer_Title(ctx context.Context, field graphql.CollectedField, obj *EmbeddedPointerModel) graphql.Marshaler { 1068 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1069 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1070 rctx := &graphql.ResolverContext{ 1071 Object: "EmbeddedPointer", 1072 Args: nil, 1073 Field: field, 1074 } 1075 ctx = graphql.WithResolverContext(ctx, rctx) 1076 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1077 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1078 ctx = rctx // use context from middleware stack in children 1079 return obj.Title, nil 1080 }) 1081 if resTmp == nil { 1082 return graphql.Null 1083 } 1084 res := resTmp.(string) 1085 rctx.Result = res 1086 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1087 return graphql.MarshalString(res) 1088 } 1089 1090 var errorImplementors = []string{"Error"} 1091 1092 // nolint: gocyclo, errcheck, gas, goconst 1093 func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, obj *Error) graphql.Marshaler { 1094 fields := graphql.CollectFields(ctx, sel, errorImplementors) 1095 1096 out := graphql.NewOrderedMap(len(fields)) 1097 invalid := false 1098 for i, field := range fields { 1099 out.Keys[i] = field.Alias 1100 1101 switch field.Name { 1102 case "__typename": 1103 out.Values[i] = graphql.MarshalString("Error") 1104 case "id": 1105 out.Values[i] = ec._Error_id(ctx, field, obj) 1106 if out.Values[i] == graphql.Null { 1107 invalid = true 1108 } 1109 case "errorOnNonRequiredField": 1110 out.Values[i] = ec._Error_errorOnNonRequiredField(ctx, field, obj) 1111 case "errorOnRequiredField": 1112 out.Values[i] = ec._Error_errorOnRequiredField(ctx, field, obj) 1113 if out.Values[i] == graphql.Null { 1114 invalid = true 1115 } 1116 case "nilOnRequiredField": 1117 out.Values[i] = ec._Error_nilOnRequiredField(ctx, field, obj) 1118 if out.Values[i] == graphql.Null { 1119 invalid = true 1120 } 1121 default: 1122 panic("unknown field " + strconv.Quote(field.Name)) 1123 } 1124 } 1125 1126 if invalid { 1127 return graphql.Null 1128 } 1129 return out 1130 } 1131 1132 // nolint: vetshadow 1133 func (ec *executionContext) _Error_id(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { 1134 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1135 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1136 rctx := &graphql.ResolverContext{ 1137 Object: "Error", 1138 Args: nil, 1139 Field: field, 1140 } 1141 ctx = graphql.WithResolverContext(ctx, rctx) 1142 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1143 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1144 ctx = rctx // use context from middleware stack in children 1145 return obj.ID, nil 1146 }) 1147 if resTmp == nil { 1148 if !ec.HasError(rctx) { 1149 ec.Errorf(ctx, "must not be null") 1150 } 1151 return graphql.Null 1152 } 1153 res := resTmp.(string) 1154 rctx.Result = res 1155 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1156 return graphql.MarshalID(res) 1157 } 1158 1159 // nolint: vetshadow 1160 func (ec *executionContext) _Error_errorOnNonRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { 1161 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1162 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1163 rctx := &graphql.ResolverContext{ 1164 Object: "Error", 1165 Args: nil, 1166 Field: field, 1167 } 1168 ctx = graphql.WithResolverContext(ctx, rctx) 1169 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1170 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1171 ctx = rctx // use context from middleware stack in children 1172 return obj.ErrorOnNonRequiredField() 1173 }) 1174 if resTmp == nil { 1175 return graphql.Null 1176 } 1177 res := resTmp.(string) 1178 rctx.Result = res 1179 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1180 return graphql.MarshalString(res) 1181 } 1182 1183 // nolint: vetshadow 1184 func (ec *executionContext) _Error_errorOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { 1185 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1186 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1187 rctx := &graphql.ResolverContext{ 1188 Object: "Error", 1189 Args: nil, 1190 Field: field, 1191 } 1192 ctx = graphql.WithResolverContext(ctx, rctx) 1193 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1194 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1195 ctx = rctx // use context from middleware stack in children 1196 return obj.ErrorOnRequiredField() 1197 }) 1198 if resTmp == nil { 1199 if !ec.HasError(rctx) { 1200 ec.Errorf(ctx, "must not be null") 1201 } 1202 return graphql.Null 1203 } 1204 res := resTmp.(string) 1205 rctx.Result = res 1206 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1207 return graphql.MarshalString(res) 1208 } 1209 1210 // nolint: vetshadow 1211 func (ec *executionContext) _Error_nilOnRequiredField(ctx context.Context, field graphql.CollectedField, obj *Error) graphql.Marshaler { 1212 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1213 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1214 rctx := &graphql.ResolverContext{ 1215 Object: "Error", 1216 Args: nil, 1217 Field: field, 1218 } 1219 ctx = graphql.WithResolverContext(ctx, rctx) 1220 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1221 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1222 ctx = rctx // use context from middleware stack in children 1223 return obj.NilOnRequiredField(), nil 1224 }) 1225 if resTmp == nil { 1226 if !ec.HasError(rctx) { 1227 ec.Errorf(ctx, "must not be null") 1228 } 1229 return graphql.Null 1230 } 1231 res := resTmp.(*string) 1232 rctx.Result = res 1233 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1234 1235 if res == nil { 1236 if !ec.HasError(rctx) { 1237 ec.Errorf(ctx, "must not be null") 1238 } 1239 return graphql.Null 1240 } 1241 return graphql.MarshalString(*res) 1242 } 1243 1244 var forcedResolverImplementors = []string{"ForcedResolver"} 1245 1246 // nolint: gocyclo, errcheck, gas, goconst 1247 func (ec *executionContext) _ForcedResolver(ctx context.Context, sel ast.SelectionSet, obj *ForcedResolver) graphql.Marshaler { 1248 fields := graphql.CollectFields(ctx, sel, forcedResolverImplementors) 1249 1250 var wg sync.WaitGroup 1251 out := graphql.NewOrderedMap(len(fields)) 1252 invalid := false 1253 for i, field := range fields { 1254 out.Keys[i] = field.Alias 1255 1256 switch field.Name { 1257 case "__typename": 1258 out.Values[i] = graphql.MarshalString("ForcedResolver") 1259 case "field": 1260 wg.Add(1) 1261 go func(i int, field graphql.CollectedField) { 1262 out.Values[i] = ec._ForcedResolver_field(ctx, field, obj) 1263 wg.Done() 1264 }(i, field) 1265 default: 1266 panic("unknown field " + strconv.Quote(field.Name)) 1267 } 1268 } 1269 wg.Wait() 1270 if invalid { 1271 return graphql.Null 1272 } 1273 return out 1274 } 1275 1276 // nolint: vetshadow 1277 func (ec *executionContext) _ForcedResolver_field(ctx context.Context, field graphql.CollectedField, obj *ForcedResolver) graphql.Marshaler { 1278 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1279 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1280 rctx := &graphql.ResolverContext{ 1281 Object: "ForcedResolver", 1282 Args: nil, 1283 Field: field, 1284 } 1285 ctx = graphql.WithResolverContext(ctx, rctx) 1286 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1287 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1288 ctx = rctx // use context from middleware stack in children 1289 return ec.resolvers.ForcedResolver().Field(rctx, obj) 1290 }) 1291 if resTmp == nil { 1292 return graphql.Null 1293 } 1294 res := resTmp.(*Circle) 1295 rctx.Result = res 1296 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1297 1298 if res == nil { 1299 return graphql.Null 1300 } 1301 1302 return ec._Circle(ctx, field.Selections, res) 1303 } 1304 1305 var innerObjectImplementors = []string{"InnerObject"} 1306 1307 // nolint: gocyclo, errcheck, gas, goconst 1308 func (ec *executionContext) _InnerObject(ctx context.Context, sel ast.SelectionSet, obj *InnerObject) graphql.Marshaler { 1309 fields := graphql.CollectFields(ctx, sel, innerObjectImplementors) 1310 1311 out := graphql.NewOrderedMap(len(fields)) 1312 invalid := false 1313 for i, field := range fields { 1314 out.Keys[i] = field.Alias 1315 1316 switch field.Name { 1317 case "__typename": 1318 out.Values[i] = graphql.MarshalString("InnerObject") 1319 case "id": 1320 out.Values[i] = ec._InnerObject_id(ctx, field, obj) 1321 if out.Values[i] == graphql.Null { 1322 invalid = true 1323 } 1324 default: 1325 panic("unknown field " + strconv.Quote(field.Name)) 1326 } 1327 } 1328 1329 if invalid { 1330 return graphql.Null 1331 } 1332 return out 1333 } 1334 1335 // nolint: vetshadow 1336 func (ec *executionContext) _InnerObject_id(ctx context.Context, field graphql.CollectedField, obj *InnerObject) graphql.Marshaler { 1337 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1338 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1339 rctx := &graphql.ResolverContext{ 1340 Object: "InnerObject", 1341 Args: nil, 1342 Field: field, 1343 } 1344 ctx = graphql.WithResolverContext(ctx, rctx) 1345 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1346 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1347 ctx = rctx // use context from middleware stack in children 1348 return obj.ID, nil 1349 }) 1350 if resTmp == nil { 1351 if !ec.HasError(rctx) { 1352 ec.Errorf(ctx, "must not be null") 1353 } 1354 return graphql.Null 1355 } 1356 res := resTmp.(int) 1357 rctx.Result = res 1358 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1359 return graphql.MarshalInt(res) 1360 } 1361 1362 var invalidIdentifierImplementors = []string{"InvalidIdentifier"} 1363 1364 // nolint: gocyclo, errcheck, gas, goconst 1365 func (ec *executionContext) _InvalidIdentifier(ctx context.Context, sel ast.SelectionSet, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { 1366 fields := graphql.CollectFields(ctx, sel, invalidIdentifierImplementors) 1367 1368 out := graphql.NewOrderedMap(len(fields)) 1369 invalid := false 1370 for i, field := range fields { 1371 out.Keys[i] = field.Alias 1372 1373 switch field.Name { 1374 case "__typename": 1375 out.Values[i] = graphql.MarshalString("InvalidIdentifier") 1376 case "id": 1377 out.Values[i] = ec._InvalidIdentifier_id(ctx, field, obj) 1378 if out.Values[i] == graphql.Null { 1379 invalid = true 1380 } 1381 default: 1382 panic("unknown field " + strconv.Quote(field.Name)) 1383 } 1384 } 1385 1386 if invalid { 1387 return graphql.Null 1388 } 1389 return out 1390 } 1391 1392 // nolint: vetshadow 1393 func (ec *executionContext) _InvalidIdentifier_id(ctx context.Context, field graphql.CollectedField, obj *invalid_packagename.InvalidIdentifier) graphql.Marshaler { 1394 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1395 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1396 rctx := &graphql.ResolverContext{ 1397 Object: "InvalidIdentifier", 1398 Args: nil, 1399 Field: field, 1400 } 1401 ctx = graphql.WithResolverContext(ctx, rctx) 1402 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1403 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1404 ctx = rctx // use context from middleware stack in children 1405 return obj.ID, nil 1406 }) 1407 if resTmp == nil { 1408 if !ec.HasError(rctx) { 1409 ec.Errorf(ctx, "must not be null") 1410 } 1411 return graphql.Null 1412 } 1413 res := resTmp.(int) 1414 rctx.Result = res 1415 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1416 return graphql.MarshalInt(res) 1417 } 1418 1419 var itImplementors = []string{"It"} 1420 1421 // nolint: gocyclo, errcheck, gas, goconst 1422 func (ec *executionContext) _It(ctx context.Context, sel ast.SelectionSet, obj *introspection1.It) graphql.Marshaler { 1423 fields := graphql.CollectFields(ctx, sel, itImplementors) 1424 1425 out := graphql.NewOrderedMap(len(fields)) 1426 invalid := false 1427 for i, field := range fields { 1428 out.Keys[i] = field.Alias 1429 1430 switch field.Name { 1431 case "__typename": 1432 out.Values[i] = graphql.MarshalString("It") 1433 case "id": 1434 out.Values[i] = ec._It_id(ctx, field, obj) 1435 if out.Values[i] == graphql.Null { 1436 invalid = true 1437 } 1438 default: 1439 panic("unknown field " + strconv.Quote(field.Name)) 1440 } 1441 } 1442 1443 if invalid { 1444 return graphql.Null 1445 } 1446 return out 1447 } 1448 1449 // nolint: vetshadow 1450 func (ec *executionContext) _It_id(ctx context.Context, field graphql.CollectedField, obj *introspection1.It) graphql.Marshaler { 1451 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1452 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1453 rctx := &graphql.ResolverContext{ 1454 Object: "It", 1455 Args: nil, 1456 Field: field, 1457 } 1458 ctx = graphql.WithResolverContext(ctx, rctx) 1459 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1460 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1461 ctx = rctx // use context from middleware stack in children 1462 return obj.ID, nil 1463 }) 1464 if resTmp == nil { 1465 if !ec.HasError(rctx) { 1466 ec.Errorf(ctx, "must not be null") 1467 } 1468 return graphql.Null 1469 } 1470 res := resTmp.(string) 1471 rctx.Result = res 1472 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1473 return graphql.MarshalID(res) 1474 } 1475 1476 var modelMethodsImplementors = []string{"ModelMethods"} 1477 1478 // nolint: gocyclo, errcheck, gas, goconst 1479 func (ec *executionContext) _ModelMethods(ctx context.Context, sel ast.SelectionSet, obj *ModelMethods) graphql.Marshaler { 1480 fields := graphql.CollectFields(ctx, sel, modelMethodsImplementors) 1481 1482 var wg sync.WaitGroup 1483 out := graphql.NewOrderedMap(len(fields)) 1484 invalid := false 1485 for i, field := range fields { 1486 out.Keys[i] = field.Alias 1487 1488 switch field.Name { 1489 case "__typename": 1490 out.Values[i] = graphql.MarshalString("ModelMethods") 1491 case "resolverField": 1492 wg.Add(1) 1493 go func(i int, field graphql.CollectedField) { 1494 out.Values[i] = ec._ModelMethods_resolverField(ctx, field, obj) 1495 if out.Values[i] == graphql.Null { 1496 invalid = true 1497 } 1498 wg.Done() 1499 }(i, field) 1500 case "noContext": 1501 out.Values[i] = ec._ModelMethods_noContext(ctx, field, obj) 1502 if out.Values[i] == graphql.Null { 1503 invalid = true 1504 } 1505 case "withContext": 1506 wg.Add(1) 1507 go func(i int, field graphql.CollectedField) { 1508 out.Values[i] = ec._ModelMethods_withContext(ctx, field, obj) 1509 if out.Values[i] == graphql.Null { 1510 invalid = true 1511 } 1512 wg.Done() 1513 }(i, field) 1514 default: 1515 panic("unknown field " + strconv.Quote(field.Name)) 1516 } 1517 } 1518 wg.Wait() 1519 if invalid { 1520 return graphql.Null 1521 } 1522 return out 1523 } 1524 1525 // nolint: vetshadow 1526 func (ec *executionContext) _ModelMethods_resolverField(ctx context.Context, field graphql.CollectedField, obj *ModelMethods) graphql.Marshaler { 1527 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1528 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1529 rctx := &graphql.ResolverContext{ 1530 Object: "ModelMethods", 1531 Args: nil, 1532 Field: field, 1533 } 1534 ctx = graphql.WithResolverContext(ctx, rctx) 1535 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1536 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1537 ctx = rctx // use context from middleware stack in children 1538 return ec.resolvers.ModelMethods().ResolverField(rctx, obj) 1539 }) 1540 if resTmp == nil { 1541 if !ec.HasError(rctx) { 1542 ec.Errorf(ctx, "must not be null") 1543 } 1544 return graphql.Null 1545 } 1546 res := resTmp.(bool) 1547 rctx.Result = res 1548 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1549 return graphql.MarshalBoolean(res) 1550 } 1551 1552 // nolint: vetshadow 1553 func (ec *executionContext) _ModelMethods_noContext(ctx context.Context, field graphql.CollectedField, obj *ModelMethods) graphql.Marshaler { 1554 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1555 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1556 rctx := &graphql.ResolverContext{ 1557 Object: "ModelMethods", 1558 Args: nil, 1559 Field: field, 1560 } 1561 ctx = graphql.WithResolverContext(ctx, rctx) 1562 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1563 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1564 ctx = rctx // use context from middleware stack in children 1565 return obj.NoContext(), nil 1566 }) 1567 if resTmp == nil { 1568 if !ec.HasError(rctx) { 1569 ec.Errorf(ctx, "must not be null") 1570 } 1571 return graphql.Null 1572 } 1573 res := resTmp.(bool) 1574 rctx.Result = res 1575 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1576 return graphql.MarshalBoolean(res) 1577 } 1578 1579 // nolint: vetshadow 1580 func (ec *executionContext) _ModelMethods_withContext(ctx context.Context, field graphql.CollectedField, obj *ModelMethods) graphql.Marshaler { 1581 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1582 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1583 rctx := &graphql.ResolverContext{ 1584 Object: "ModelMethods", 1585 Args: nil, 1586 Field: field, 1587 } 1588 ctx = graphql.WithResolverContext(ctx, rctx) 1589 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1590 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1591 ctx = rctx // use context from middleware stack in children 1592 return obj.WithContext(ctx), nil 1593 }) 1594 if resTmp == nil { 1595 if !ec.HasError(rctx) { 1596 ec.Errorf(ctx, "must not be null") 1597 } 1598 return graphql.Null 1599 } 1600 res := resTmp.(bool) 1601 rctx.Result = res 1602 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1603 return graphql.MarshalBoolean(res) 1604 } 1605 1606 var outerObjectImplementors = []string{"OuterObject"} 1607 1608 // nolint: gocyclo, errcheck, gas, goconst 1609 func (ec *executionContext) _OuterObject(ctx context.Context, sel ast.SelectionSet, obj *OuterObject) graphql.Marshaler { 1610 fields := graphql.CollectFields(ctx, sel, outerObjectImplementors) 1611 1612 out := graphql.NewOrderedMap(len(fields)) 1613 invalid := false 1614 for i, field := range fields { 1615 out.Keys[i] = field.Alias 1616 1617 switch field.Name { 1618 case "__typename": 1619 out.Values[i] = graphql.MarshalString("OuterObject") 1620 case "inner": 1621 out.Values[i] = ec._OuterObject_inner(ctx, field, obj) 1622 if out.Values[i] == graphql.Null { 1623 invalid = true 1624 } 1625 default: 1626 panic("unknown field " + strconv.Quote(field.Name)) 1627 } 1628 } 1629 1630 if invalid { 1631 return graphql.Null 1632 } 1633 return out 1634 } 1635 1636 // nolint: vetshadow 1637 func (ec *executionContext) _OuterObject_inner(ctx context.Context, field graphql.CollectedField, obj *OuterObject) graphql.Marshaler { 1638 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1639 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1640 rctx := &graphql.ResolverContext{ 1641 Object: "OuterObject", 1642 Args: nil, 1643 Field: field, 1644 } 1645 ctx = graphql.WithResolverContext(ctx, rctx) 1646 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1647 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 1648 ctx = rctx // use context from middleware stack in children 1649 return obj.Inner, nil 1650 }) 1651 if resTmp == nil { 1652 if !ec.HasError(rctx) { 1653 ec.Errorf(ctx, "must not be null") 1654 } 1655 return graphql.Null 1656 } 1657 res := resTmp.(InnerObject) 1658 rctx.Result = res 1659 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1660 1661 return ec._InnerObject(ctx, field.Selections, &res) 1662 } 1663 1664 var queryImplementors = []string{"Query"} 1665 1666 // nolint: gocyclo, errcheck, gas, goconst 1667 func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 1668 fields := graphql.CollectFields(ctx, sel, queryImplementors) 1669 1670 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ 1671 Object: "Query", 1672 }) 1673 1674 var wg sync.WaitGroup 1675 out := graphql.NewOrderedMap(len(fields)) 1676 invalid := false 1677 for i, field := range fields { 1678 out.Keys[i] = field.Alias 1679 1680 switch field.Name { 1681 case "__typename": 1682 out.Values[i] = graphql.MarshalString("Query") 1683 case "invalidIdentifier": 1684 wg.Add(1) 1685 go func(i int, field graphql.CollectedField) { 1686 out.Values[i] = ec._Query_invalidIdentifier(ctx, field) 1687 wg.Done() 1688 }(i, field) 1689 case "collision": 1690 wg.Add(1) 1691 go func(i int, field graphql.CollectedField) { 1692 out.Values[i] = ec._Query_collision(ctx, field) 1693 wg.Done() 1694 }(i, field) 1695 case "mapInput": 1696 wg.Add(1) 1697 go func(i int, field graphql.CollectedField) { 1698 out.Values[i] = ec._Query_mapInput(ctx, field) 1699 wg.Done() 1700 }(i, field) 1701 case "recursive": 1702 wg.Add(1) 1703 go func(i int, field graphql.CollectedField) { 1704 out.Values[i] = ec._Query_recursive(ctx, field) 1705 wg.Done() 1706 }(i, field) 1707 case "nestedInputs": 1708 wg.Add(1) 1709 go func(i int, field graphql.CollectedField) { 1710 out.Values[i] = ec._Query_nestedInputs(ctx, field) 1711 wg.Done() 1712 }(i, field) 1713 case "nestedOutputs": 1714 wg.Add(1) 1715 go func(i int, field graphql.CollectedField) { 1716 out.Values[i] = ec._Query_nestedOutputs(ctx, field) 1717 wg.Done() 1718 }(i, field) 1719 case "keywords": 1720 wg.Add(1) 1721 go func(i int, field graphql.CollectedField) { 1722 out.Values[i] = ec._Query_keywords(ctx, field) 1723 if out.Values[i] == graphql.Null { 1724 invalid = true 1725 } 1726 wg.Done() 1727 }(i, field) 1728 case "shapes": 1729 wg.Add(1) 1730 go func(i int, field graphql.CollectedField) { 1731 out.Values[i] = ec._Query_shapes(ctx, field) 1732 wg.Done() 1733 }(i, field) 1734 case "errorBubble": 1735 wg.Add(1) 1736 go func(i int, field graphql.CollectedField) { 1737 out.Values[i] = ec._Query_errorBubble(ctx, field) 1738 wg.Done() 1739 }(i, field) 1740 case "modelMethods": 1741 wg.Add(1) 1742 go func(i int, field graphql.CollectedField) { 1743 out.Values[i] = ec._Query_modelMethods(ctx, field) 1744 wg.Done() 1745 }(i, field) 1746 case "valid": 1747 wg.Add(1) 1748 go func(i int, field graphql.CollectedField) { 1749 out.Values[i] = ec._Query_valid(ctx, field) 1750 if out.Values[i] == graphql.Null { 1751 invalid = true 1752 } 1753 wg.Done() 1754 }(i, field) 1755 case "user": 1756 wg.Add(1) 1757 go func(i int, field graphql.CollectedField) { 1758 out.Values[i] = ec._Query_user(ctx, field) 1759 if out.Values[i] == graphql.Null { 1760 invalid = true 1761 } 1762 wg.Done() 1763 }(i, field) 1764 case "nullableArg": 1765 wg.Add(1) 1766 go func(i int, field graphql.CollectedField) { 1767 out.Values[i] = ec._Query_nullableArg(ctx, field) 1768 wg.Done() 1769 }(i, field) 1770 case "keywordArgs": 1771 wg.Add(1) 1772 go func(i int, field graphql.CollectedField) { 1773 out.Values[i] = ec._Query_keywordArgs(ctx, field) 1774 if out.Values[i] == graphql.Null { 1775 invalid = true 1776 } 1777 wg.Done() 1778 }(i, field) 1779 case "__type": 1780 out.Values[i] = ec._Query___type(ctx, field) 1781 case "__schema": 1782 out.Values[i] = ec._Query___schema(ctx, field) 1783 default: 1784 panic("unknown field " + strconv.Quote(field.Name)) 1785 } 1786 } 1787 wg.Wait() 1788 if invalid { 1789 return graphql.Null 1790 } 1791 return out 1792 } 1793 1794 // nolint: vetshadow 1795 func (ec *executionContext) _Query_invalidIdentifier(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 1796 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1797 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1798 rctx := &graphql.ResolverContext{ 1799 Object: "Query", 1800 Args: nil, 1801 Field: field, 1802 } 1803 ctx = graphql.WithResolverContext(ctx, rctx) 1804 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1805 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 1806 ctx = rctx // use context from middleware stack in children 1807 return ec.resolvers.Query().InvalidIdentifier(rctx) 1808 }) 1809 if resTmp == nil { 1810 return graphql.Null 1811 } 1812 res := resTmp.(*invalid_packagename.InvalidIdentifier) 1813 rctx.Result = res 1814 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1815 1816 if res == nil { 1817 return graphql.Null 1818 } 1819 1820 return ec._InvalidIdentifier(ctx, field.Selections, res) 1821 } 1822 1823 // nolint: vetshadow 1824 func (ec *executionContext) _Query_collision(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 1825 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1826 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1827 rctx := &graphql.ResolverContext{ 1828 Object: "Query", 1829 Args: nil, 1830 Field: field, 1831 } 1832 ctx = graphql.WithResolverContext(ctx, rctx) 1833 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1834 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 1835 ctx = rctx // use context from middleware stack in children 1836 return ec.resolvers.Query().Collision(rctx) 1837 }) 1838 if resTmp == nil { 1839 return graphql.Null 1840 } 1841 res := resTmp.(*introspection1.It) 1842 rctx.Result = res 1843 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1844 1845 if res == nil { 1846 return graphql.Null 1847 } 1848 1849 return ec._It(ctx, field.Selections, res) 1850 } 1851 1852 // nolint: vetshadow 1853 func (ec *executionContext) _Query_mapInput(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 1854 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1855 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1856 rawArgs := field.ArgumentMap(ec.Variables) 1857 args, err := field_Query_mapInput_args(rawArgs) 1858 if err != nil { 1859 ec.Error(ctx, err) 1860 return graphql.Null 1861 } 1862 rctx := &graphql.ResolverContext{ 1863 Object: "Query", 1864 Args: args, 1865 Field: field, 1866 } 1867 ctx = graphql.WithResolverContext(ctx, rctx) 1868 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1869 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 1870 ctx = rctx // use context from middleware stack in children 1871 return ec.resolvers.Query().MapInput(rctx, args["input"].(*map[string]interface{})) 1872 }) 1873 if resTmp == nil { 1874 return graphql.Null 1875 } 1876 res := resTmp.(*bool) 1877 rctx.Result = res 1878 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1879 1880 if res == nil { 1881 return graphql.Null 1882 } 1883 return graphql.MarshalBoolean(*res) 1884 } 1885 1886 // nolint: vetshadow 1887 func (ec *executionContext) _Query_recursive(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 1888 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1889 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1890 rawArgs := field.ArgumentMap(ec.Variables) 1891 args, err := field_Query_recursive_args(rawArgs) 1892 if err != nil { 1893 ec.Error(ctx, err) 1894 return graphql.Null 1895 } 1896 rctx := &graphql.ResolverContext{ 1897 Object: "Query", 1898 Args: args, 1899 Field: field, 1900 } 1901 ctx = graphql.WithResolverContext(ctx, rctx) 1902 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1903 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 1904 ctx = rctx // use context from middleware stack in children 1905 return ec.resolvers.Query().Recursive(rctx, args["input"].(*RecursiveInputSlice)) 1906 }) 1907 if resTmp == nil { 1908 return graphql.Null 1909 } 1910 res := resTmp.(*bool) 1911 rctx.Result = res 1912 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1913 1914 if res == nil { 1915 return graphql.Null 1916 } 1917 return graphql.MarshalBoolean(*res) 1918 } 1919 1920 // nolint: vetshadow 1921 func (ec *executionContext) _Query_nestedInputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 1922 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1923 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1924 rawArgs := field.ArgumentMap(ec.Variables) 1925 args, err := field_Query_nestedInputs_args(rawArgs) 1926 if err != nil { 1927 ec.Error(ctx, err) 1928 return graphql.Null 1929 } 1930 rctx := &graphql.ResolverContext{ 1931 Object: "Query", 1932 Args: args, 1933 Field: field, 1934 } 1935 ctx = graphql.WithResolverContext(ctx, rctx) 1936 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1937 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 1938 ctx = rctx // use context from middleware stack in children 1939 return ec.resolvers.Query().NestedInputs(rctx, args["input"].([][]*OuterInput)) 1940 }) 1941 if resTmp == nil { 1942 return graphql.Null 1943 } 1944 res := resTmp.(*bool) 1945 rctx.Result = res 1946 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1947 1948 if res == nil { 1949 return graphql.Null 1950 } 1951 return graphql.MarshalBoolean(*res) 1952 } 1953 1954 // nolint: vetshadow 1955 func (ec *executionContext) _Query_nestedOutputs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 1956 ctx = ec.Tracer.StartFieldExecution(ctx, field) 1957 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 1958 rctx := &graphql.ResolverContext{ 1959 Object: "Query", 1960 Args: nil, 1961 Field: field, 1962 } 1963 ctx = graphql.WithResolverContext(ctx, rctx) 1964 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 1965 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 1966 ctx = rctx // use context from middleware stack in children 1967 return ec.resolvers.Query().NestedOutputs(rctx) 1968 }) 1969 if resTmp == nil { 1970 return graphql.Null 1971 } 1972 res := resTmp.([][]*OuterObject) 1973 rctx.Result = res 1974 ctx = ec.Tracer.StartFieldChildExecution(ctx) 1975 1976 arr1 := make(graphql.Array, len(res)) 1977 var wg sync.WaitGroup 1978 1979 isLen1 := len(res) == 1 1980 if !isLen1 { 1981 wg.Add(len(res)) 1982 } 1983 1984 for idx1 := range res { 1985 idx1 := idx1 1986 rctx := &graphql.ResolverContext{ 1987 Index: &idx1, 1988 Result: res[idx1], 1989 } 1990 ctx := graphql.WithResolverContext(ctx, rctx) 1991 f := func(idx1 int) { 1992 if !isLen1 { 1993 defer wg.Done() 1994 } 1995 arr1[idx1] = func() graphql.Marshaler { 1996 1997 arr2 := make(graphql.Array, len(res[idx1])) 1998 1999 isLen1 := len(res[idx1]) == 1 2000 if !isLen1 { 2001 wg.Add(len(res[idx1])) 2002 } 2003 2004 for idx2 := range res[idx1] { 2005 idx2 := idx2 2006 rctx := &graphql.ResolverContext{ 2007 Index: &idx2, 2008 Result: res[idx1][idx2], 2009 } 2010 ctx := graphql.WithResolverContext(ctx, rctx) 2011 f := func(idx2 int) { 2012 if !isLen1 { 2013 defer wg.Done() 2014 } 2015 arr2[idx2] = func() graphql.Marshaler { 2016 2017 if res[idx1][idx2] == nil { 2018 return graphql.Null 2019 } 2020 2021 return ec._OuterObject(ctx, field.Selections, res[idx1][idx2]) 2022 }() 2023 } 2024 if isLen1 { 2025 f(idx2) 2026 } else { 2027 go f(idx2) 2028 } 2029 2030 } 2031 2032 return arr2 2033 }() 2034 } 2035 if isLen1 { 2036 f(idx1) 2037 } else { 2038 go f(idx1) 2039 } 2040 2041 } 2042 wg.Wait() 2043 return arr1 2044 } 2045 2046 // nolint: vetshadow 2047 func (ec *executionContext) _Query_keywords(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2048 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2049 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2050 rawArgs := field.ArgumentMap(ec.Variables) 2051 args, err := field_Query_keywords_args(rawArgs) 2052 if err != nil { 2053 ec.Error(ctx, err) 2054 return graphql.Null 2055 } 2056 rctx := &graphql.ResolverContext{ 2057 Object: "Query", 2058 Args: args, 2059 Field: field, 2060 } 2061 ctx = graphql.WithResolverContext(ctx, rctx) 2062 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2063 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2064 ctx = rctx // use context from middleware stack in children 2065 return ec.resolvers.Query().Keywords(rctx, args["input"].(*Keywords)) 2066 }) 2067 if resTmp == nil { 2068 if !ec.HasError(rctx) { 2069 ec.Errorf(ctx, "must not be null") 2070 } 2071 return graphql.Null 2072 } 2073 res := resTmp.(bool) 2074 rctx.Result = res 2075 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2076 return graphql.MarshalBoolean(res) 2077 } 2078 2079 // nolint: vetshadow 2080 func (ec *executionContext) _Query_shapes(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2081 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2082 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2083 rctx := &graphql.ResolverContext{ 2084 Object: "Query", 2085 Args: nil, 2086 Field: field, 2087 } 2088 ctx = graphql.WithResolverContext(ctx, rctx) 2089 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2090 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2091 ctx = rctx // use context from middleware stack in children 2092 return ec.resolvers.Query().Shapes(rctx) 2093 }) 2094 if resTmp == nil { 2095 return graphql.Null 2096 } 2097 res := resTmp.([]*Shape) 2098 rctx.Result = res 2099 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2100 2101 arr1 := make(graphql.Array, len(res)) 2102 var wg sync.WaitGroup 2103 2104 isLen1 := len(res) == 1 2105 if !isLen1 { 2106 wg.Add(len(res)) 2107 } 2108 2109 for idx1 := range res { 2110 idx1 := idx1 2111 rctx := &graphql.ResolverContext{ 2112 Index: &idx1, 2113 Result: res[idx1], 2114 } 2115 ctx := graphql.WithResolverContext(ctx, rctx) 2116 f := func(idx1 int) { 2117 if !isLen1 { 2118 defer wg.Done() 2119 } 2120 arr1[idx1] = func() graphql.Marshaler { 2121 2122 if res[idx1] == nil { 2123 return graphql.Null 2124 } 2125 2126 return ec._Shape(ctx, field.Selections, res[idx1]) 2127 }() 2128 } 2129 if isLen1 { 2130 f(idx1) 2131 } else { 2132 go f(idx1) 2133 } 2134 2135 } 2136 wg.Wait() 2137 return arr1 2138 } 2139 2140 // nolint: vetshadow 2141 func (ec *executionContext) _Query_errorBubble(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2142 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2143 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2144 rctx := &graphql.ResolverContext{ 2145 Object: "Query", 2146 Args: nil, 2147 Field: field, 2148 } 2149 ctx = graphql.WithResolverContext(ctx, rctx) 2150 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2151 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2152 ctx = rctx // use context from middleware stack in children 2153 return ec.resolvers.Query().ErrorBubble(rctx) 2154 }) 2155 if resTmp == nil { 2156 return graphql.Null 2157 } 2158 res := resTmp.(*Error) 2159 rctx.Result = res 2160 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2161 2162 if res == nil { 2163 return graphql.Null 2164 } 2165 2166 return ec._Error(ctx, field.Selections, res) 2167 } 2168 2169 // nolint: vetshadow 2170 func (ec *executionContext) _Query_modelMethods(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2171 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2172 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2173 rctx := &graphql.ResolverContext{ 2174 Object: "Query", 2175 Args: nil, 2176 Field: field, 2177 } 2178 ctx = graphql.WithResolverContext(ctx, rctx) 2179 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2180 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2181 ctx = rctx // use context from middleware stack in children 2182 return ec.resolvers.Query().ModelMethods(rctx) 2183 }) 2184 if resTmp == nil { 2185 return graphql.Null 2186 } 2187 res := resTmp.(*ModelMethods) 2188 rctx.Result = res 2189 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2190 2191 if res == nil { 2192 return graphql.Null 2193 } 2194 2195 return ec._ModelMethods(ctx, field.Selections, res) 2196 } 2197 2198 // nolint: vetshadow 2199 func (ec *executionContext) _Query_valid(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2200 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2201 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2202 rctx := &graphql.ResolverContext{ 2203 Object: "Query", 2204 Args: nil, 2205 Field: field, 2206 } 2207 ctx = graphql.WithResolverContext(ctx, rctx) 2208 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2209 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2210 ctx = rctx // use context from middleware stack in children 2211 return ec.resolvers.Query().Valid(rctx) 2212 }) 2213 if resTmp == nil { 2214 if !ec.HasError(rctx) { 2215 ec.Errorf(ctx, "must not be null") 2216 } 2217 return graphql.Null 2218 } 2219 res := resTmp.(string) 2220 rctx.Result = res 2221 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2222 return graphql.MarshalString(res) 2223 } 2224 2225 // nolint: vetshadow 2226 func (ec *executionContext) _Query_user(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2227 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2228 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2229 rawArgs := field.ArgumentMap(ec.Variables) 2230 args, err := field_Query_user_args(rawArgs) 2231 if err != nil { 2232 ec.Error(ctx, err) 2233 return graphql.Null 2234 } 2235 rctx := &graphql.ResolverContext{ 2236 Object: "Query", 2237 Args: args, 2238 Field: field, 2239 } 2240 ctx = graphql.WithResolverContext(ctx, rctx) 2241 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2242 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2243 ctx = rctx // use context from middleware stack in children 2244 return ec.resolvers.Query().User(rctx, args["id"].(int)) 2245 }) 2246 if resTmp == nil { 2247 if !ec.HasError(rctx) { 2248 ec.Errorf(ctx, "must not be null") 2249 } 2250 return graphql.Null 2251 } 2252 res := resTmp.(User) 2253 rctx.Result = res 2254 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2255 2256 return ec._User(ctx, field.Selections, &res) 2257 } 2258 2259 // nolint: vetshadow 2260 func (ec *executionContext) _Query_nullableArg(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2261 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2262 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2263 rawArgs := field.ArgumentMap(ec.Variables) 2264 args, err := field_Query_nullableArg_args(rawArgs) 2265 if err != nil { 2266 ec.Error(ctx, err) 2267 return graphql.Null 2268 } 2269 rctx := &graphql.ResolverContext{ 2270 Object: "Query", 2271 Args: args, 2272 Field: field, 2273 } 2274 ctx = graphql.WithResolverContext(ctx, rctx) 2275 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2276 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2277 ctx = rctx // use context from middleware stack in children 2278 return ec.resolvers.Query().NullableArg(rctx, args["arg"].(*int)) 2279 }) 2280 if resTmp == nil { 2281 return graphql.Null 2282 } 2283 res := resTmp.(*string) 2284 rctx.Result = res 2285 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2286 2287 if res == nil { 2288 return graphql.Null 2289 } 2290 return graphql.MarshalString(*res) 2291 } 2292 2293 // nolint: vetshadow 2294 func (ec *executionContext) _Query_keywordArgs(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2295 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2296 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2297 rawArgs := field.ArgumentMap(ec.Variables) 2298 args, err := field_Query_keywordArgs_args(rawArgs) 2299 if err != nil { 2300 ec.Error(ctx, err) 2301 return graphql.Null 2302 } 2303 rctx := &graphql.ResolverContext{ 2304 Object: "Query", 2305 Args: args, 2306 Field: field, 2307 } 2308 ctx = graphql.WithResolverContext(ctx, rctx) 2309 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2310 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2311 ctx = rctx // use context from middleware stack in children 2312 return ec.resolvers.Query().KeywordArgs(rctx, args["break"].(string), args["default"].(string), args["func"].(string), args["interface"].(string), args["select"].(string), args["case"].(string), args["defer"].(string), args["go"].(string), args["map"].(string), args["struct"].(string), args["chan"].(string), args["else"].(string), args["goto"].(string), args["package"].(string), args["switch"].(string), args["const"].(string), args["fallthrough"].(string), args["if"].(string), args["range"].(string), args["type"].(string), args["continue"].(string), args["for"].(string), args["import"].(string), args["return"].(string), args["var"].(string)) 2313 }) 2314 if resTmp == nil { 2315 if !ec.HasError(rctx) { 2316 ec.Errorf(ctx, "must not be null") 2317 } 2318 return graphql.Null 2319 } 2320 res := resTmp.(bool) 2321 rctx.Result = res 2322 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2323 return graphql.MarshalBoolean(res) 2324 } 2325 2326 // nolint: vetshadow 2327 func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2328 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2329 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2330 rawArgs := field.ArgumentMap(ec.Variables) 2331 args, err := field_Query___type_args(rawArgs) 2332 if err != nil { 2333 ec.Error(ctx, err) 2334 return graphql.Null 2335 } 2336 rctx := &graphql.ResolverContext{ 2337 Object: "Query", 2338 Args: args, 2339 Field: field, 2340 } 2341 ctx = graphql.WithResolverContext(ctx, rctx) 2342 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2343 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2344 ctx = rctx // use context from middleware stack in children 2345 return ec.introspectType(args["name"].(string)) 2346 }) 2347 if resTmp == nil { 2348 return graphql.Null 2349 } 2350 res := resTmp.(*introspection.Type) 2351 rctx.Result = res 2352 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2353 2354 if res == nil { 2355 return graphql.Null 2356 } 2357 2358 return ec.___Type(ctx, field.Selections, res) 2359 } 2360 2361 // nolint: vetshadow 2362 func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { 2363 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2364 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2365 rctx := &graphql.ResolverContext{ 2366 Object: "Query", 2367 Args: nil, 2368 Field: field, 2369 } 2370 ctx = graphql.WithResolverContext(ctx, rctx) 2371 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2372 resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { 2373 ctx = rctx // use context from middleware stack in children 2374 return ec.introspectSchema() 2375 }) 2376 if resTmp == nil { 2377 return graphql.Null 2378 } 2379 res := resTmp.(*introspection.Schema) 2380 rctx.Result = res 2381 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2382 2383 if res == nil { 2384 return graphql.Null 2385 } 2386 2387 return ec.___Schema(ctx, field.Selections, res) 2388 } 2389 2390 var rectangleImplementors = []string{"Rectangle", "Shape"} 2391 2392 // nolint: gocyclo, errcheck, gas, goconst 2393 func (ec *executionContext) _Rectangle(ctx context.Context, sel ast.SelectionSet, obj *Rectangle) graphql.Marshaler { 2394 fields := graphql.CollectFields(ctx, sel, rectangleImplementors) 2395 2396 out := graphql.NewOrderedMap(len(fields)) 2397 invalid := false 2398 for i, field := range fields { 2399 out.Keys[i] = field.Alias 2400 2401 switch field.Name { 2402 case "__typename": 2403 out.Values[i] = graphql.MarshalString("Rectangle") 2404 case "length": 2405 out.Values[i] = ec._Rectangle_length(ctx, field, obj) 2406 case "width": 2407 out.Values[i] = ec._Rectangle_width(ctx, field, obj) 2408 case "area": 2409 out.Values[i] = ec._Rectangle_area(ctx, field, obj) 2410 default: 2411 panic("unknown field " + strconv.Quote(field.Name)) 2412 } 2413 } 2414 2415 if invalid { 2416 return graphql.Null 2417 } 2418 return out 2419 } 2420 2421 // nolint: vetshadow 2422 func (ec *executionContext) _Rectangle_length(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { 2423 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2424 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2425 rctx := &graphql.ResolverContext{ 2426 Object: "Rectangle", 2427 Args: nil, 2428 Field: field, 2429 } 2430 ctx = graphql.WithResolverContext(ctx, rctx) 2431 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2432 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2433 ctx = rctx // use context from middleware stack in children 2434 return obj.Length, nil 2435 }) 2436 if resTmp == nil { 2437 return graphql.Null 2438 } 2439 res := resTmp.(float64) 2440 rctx.Result = res 2441 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2442 return graphql.MarshalFloat(res) 2443 } 2444 2445 // nolint: vetshadow 2446 func (ec *executionContext) _Rectangle_width(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { 2447 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2448 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2449 rctx := &graphql.ResolverContext{ 2450 Object: "Rectangle", 2451 Args: nil, 2452 Field: field, 2453 } 2454 ctx = graphql.WithResolverContext(ctx, rctx) 2455 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2456 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2457 ctx = rctx // use context from middleware stack in children 2458 return obj.Width, nil 2459 }) 2460 if resTmp == nil { 2461 return graphql.Null 2462 } 2463 res := resTmp.(float64) 2464 rctx.Result = res 2465 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2466 return graphql.MarshalFloat(res) 2467 } 2468 2469 // nolint: vetshadow 2470 func (ec *executionContext) _Rectangle_area(ctx context.Context, field graphql.CollectedField, obj *Rectangle) graphql.Marshaler { 2471 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2472 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2473 rctx := &graphql.ResolverContext{ 2474 Object: "Rectangle", 2475 Args: nil, 2476 Field: field, 2477 } 2478 ctx = graphql.WithResolverContext(ctx, rctx) 2479 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2480 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2481 ctx = rctx // use context from middleware stack in children 2482 return obj.Area(), nil 2483 }) 2484 if resTmp == nil { 2485 return graphql.Null 2486 } 2487 res := resTmp.(float64) 2488 rctx.Result = res 2489 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2490 return graphql.MarshalFloat(res) 2491 } 2492 2493 var subscriptionImplementors = []string{"Subscription"} 2494 2495 // nolint: gocyclo, errcheck, gas, goconst 2496 func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler { 2497 fields := graphql.CollectFields(ctx, sel, subscriptionImplementors) 2498 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ 2499 Object: "Subscription", 2500 }) 2501 if len(fields) != 1 { 2502 ec.Errorf(ctx, "must subscribe to exactly one stream") 2503 return nil 2504 } 2505 2506 switch fields[0].Name { 2507 case "updated": 2508 return ec._Subscription_updated(ctx, fields[0]) 2509 case "initPayload": 2510 return ec._Subscription_initPayload(ctx, fields[0]) 2511 default: 2512 panic("unknown field " + strconv.Quote(fields[0].Name)) 2513 } 2514 } 2515 2516 func (ec *executionContext) _Subscription_updated(ctx context.Context, field graphql.CollectedField) func() graphql.Marshaler { 2517 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ 2518 Field: field, 2519 }) 2520 // FIXME: subscriptions are missing request middleware stack https://github.com/99designs/gqlgen/issues/259 2521 // and Tracer stack 2522 rctx := ctx 2523 results, err := ec.resolvers.Subscription().Updated(rctx) 2524 if err != nil { 2525 ec.Error(ctx, err) 2526 return nil 2527 } 2528 return func() graphql.Marshaler { 2529 res, ok := <-results 2530 if !ok { 2531 return nil 2532 } 2533 var out graphql.OrderedMap 2534 out.Add(field.Alias, func() graphql.Marshaler { return graphql.MarshalString(res) }()) 2535 return &out 2536 } 2537 } 2538 2539 func (ec *executionContext) _Subscription_initPayload(ctx context.Context, field graphql.CollectedField) func() graphql.Marshaler { 2540 ctx = graphql.WithResolverContext(ctx, &graphql.ResolverContext{ 2541 Field: field, 2542 }) 2543 // FIXME: subscriptions are missing request middleware stack https://github.com/99designs/gqlgen/issues/259 2544 // and Tracer stack 2545 rctx := ctx 2546 results, err := ec.resolvers.Subscription().InitPayload(rctx) 2547 if err != nil { 2548 ec.Error(ctx, err) 2549 return nil 2550 } 2551 return func() graphql.Marshaler { 2552 res, ok := <-results 2553 if !ok { 2554 return nil 2555 } 2556 var out graphql.OrderedMap 2557 out.Add(field.Alias, func() graphql.Marshaler { return graphql.MarshalString(res) }()) 2558 return &out 2559 } 2560 } 2561 2562 var userImplementors = []string{"User"} 2563 2564 // nolint: gocyclo, errcheck, gas, goconst 2565 func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *User) graphql.Marshaler { 2566 fields := graphql.CollectFields(ctx, sel, userImplementors) 2567 2568 var wg sync.WaitGroup 2569 out := graphql.NewOrderedMap(len(fields)) 2570 invalid := false 2571 for i, field := range fields { 2572 out.Keys[i] = field.Alias 2573 2574 switch field.Name { 2575 case "__typename": 2576 out.Values[i] = graphql.MarshalString("User") 2577 case "id": 2578 out.Values[i] = ec._User_id(ctx, field, obj) 2579 if out.Values[i] == graphql.Null { 2580 invalid = true 2581 } 2582 case "friends": 2583 wg.Add(1) 2584 go func(i int, field graphql.CollectedField) { 2585 out.Values[i] = ec._User_friends(ctx, field, obj) 2586 if out.Values[i] == graphql.Null { 2587 invalid = true 2588 } 2589 wg.Done() 2590 }(i, field) 2591 default: 2592 panic("unknown field " + strconv.Quote(field.Name)) 2593 } 2594 } 2595 wg.Wait() 2596 if invalid { 2597 return graphql.Null 2598 } 2599 return out 2600 } 2601 2602 // nolint: vetshadow 2603 func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { 2604 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2605 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2606 rctx := &graphql.ResolverContext{ 2607 Object: "User", 2608 Args: nil, 2609 Field: field, 2610 } 2611 ctx = graphql.WithResolverContext(ctx, rctx) 2612 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2613 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2614 ctx = rctx // use context from middleware stack in children 2615 return obj.ID, nil 2616 }) 2617 if resTmp == nil { 2618 if !ec.HasError(rctx) { 2619 ec.Errorf(ctx, "must not be null") 2620 } 2621 return graphql.Null 2622 } 2623 res := resTmp.(int) 2624 rctx.Result = res 2625 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2626 return graphql.MarshalInt(res) 2627 } 2628 2629 // nolint: vetshadow 2630 func (ec *executionContext) _User_friends(ctx context.Context, field graphql.CollectedField, obj *User) graphql.Marshaler { 2631 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2632 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2633 rctx := &graphql.ResolverContext{ 2634 Object: "User", 2635 Args: nil, 2636 Field: field, 2637 } 2638 ctx = graphql.WithResolverContext(ctx, rctx) 2639 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2640 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2641 ctx = rctx // use context from middleware stack in children 2642 return ec.resolvers.User().Friends(rctx, obj) 2643 }) 2644 if resTmp == nil { 2645 if !ec.HasError(rctx) { 2646 ec.Errorf(ctx, "must not be null") 2647 } 2648 return graphql.Null 2649 } 2650 res := resTmp.([]User) 2651 rctx.Result = res 2652 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2653 2654 arr1 := make(graphql.Array, len(res)) 2655 var wg sync.WaitGroup 2656 2657 isLen1 := len(res) == 1 2658 if !isLen1 { 2659 wg.Add(len(res)) 2660 } 2661 2662 for idx1 := range res { 2663 idx1 := idx1 2664 rctx := &graphql.ResolverContext{ 2665 Index: &idx1, 2666 Result: &res[idx1], 2667 } 2668 ctx := graphql.WithResolverContext(ctx, rctx) 2669 f := func(idx1 int) { 2670 if !isLen1 { 2671 defer wg.Done() 2672 } 2673 arr1[idx1] = func() graphql.Marshaler { 2674 2675 return ec._User(ctx, field.Selections, &res[idx1]) 2676 }() 2677 } 2678 if isLen1 { 2679 f(idx1) 2680 } else { 2681 go f(idx1) 2682 } 2683 2684 } 2685 wg.Wait() 2686 return arr1 2687 } 2688 2689 var __DirectiveImplementors = []string{"__Directive"} 2690 2691 // nolint: gocyclo, errcheck, gas, goconst 2692 func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { 2693 fields := graphql.CollectFields(ctx, sel, __DirectiveImplementors) 2694 2695 out := graphql.NewOrderedMap(len(fields)) 2696 invalid := false 2697 for i, field := range fields { 2698 out.Keys[i] = field.Alias 2699 2700 switch field.Name { 2701 case "__typename": 2702 out.Values[i] = graphql.MarshalString("__Directive") 2703 case "name": 2704 out.Values[i] = ec.___Directive_name(ctx, field, obj) 2705 if out.Values[i] == graphql.Null { 2706 invalid = true 2707 } 2708 case "description": 2709 out.Values[i] = ec.___Directive_description(ctx, field, obj) 2710 case "locations": 2711 out.Values[i] = ec.___Directive_locations(ctx, field, obj) 2712 if out.Values[i] == graphql.Null { 2713 invalid = true 2714 } 2715 case "args": 2716 out.Values[i] = ec.___Directive_args(ctx, field, obj) 2717 if out.Values[i] == graphql.Null { 2718 invalid = true 2719 } 2720 default: 2721 panic("unknown field " + strconv.Quote(field.Name)) 2722 } 2723 } 2724 2725 if invalid { 2726 return graphql.Null 2727 } 2728 return out 2729 } 2730 2731 // nolint: vetshadow 2732 func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 2733 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2734 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2735 rctx := &graphql.ResolverContext{ 2736 Object: "__Directive", 2737 Args: nil, 2738 Field: field, 2739 } 2740 ctx = graphql.WithResolverContext(ctx, rctx) 2741 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2742 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2743 ctx = rctx // use context from middleware stack in children 2744 return obj.Name, nil 2745 }) 2746 if resTmp == nil { 2747 if !ec.HasError(rctx) { 2748 ec.Errorf(ctx, "must not be null") 2749 } 2750 return graphql.Null 2751 } 2752 res := resTmp.(string) 2753 rctx.Result = res 2754 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2755 return graphql.MarshalString(res) 2756 } 2757 2758 // nolint: vetshadow 2759 func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 2760 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2761 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2762 rctx := &graphql.ResolverContext{ 2763 Object: "__Directive", 2764 Args: nil, 2765 Field: field, 2766 } 2767 ctx = graphql.WithResolverContext(ctx, rctx) 2768 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2769 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2770 ctx = rctx // use context from middleware stack in children 2771 return obj.Description, nil 2772 }) 2773 if resTmp == nil { 2774 return graphql.Null 2775 } 2776 res := resTmp.(string) 2777 rctx.Result = res 2778 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2779 return graphql.MarshalString(res) 2780 } 2781 2782 // nolint: vetshadow 2783 func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 2784 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2785 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2786 rctx := &graphql.ResolverContext{ 2787 Object: "__Directive", 2788 Args: nil, 2789 Field: field, 2790 } 2791 ctx = graphql.WithResolverContext(ctx, rctx) 2792 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2793 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2794 ctx = rctx // use context from middleware stack in children 2795 return obj.Locations, nil 2796 }) 2797 if resTmp == nil { 2798 if !ec.HasError(rctx) { 2799 ec.Errorf(ctx, "must not be null") 2800 } 2801 return graphql.Null 2802 } 2803 res := resTmp.([]string) 2804 rctx.Result = res 2805 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2806 2807 arr1 := make(graphql.Array, len(res)) 2808 2809 for idx1 := range res { 2810 arr1[idx1] = func() graphql.Marshaler { 2811 return graphql.MarshalString(res[idx1]) 2812 }() 2813 } 2814 2815 return arr1 2816 } 2817 2818 // nolint: vetshadow 2819 func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) graphql.Marshaler { 2820 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2821 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2822 rctx := &graphql.ResolverContext{ 2823 Object: "__Directive", 2824 Args: nil, 2825 Field: field, 2826 } 2827 ctx = graphql.WithResolverContext(ctx, rctx) 2828 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2829 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2830 ctx = rctx // use context from middleware stack in children 2831 return obj.Args, nil 2832 }) 2833 if resTmp == nil { 2834 if !ec.HasError(rctx) { 2835 ec.Errorf(ctx, "must not be null") 2836 } 2837 return graphql.Null 2838 } 2839 res := resTmp.([]introspection.InputValue) 2840 rctx.Result = res 2841 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2842 2843 arr1 := make(graphql.Array, len(res)) 2844 var wg sync.WaitGroup 2845 2846 isLen1 := len(res) == 1 2847 if !isLen1 { 2848 wg.Add(len(res)) 2849 } 2850 2851 for idx1 := range res { 2852 idx1 := idx1 2853 rctx := &graphql.ResolverContext{ 2854 Index: &idx1, 2855 Result: &res[idx1], 2856 } 2857 ctx := graphql.WithResolverContext(ctx, rctx) 2858 f := func(idx1 int) { 2859 if !isLen1 { 2860 defer wg.Done() 2861 } 2862 arr1[idx1] = func() graphql.Marshaler { 2863 2864 return ec.___InputValue(ctx, field.Selections, &res[idx1]) 2865 }() 2866 } 2867 if isLen1 { 2868 f(idx1) 2869 } else { 2870 go f(idx1) 2871 } 2872 2873 } 2874 wg.Wait() 2875 return arr1 2876 } 2877 2878 var __EnumValueImplementors = []string{"__EnumValue"} 2879 2880 // nolint: gocyclo, errcheck, gas, goconst 2881 func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { 2882 fields := graphql.CollectFields(ctx, sel, __EnumValueImplementors) 2883 2884 out := graphql.NewOrderedMap(len(fields)) 2885 invalid := false 2886 for i, field := range fields { 2887 out.Keys[i] = field.Alias 2888 2889 switch field.Name { 2890 case "__typename": 2891 out.Values[i] = graphql.MarshalString("__EnumValue") 2892 case "name": 2893 out.Values[i] = ec.___EnumValue_name(ctx, field, obj) 2894 if out.Values[i] == graphql.Null { 2895 invalid = true 2896 } 2897 case "description": 2898 out.Values[i] = ec.___EnumValue_description(ctx, field, obj) 2899 case "isDeprecated": 2900 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) 2901 if out.Values[i] == graphql.Null { 2902 invalid = true 2903 } 2904 case "deprecationReason": 2905 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) 2906 default: 2907 panic("unknown field " + strconv.Quote(field.Name)) 2908 } 2909 } 2910 2911 if invalid { 2912 return graphql.Null 2913 } 2914 return out 2915 } 2916 2917 // nolint: vetshadow 2918 func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 2919 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2920 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2921 rctx := &graphql.ResolverContext{ 2922 Object: "__EnumValue", 2923 Args: nil, 2924 Field: field, 2925 } 2926 ctx = graphql.WithResolverContext(ctx, rctx) 2927 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2928 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2929 ctx = rctx // use context from middleware stack in children 2930 return obj.Name, nil 2931 }) 2932 if resTmp == nil { 2933 if !ec.HasError(rctx) { 2934 ec.Errorf(ctx, "must not be null") 2935 } 2936 return graphql.Null 2937 } 2938 res := resTmp.(string) 2939 rctx.Result = res 2940 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2941 return graphql.MarshalString(res) 2942 } 2943 2944 // nolint: vetshadow 2945 func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 2946 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2947 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2948 rctx := &graphql.ResolverContext{ 2949 Object: "__EnumValue", 2950 Args: nil, 2951 Field: field, 2952 } 2953 ctx = graphql.WithResolverContext(ctx, rctx) 2954 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2955 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2956 ctx = rctx // use context from middleware stack in children 2957 return obj.Description, nil 2958 }) 2959 if resTmp == nil { 2960 return graphql.Null 2961 } 2962 res := resTmp.(string) 2963 rctx.Result = res 2964 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2965 return graphql.MarshalString(res) 2966 } 2967 2968 // nolint: vetshadow 2969 func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 2970 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2971 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2972 rctx := &graphql.ResolverContext{ 2973 Object: "__EnumValue", 2974 Args: nil, 2975 Field: field, 2976 } 2977 ctx = graphql.WithResolverContext(ctx, rctx) 2978 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 2979 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 2980 ctx = rctx // use context from middleware stack in children 2981 return obj.IsDeprecated(), nil 2982 }) 2983 if resTmp == nil { 2984 if !ec.HasError(rctx) { 2985 ec.Errorf(ctx, "must not be null") 2986 } 2987 return graphql.Null 2988 } 2989 res := resTmp.(bool) 2990 rctx.Result = res 2991 ctx = ec.Tracer.StartFieldChildExecution(ctx) 2992 return graphql.MarshalBoolean(res) 2993 } 2994 2995 // nolint: vetshadow 2996 func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) graphql.Marshaler { 2997 ctx = ec.Tracer.StartFieldExecution(ctx, field) 2998 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 2999 rctx := &graphql.ResolverContext{ 3000 Object: "__EnumValue", 3001 Args: nil, 3002 Field: field, 3003 } 3004 ctx = graphql.WithResolverContext(ctx, rctx) 3005 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3006 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3007 ctx = rctx // use context from middleware stack in children 3008 return obj.DeprecationReason(), nil 3009 }) 3010 if resTmp == nil { 3011 return graphql.Null 3012 } 3013 res := resTmp.(*string) 3014 rctx.Result = res 3015 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3016 3017 if res == nil { 3018 return graphql.Null 3019 } 3020 return graphql.MarshalString(*res) 3021 } 3022 3023 var __FieldImplementors = []string{"__Field"} 3024 3025 // nolint: gocyclo, errcheck, gas, goconst 3026 func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { 3027 fields := graphql.CollectFields(ctx, sel, __FieldImplementors) 3028 3029 out := graphql.NewOrderedMap(len(fields)) 3030 invalid := false 3031 for i, field := range fields { 3032 out.Keys[i] = field.Alias 3033 3034 switch field.Name { 3035 case "__typename": 3036 out.Values[i] = graphql.MarshalString("__Field") 3037 case "name": 3038 out.Values[i] = ec.___Field_name(ctx, field, obj) 3039 if out.Values[i] == graphql.Null { 3040 invalid = true 3041 } 3042 case "description": 3043 out.Values[i] = ec.___Field_description(ctx, field, obj) 3044 case "args": 3045 out.Values[i] = ec.___Field_args(ctx, field, obj) 3046 if out.Values[i] == graphql.Null { 3047 invalid = true 3048 } 3049 case "type": 3050 out.Values[i] = ec.___Field_type(ctx, field, obj) 3051 if out.Values[i] == graphql.Null { 3052 invalid = true 3053 } 3054 case "isDeprecated": 3055 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) 3056 if out.Values[i] == graphql.Null { 3057 invalid = true 3058 } 3059 case "deprecationReason": 3060 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) 3061 default: 3062 panic("unknown field " + strconv.Quote(field.Name)) 3063 } 3064 } 3065 3066 if invalid { 3067 return graphql.Null 3068 } 3069 return out 3070 } 3071 3072 // nolint: vetshadow 3073 func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 3074 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3075 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3076 rctx := &graphql.ResolverContext{ 3077 Object: "__Field", 3078 Args: nil, 3079 Field: field, 3080 } 3081 ctx = graphql.WithResolverContext(ctx, rctx) 3082 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3083 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3084 ctx = rctx // use context from middleware stack in children 3085 return obj.Name, nil 3086 }) 3087 if resTmp == nil { 3088 if !ec.HasError(rctx) { 3089 ec.Errorf(ctx, "must not be null") 3090 } 3091 return graphql.Null 3092 } 3093 res := resTmp.(string) 3094 rctx.Result = res 3095 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3096 return graphql.MarshalString(res) 3097 } 3098 3099 // nolint: vetshadow 3100 func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 3101 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3102 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3103 rctx := &graphql.ResolverContext{ 3104 Object: "__Field", 3105 Args: nil, 3106 Field: field, 3107 } 3108 ctx = graphql.WithResolverContext(ctx, rctx) 3109 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3110 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3111 ctx = rctx // use context from middleware stack in children 3112 return obj.Description, nil 3113 }) 3114 if resTmp == nil { 3115 return graphql.Null 3116 } 3117 res := resTmp.(string) 3118 rctx.Result = res 3119 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3120 return graphql.MarshalString(res) 3121 } 3122 3123 // nolint: vetshadow 3124 func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 3125 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3126 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3127 rctx := &graphql.ResolverContext{ 3128 Object: "__Field", 3129 Args: nil, 3130 Field: field, 3131 } 3132 ctx = graphql.WithResolverContext(ctx, rctx) 3133 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3134 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3135 ctx = rctx // use context from middleware stack in children 3136 return obj.Args, nil 3137 }) 3138 if resTmp == nil { 3139 if !ec.HasError(rctx) { 3140 ec.Errorf(ctx, "must not be null") 3141 } 3142 return graphql.Null 3143 } 3144 res := resTmp.([]introspection.InputValue) 3145 rctx.Result = res 3146 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3147 3148 arr1 := make(graphql.Array, len(res)) 3149 var wg sync.WaitGroup 3150 3151 isLen1 := len(res) == 1 3152 if !isLen1 { 3153 wg.Add(len(res)) 3154 } 3155 3156 for idx1 := range res { 3157 idx1 := idx1 3158 rctx := &graphql.ResolverContext{ 3159 Index: &idx1, 3160 Result: &res[idx1], 3161 } 3162 ctx := graphql.WithResolverContext(ctx, rctx) 3163 f := func(idx1 int) { 3164 if !isLen1 { 3165 defer wg.Done() 3166 } 3167 arr1[idx1] = func() graphql.Marshaler { 3168 3169 return ec.___InputValue(ctx, field.Selections, &res[idx1]) 3170 }() 3171 } 3172 if isLen1 { 3173 f(idx1) 3174 } else { 3175 go f(idx1) 3176 } 3177 3178 } 3179 wg.Wait() 3180 return arr1 3181 } 3182 3183 // nolint: vetshadow 3184 func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 3185 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3186 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3187 rctx := &graphql.ResolverContext{ 3188 Object: "__Field", 3189 Args: nil, 3190 Field: field, 3191 } 3192 ctx = graphql.WithResolverContext(ctx, rctx) 3193 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3194 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3195 ctx = rctx // use context from middleware stack in children 3196 return obj.Type, nil 3197 }) 3198 if resTmp == nil { 3199 if !ec.HasError(rctx) { 3200 ec.Errorf(ctx, "must not be null") 3201 } 3202 return graphql.Null 3203 } 3204 res := resTmp.(*introspection.Type) 3205 rctx.Result = res 3206 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3207 3208 if res == nil { 3209 if !ec.HasError(rctx) { 3210 ec.Errorf(ctx, "must not be null") 3211 } 3212 return graphql.Null 3213 } 3214 3215 return ec.___Type(ctx, field.Selections, res) 3216 } 3217 3218 // nolint: vetshadow 3219 func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 3220 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3221 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3222 rctx := &graphql.ResolverContext{ 3223 Object: "__Field", 3224 Args: nil, 3225 Field: field, 3226 } 3227 ctx = graphql.WithResolverContext(ctx, rctx) 3228 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3229 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3230 ctx = rctx // use context from middleware stack in children 3231 return obj.IsDeprecated(), nil 3232 }) 3233 if resTmp == nil { 3234 if !ec.HasError(rctx) { 3235 ec.Errorf(ctx, "must not be null") 3236 } 3237 return graphql.Null 3238 } 3239 res := resTmp.(bool) 3240 rctx.Result = res 3241 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3242 return graphql.MarshalBoolean(res) 3243 } 3244 3245 // nolint: vetshadow 3246 func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) graphql.Marshaler { 3247 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3248 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3249 rctx := &graphql.ResolverContext{ 3250 Object: "__Field", 3251 Args: nil, 3252 Field: field, 3253 } 3254 ctx = graphql.WithResolverContext(ctx, rctx) 3255 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3256 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3257 ctx = rctx // use context from middleware stack in children 3258 return obj.DeprecationReason(), nil 3259 }) 3260 if resTmp == nil { 3261 return graphql.Null 3262 } 3263 res := resTmp.(*string) 3264 rctx.Result = res 3265 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3266 3267 if res == nil { 3268 return graphql.Null 3269 } 3270 return graphql.MarshalString(*res) 3271 } 3272 3273 var __InputValueImplementors = []string{"__InputValue"} 3274 3275 // nolint: gocyclo, errcheck, gas, goconst 3276 func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { 3277 fields := graphql.CollectFields(ctx, sel, __InputValueImplementors) 3278 3279 out := graphql.NewOrderedMap(len(fields)) 3280 invalid := false 3281 for i, field := range fields { 3282 out.Keys[i] = field.Alias 3283 3284 switch field.Name { 3285 case "__typename": 3286 out.Values[i] = graphql.MarshalString("__InputValue") 3287 case "name": 3288 out.Values[i] = ec.___InputValue_name(ctx, field, obj) 3289 if out.Values[i] == graphql.Null { 3290 invalid = true 3291 } 3292 case "description": 3293 out.Values[i] = ec.___InputValue_description(ctx, field, obj) 3294 case "type": 3295 out.Values[i] = ec.___InputValue_type(ctx, field, obj) 3296 if out.Values[i] == graphql.Null { 3297 invalid = true 3298 } 3299 case "defaultValue": 3300 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) 3301 default: 3302 panic("unknown field " + strconv.Quote(field.Name)) 3303 } 3304 } 3305 3306 if invalid { 3307 return graphql.Null 3308 } 3309 return out 3310 } 3311 3312 // nolint: vetshadow 3313 func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 3314 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3315 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3316 rctx := &graphql.ResolverContext{ 3317 Object: "__InputValue", 3318 Args: nil, 3319 Field: field, 3320 } 3321 ctx = graphql.WithResolverContext(ctx, rctx) 3322 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3323 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3324 ctx = rctx // use context from middleware stack in children 3325 return obj.Name, nil 3326 }) 3327 if resTmp == nil { 3328 if !ec.HasError(rctx) { 3329 ec.Errorf(ctx, "must not be null") 3330 } 3331 return graphql.Null 3332 } 3333 res := resTmp.(string) 3334 rctx.Result = res 3335 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3336 return graphql.MarshalString(res) 3337 } 3338 3339 // nolint: vetshadow 3340 func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 3341 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3342 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3343 rctx := &graphql.ResolverContext{ 3344 Object: "__InputValue", 3345 Args: nil, 3346 Field: field, 3347 } 3348 ctx = graphql.WithResolverContext(ctx, rctx) 3349 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3350 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3351 ctx = rctx // use context from middleware stack in children 3352 return obj.Description, nil 3353 }) 3354 if resTmp == nil { 3355 return graphql.Null 3356 } 3357 res := resTmp.(string) 3358 rctx.Result = res 3359 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3360 return graphql.MarshalString(res) 3361 } 3362 3363 // nolint: vetshadow 3364 func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 3365 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3366 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3367 rctx := &graphql.ResolverContext{ 3368 Object: "__InputValue", 3369 Args: nil, 3370 Field: field, 3371 } 3372 ctx = graphql.WithResolverContext(ctx, rctx) 3373 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3374 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3375 ctx = rctx // use context from middleware stack in children 3376 return obj.Type, nil 3377 }) 3378 if resTmp == nil { 3379 if !ec.HasError(rctx) { 3380 ec.Errorf(ctx, "must not be null") 3381 } 3382 return graphql.Null 3383 } 3384 res := resTmp.(*introspection.Type) 3385 rctx.Result = res 3386 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3387 3388 if res == nil { 3389 if !ec.HasError(rctx) { 3390 ec.Errorf(ctx, "must not be null") 3391 } 3392 return graphql.Null 3393 } 3394 3395 return ec.___Type(ctx, field.Selections, res) 3396 } 3397 3398 // nolint: vetshadow 3399 func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) graphql.Marshaler { 3400 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3401 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3402 rctx := &graphql.ResolverContext{ 3403 Object: "__InputValue", 3404 Args: nil, 3405 Field: field, 3406 } 3407 ctx = graphql.WithResolverContext(ctx, rctx) 3408 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3409 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3410 ctx = rctx // use context from middleware stack in children 3411 return obj.DefaultValue, nil 3412 }) 3413 if resTmp == nil { 3414 return graphql.Null 3415 } 3416 res := resTmp.(*string) 3417 rctx.Result = res 3418 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3419 3420 if res == nil { 3421 return graphql.Null 3422 } 3423 return graphql.MarshalString(*res) 3424 } 3425 3426 var __SchemaImplementors = []string{"__Schema"} 3427 3428 // nolint: gocyclo, errcheck, gas, goconst 3429 func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { 3430 fields := graphql.CollectFields(ctx, sel, __SchemaImplementors) 3431 3432 out := graphql.NewOrderedMap(len(fields)) 3433 invalid := false 3434 for i, field := range fields { 3435 out.Keys[i] = field.Alias 3436 3437 switch field.Name { 3438 case "__typename": 3439 out.Values[i] = graphql.MarshalString("__Schema") 3440 case "types": 3441 out.Values[i] = ec.___Schema_types(ctx, field, obj) 3442 if out.Values[i] == graphql.Null { 3443 invalid = true 3444 } 3445 case "queryType": 3446 out.Values[i] = ec.___Schema_queryType(ctx, field, obj) 3447 if out.Values[i] == graphql.Null { 3448 invalid = true 3449 } 3450 case "mutationType": 3451 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) 3452 case "subscriptionType": 3453 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) 3454 case "directives": 3455 out.Values[i] = ec.___Schema_directives(ctx, field, obj) 3456 if out.Values[i] == graphql.Null { 3457 invalid = true 3458 } 3459 default: 3460 panic("unknown field " + strconv.Quote(field.Name)) 3461 } 3462 } 3463 3464 if invalid { 3465 return graphql.Null 3466 } 3467 return out 3468 } 3469 3470 // nolint: vetshadow 3471 func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 3472 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3473 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3474 rctx := &graphql.ResolverContext{ 3475 Object: "__Schema", 3476 Args: nil, 3477 Field: field, 3478 } 3479 ctx = graphql.WithResolverContext(ctx, rctx) 3480 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3481 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3482 ctx = rctx // use context from middleware stack in children 3483 return obj.Types(), nil 3484 }) 3485 if resTmp == nil { 3486 if !ec.HasError(rctx) { 3487 ec.Errorf(ctx, "must not be null") 3488 } 3489 return graphql.Null 3490 } 3491 res := resTmp.([]introspection.Type) 3492 rctx.Result = res 3493 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3494 3495 arr1 := make(graphql.Array, len(res)) 3496 var wg sync.WaitGroup 3497 3498 isLen1 := len(res) == 1 3499 if !isLen1 { 3500 wg.Add(len(res)) 3501 } 3502 3503 for idx1 := range res { 3504 idx1 := idx1 3505 rctx := &graphql.ResolverContext{ 3506 Index: &idx1, 3507 Result: &res[idx1], 3508 } 3509 ctx := graphql.WithResolverContext(ctx, rctx) 3510 f := func(idx1 int) { 3511 if !isLen1 { 3512 defer wg.Done() 3513 } 3514 arr1[idx1] = func() graphql.Marshaler { 3515 3516 return ec.___Type(ctx, field.Selections, &res[idx1]) 3517 }() 3518 } 3519 if isLen1 { 3520 f(idx1) 3521 } else { 3522 go f(idx1) 3523 } 3524 3525 } 3526 wg.Wait() 3527 return arr1 3528 } 3529 3530 // nolint: vetshadow 3531 func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 3532 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3533 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3534 rctx := &graphql.ResolverContext{ 3535 Object: "__Schema", 3536 Args: nil, 3537 Field: field, 3538 } 3539 ctx = graphql.WithResolverContext(ctx, rctx) 3540 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3541 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3542 ctx = rctx // use context from middleware stack in children 3543 return obj.QueryType(), nil 3544 }) 3545 if resTmp == nil { 3546 if !ec.HasError(rctx) { 3547 ec.Errorf(ctx, "must not be null") 3548 } 3549 return graphql.Null 3550 } 3551 res := resTmp.(*introspection.Type) 3552 rctx.Result = res 3553 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3554 3555 if res == nil { 3556 if !ec.HasError(rctx) { 3557 ec.Errorf(ctx, "must not be null") 3558 } 3559 return graphql.Null 3560 } 3561 3562 return ec.___Type(ctx, field.Selections, res) 3563 } 3564 3565 // nolint: vetshadow 3566 func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 3567 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3568 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3569 rctx := &graphql.ResolverContext{ 3570 Object: "__Schema", 3571 Args: nil, 3572 Field: field, 3573 } 3574 ctx = graphql.WithResolverContext(ctx, rctx) 3575 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3576 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3577 ctx = rctx // use context from middleware stack in children 3578 return obj.MutationType(), nil 3579 }) 3580 if resTmp == nil { 3581 return graphql.Null 3582 } 3583 res := resTmp.(*introspection.Type) 3584 rctx.Result = res 3585 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3586 3587 if res == nil { 3588 return graphql.Null 3589 } 3590 3591 return ec.___Type(ctx, field.Selections, res) 3592 } 3593 3594 // nolint: vetshadow 3595 func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 3596 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3597 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3598 rctx := &graphql.ResolverContext{ 3599 Object: "__Schema", 3600 Args: nil, 3601 Field: field, 3602 } 3603 ctx = graphql.WithResolverContext(ctx, rctx) 3604 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3605 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3606 ctx = rctx // use context from middleware stack in children 3607 return obj.SubscriptionType(), nil 3608 }) 3609 if resTmp == nil { 3610 return graphql.Null 3611 } 3612 res := resTmp.(*introspection.Type) 3613 rctx.Result = res 3614 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3615 3616 if res == nil { 3617 return graphql.Null 3618 } 3619 3620 return ec.___Type(ctx, field.Selections, res) 3621 } 3622 3623 // nolint: vetshadow 3624 func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) graphql.Marshaler { 3625 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3626 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3627 rctx := &graphql.ResolverContext{ 3628 Object: "__Schema", 3629 Args: nil, 3630 Field: field, 3631 } 3632 ctx = graphql.WithResolverContext(ctx, rctx) 3633 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3634 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3635 ctx = rctx // use context from middleware stack in children 3636 return obj.Directives(), nil 3637 }) 3638 if resTmp == nil { 3639 if !ec.HasError(rctx) { 3640 ec.Errorf(ctx, "must not be null") 3641 } 3642 return graphql.Null 3643 } 3644 res := resTmp.([]introspection.Directive) 3645 rctx.Result = res 3646 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3647 3648 arr1 := make(graphql.Array, len(res)) 3649 var wg sync.WaitGroup 3650 3651 isLen1 := len(res) == 1 3652 if !isLen1 { 3653 wg.Add(len(res)) 3654 } 3655 3656 for idx1 := range res { 3657 idx1 := idx1 3658 rctx := &graphql.ResolverContext{ 3659 Index: &idx1, 3660 Result: &res[idx1], 3661 } 3662 ctx := graphql.WithResolverContext(ctx, rctx) 3663 f := func(idx1 int) { 3664 if !isLen1 { 3665 defer wg.Done() 3666 } 3667 arr1[idx1] = func() graphql.Marshaler { 3668 3669 return ec.___Directive(ctx, field.Selections, &res[idx1]) 3670 }() 3671 } 3672 if isLen1 { 3673 f(idx1) 3674 } else { 3675 go f(idx1) 3676 } 3677 3678 } 3679 wg.Wait() 3680 return arr1 3681 } 3682 3683 var __TypeImplementors = []string{"__Type"} 3684 3685 // nolint: gocyclo, errcheck, gas, goconst 3686 func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { 3687 fields := graphql.CollectFields(ctx, sel, __TypeImplementors) 3688 3689 out := graphql.NewOrderedMap(len(fields)) 3690 invalid := false 3691 for i, field := range fields { 3692 out.Keys[i] = field.Alias 3693 3694 switch field.Name { 3695 case "__typename": 3696 out.Values[i] = graphql.MarshalString("__Type") 3697 case "kind": 3698 out.Values[i] = ec.___Type_kind(ctx, field, obj) 3699 if out.Values[i] == graphql.Null { 3700 invalid = true 3701 } 3702 case "name": 3703 out.Values[i] = ec.___Type_name(ctx, field, obj) 3704 case "description": 3705 out.Values[i] = ec.___Type_description(ctx, field, obj) 3706 case "fields": 3707 out.Values[i] = ec.___Type_fields(ctx, field, obj) 3708 case "interfaces": 3709 out.Values[i] = ec.___Type_interfaces(ctx, field, obj) 3710 case "possibleTypes": 3711 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) 3712 case "enumValues": 3713 out.Values[i] = ec.___Type_enumValues(ctx, field, obj) 3714 case "inputFields": 3715 out.Values[i] = ec.___Type_inputFields(ctx, field, obj) 3716 case "ofType": 3717 out.Values[i] = ec.___Type_ofType(ctx, field, obj) 3718 default: 3719 panic("unknown field " + strconv.Quote(field.Name)) 3720 } 3721 } 3722 3723 if invalid { 3724 return graphql.Null 3725 } 3726 return out 3727 } 3728 3729 // nolint: vetshadow 3730 func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 3731 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3732 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3733 rctx := &graphql.ResolverContext{ 3734 Object: "__Type", 3735 Args: nil, 3736 Field: field, 3737 } 3738 ctx = graphql.WithResolverContext(ctx, rctx) 3739 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3740 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3741 ctx = rctx // use context from middleware stack in children 3742 return obj.Kind(), nil 3743 }) 3744 if resTmp == nil { 3745 if !ec.HasError(rctx) { 3746 ec.Errorf(ctx, "must not be null") 3747 } 3748 return graphql.Null 3749 } 3750 res := resTmp.(string) 3751 rctx.Result = res 3752 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3753 return graphql.MarshalString(res) 3754 } 3755 3756 // nolint: vetshadow 3757 func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 3758 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3759 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3760 rctx := &graphql.ResolverContext{ 3761 Object: "__Type", 3762 Args: nil, 3763 Field: field, 3764 } 3765 ctx = graphql.WithResolverContext(ctx, rctx) 3766 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3767 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3768 ctx = rctx // use context from middleware stack in children 3769 return obj.Name(), nil 3770 }) 3771 if resTmp == nil { 3772 return graphql.Null 3773 } 3774 res := resTmp.(*string) 3775 rctx.Result = res 3776 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3777 3778 if res == nil { 3779 return graphql.Null 3780 } 3781 return graphql.MarshalString(*res) 3782 } 3783 3784 // nolint: vetshadow 3785 func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 3786 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3787 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3788 rctx := &graphql.ResolverContext{ 3789 Object: "__Type", 3790 Args: nil, 3791 Field: field, 3792 } 3793 ctx = graphql.WithResolverContext(ctx, rctx) 3794 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3795 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3796 ctx = rctx // use context from middleware stack in children 3797 return obj.Description(), nil 3798 }) 3799 if resTmp == nil { 3800 return graphql.Null 3801 } 3802 res := resTmp.(string) 3803 rctx.Result = res 3804 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3805 return graphql.MarshalString(res) 3806 } 3807 3808 // nolint: vetshadow 3809 func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 3810 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3811 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3812 rawArgs := field.ArgumentMap(ec.Variables) 3813 args, err := field___Type_fields_args(rawArgs) 3814 if err != nil { 3815 ec.Error(ctx, err) 3816 return graphql.Null 3817 } 3818 rctx := &graphql.ResolverContext{ 3819 Object: "__Type", 3820 Args: args, 3821 Field: field, 3822 } 3823 ctx = graphql.WithResolverContext(ctx, rctx) 3824 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3825 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3826 ctx = rctx // use context from middleware stack in children 3827 return obj.Fields(args["includeDeprecated"].(bool)), nil 3828 }) 3829 if resTmp == nil { 3830 return graphql.Null 3831 } 3832 res := resTmp.([]introspection.Field) 3833 rctx.Result = res 3834 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3835 3836 arr1 := make(graphql.Array, len(res)) 3837 var wg sync.WaitGroup 3838 3839 isLen1 := len(res) == 1 3840 if !isLen1 { 3841 wg.Add(len(res)) 3842 } 3843 3844 for idx1 := range res { 3845 idx1 := idx1 3846 rctx := &graphql.ResolverContext{ 3847 Index: &idx1, 3848 Result: &res[idx1], 3849 } 3850 ctx := graphql.WithResolverContext(ctx, rctx) 3851 f := func(idx1 int) { 3852 if !isLen1 { 3853 defer wg.Done() 3854 } 3855 arr1[idx1] = func() graphql.Marshaler { 3856 3857 return ec.___Field(ctx, field.Selections, &res[idx1]) 3858 }() 3859 } 3860 if isLen1 { 3861 f(idx1) 3862 } else { 3863 go f(idx1) 3864 } 3865 3866 } 3867 wg.Wait() 3868 return arr1 3869 } 3870 3871 // nolint: vetshadow 3872 func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 3873 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3874 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3875 rctx := &graphql.ResolverContext{ 3876 Object: "__Type", 3877 Args: nil, 3878 Field: field, 3879 } 3880 ctx = graphql.WithResolverContext(ctx, rctx) 3881 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3882 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3883 ctx = rctx // use context from middleware stack in children 3884 return obj.Interfaces(), nil 3885 }) 3886 if resTmp == nil { 3887 return graphql.Null 3888 } 3889 res := resTmp.([]introspection.Type) 3890 rctx.Result = res 3891 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3892 3893 arr1 := make(graphql.Array, len(res)) 3894 var wg sync.WaitGroup 3895 3896 isLen1 := len(res) == 1 3897 if !isLen1 { 3898 wg.Add(len(res)) 3899 } 3900 3901 for idx1 := range res { 3902 idx1 := idx1 3903 rctx := &graphql.ResolverContext{ 3904 Index: &idx1, 3905 Result: &res[idx1], 3906 } 3907 ctx := graphql.WithResolverContext(ctx, rctx) 3908 f := func(idx1 int) { 3909 if !isLen1 { 3910 defer wg.Done() 3911 } 3912 arr1[idx1] = func() graphql.Marshaler { 3913 3914 return ec.___Type(ctx, field.Selections, &res[idx1]) 3915 }() 3916 } 3917 if isLen1 { 3918 f(idx1) 3919 } else { 3920 go f(idx1) 3921 } 3922 3923 } 3924 wg.Wait() 3925 return arr1 3926 } 3927 3928 // nolint: vetshadow 3929 func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 3930 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3931 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3932 rctx := &graphql.ResolverContext{ 3933 Object: "__Type", 3934 Args: nil, 3935 Field: field, 3936 } 3937 ctx = graphql.WithResolverContext(ctx, rctx) 3938 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 3939 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 3940 ctx = rctx // use context from middleware stack in children 3941 return obj.PossibleTypes(), nil 3942 }) 3943 if resTmp == nil { 3944 return graphql.Null 3945 } 3946 res := resTmp.([]introspection.Type) 3947 rctx.Result = res 3948 ctx = ec.Tracer.StartFieldChildExecution(ctx) 3949 3950 arr1 := make(graphql.Array, len(res)) 3951 var wg sync.WaitGroup 3952 3953 isLen1 := len(res) == 1 3954 if !isLen1 { 3955 wg.Add(len(res)) 3956 } 3957 3958 for idx1 := range res { 3959 idx1 := idx1 3960 rctx := &graphql.ResolverContext{ 3961 Index: &idx1, 3962 Result: &res[idx1], 3963 } 3964 ctx := graphql.WithResolverContext(ctx, rctx) 3965 f := func(idx1 int) { 3966 if !isLen1 { 3967 defer wg.Done() 3968 } 3969 arr1[idx1] = func() graphql.Marshaler { 3970 3971 return ec.___Type(ctx, field.Selections, &res[idx1]) 3972 }() 3973 } 3974 if isLen1 { 3975 f(idx1) 3976 } else { 3977 go f(idx1) 3978 } 3979 3980 } 3981 wg.Wait() 3982 return arr1 3983 } 3984 3985 // nolint: vetshadow 3986 func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 3987 ctx = ec.Tracer.StartFieldExecution(ctx, field) 3988 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 3989 rawArgs := field.ArgumentMap(ec.Variables) 3990 args, err := field___Type_enumValues_args(rawArgs) 3991 if err != nil { 3992 ec.Error(ctx, err) 3993 return graphql.Null 3994 } 3995 rctx := &graphql.ResolverContext{ 3996 Object: "__Type", 3997 Args: args, 3998 Field: field, 3999 } 4000 ctx = graphql.WithResolverContext(ctx, rctx) 4001 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4002 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4003 ctx = rctx // use context from middleware stack in children 4004 return obj.EnumValues(args["includeDeprecated"].(bool)), nil 4005 }) 4006 if resTmp == nil { 4007 return graphql.Null 4008 } 4009 res := resTmp.([]introspection.EnumValue) 4010 rctx.Result = res 4011 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4012 4013 arr1 := make(graphql.Array, len(res)) 4014 var wg sync.WaitGroup 4015 4016 isLen1 := len(res) == 1 4017 if !isLen1 { 4018 wg.Add(len(res)) 4019 } 4020 4021 for idx1 := range res { 4022 idx1 := idx1 4023 rctx := &graphql.ResolverContext{ 4024 Index: &idx1, 4025 Result: &res[idx1], 4026 } 4027 ctx := graphql.WithResolverContext(ctx, rctx) 4028 f := func(idx1 int) { 4029 if !isLen1 { 4030 defer wg.Done() 4031 } 4032 arr1[idx1] = func() graphql.Marshaler { 4033 4034 return ec.___EnumValue(ctx, field.Selections, &res[idx1]) 4035 }() 4036 } 4037 if isLen1 { 4038 f(idx1) 4039 } else { 4040 go f(idx1) 4041 } 4042 4043 } 4044 wg.Wait() 4045 return arr1 4046 } 4047 4048 // nolint: vetshadow 4049 func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 4050 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4051 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4052 rctx := &graphql.ResolverContext{ 4053 Object: "__Type", 4054 Args: nil, 4055 Field: field, 4056 } 4057 ctx = graphql.WithResolverContext(ctx, rctx) 4058 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4059 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4060 ctx = rctx // use context from middleware stack in children 4061 return obj.InputFields(), nil 4062 }) 4063 if resTmp == nil { 4064 return graphql.Null 4065 } 4066 res := resTmp.([]introspection.InputValue) 4067 rctx.Result = res 4068 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4069 4070 arr1 := make(graphql.Array, len(res)) 4071 var wg sync.WaitGroup 4072 4073 isLen1 := len(res) == 1 4074 if !isLen1 { 4075 wg.Add(len(res)) 4076 } 4077 4078 for idx1 := range res { 4079 idx1 := idx1 4080 rctx := &graphql.ResolverContext{ 4081 Index: &idx1, 4082 Result: &res[idx1], 4083 } 4084 ctx := graphql.WithResolverContext(ctx, rctx) 4085 f := func(idx1 int) { 4086 if !isLen1 { 4087 defer wg.Done() 4088 } 4089 arr1[idx1] = func() graphql.Marshaler { 4090 4091 return ec.___InputValue(ctx, field.Selections, &res[idx1]) 4092 }() 4093 } 4094 if isLen1 { 4095 f(idx1) 4096 } else { 4097 go f(idx1) 4098 } 4099 4100 } 4101 wg.Wait() 4102 return arr1 4103 } 4104 4105 // nolint: vetshadow 4106 func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) graphql.Marshaler { 4107 ctx = ec.Tracer.StartFieldExecution(ctx, field) 4108 defer func() { ec.Tracer.EndFieldExecution(ctx) }() 4109 rctx := &graphql.ResolverContext{ 4110 Object: "__Type", 4111 Args: nil, 4112 Field: field, 4113 } 4114 ctx = graphql.WithResolverContext(ctx, rctx) 4115 ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) 4116 resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 4117 ctx = rctx // use context from middleware stack in children 4118 return obj.OfType(), nil 4119 }) 4120 if resTmp == nil { 4121 return graphql.Null 4122 } 4123 res := resTmp.(*introspection.Type) 4124 rctx.Result = res 4125 ctx = ec.Tracer.StartFieldChildExecution(ctx) 4126 4127 if res == nil { 4128 return graphql.Null 4129 } 4130 4131 return ec.___Type(ctx, field.Selections, res) 4132 } 4133 4134 func (ec *executionContext) _Shape(ctx context.Context, sel ast.SelectionSet, obj *Shape) graphql.Marshaler { 4135 switch obj := (*obj).(type) { 4136 case nil: 4137 return graphql.Null 4138 case *Circle: 4139 return ec._Circle(ctx, sel, obj) 4140 case *Rectangle: 4141 return ec._Rectangle(ctx, sel, obj) 4142 default: 4143 panic(fmt.Errorf("unexpected type %T", obj)) 4144 } 4145 } 4146 4147 func (ec *executionContext) _ShapeUnion(ctx context.Context, sel ast.SelectionSet, obj *ShapeUnion) graphql.Marshaler { 4148 switch obj := (*obj).(type) { 4149 case nil: 4150 return graphql.Null 4151 case *Circle: 4152 return ec._Circle(ctx, sel, obj) 4153 case *Rectangle: 4154 return ec._Rectangle(ctx, sel, obj) 4155 default: 4156 panic(fmt.Errorf("unexpected type %T", obj)) 4157 } 4158 } 4159 4160 func UnmarshalInnerInput(v interface{}) (InnerInput, error) { 4161 var it InnerInput 4162 var asMap = v.(map[string]interface{}) 4163 4164 for k, v := range asMap { 4165 switch k { 4166 case "id": 4167 var err error 4168 it.ID, err = graphql.UnmarshalInt(v) 4169 if err != nil { 4170 return it, err 4171 } 4172 } 4173 } 4174 4175 return it, nil 4176 } 4177 4178 func UnmarshalKeywords(v interface{}) (Keywords, error) { 4179 var it Keywords 4180 var asMap = v.(map[string]interface{}) 4181 4182 for k, v := range asMap { 4183 switch k { 4184 case "break": 4185 var err error 4186 it.Break, err = graphql.UnmarshalString(v) 4187 if err != nil { 4188 return it, err 4189 } 4190 case "default": 4191 var err error 4192 it.Default, err = graphql.UnmarshalString(v) 4193 if err != nil { 4194 return it, err 4195 } 4196 case "func": 4197 var err error 4198 it.Func, err = graphql.UnmarshalString(v) 4199 if err != nil { 4200 return it, err 4201 } 4202 case "interface": 4203 var err error 4204 it.Interface, err = graphql.UnmarshalString(v) 4205 if err != nil { 4206 return it, err 4207 } 4208 case "select": 4209 var err error 4210 it.Select, err = graphql.UnmarshalString(v) 4211 if err != nil { 4212 return it, err 4213 } 4214 case "case": 4215 var err error 4216 it.Case, err = graphql.UnmarshalString(v) 4217 if err != nil { 4218 return it, err 4219 } 4220 case "defer": 4221 var err error 4222 it.Defer, err = graphql.UnmarshalString(v) 4223 if err != nil { 4224 return it, err 4225 } 4226 case "go": 4227 var err error 4228 it.Go, err = graphql.UnmarshalString(v) 4229 if err != nil { 4230 return it, err 4231 } 4232 case "map": 4233 var err error 4234 it.Map, err = graphql.UnmarshalString(v) 4235 if err != nil { 4236 return it, err 4237 } 4238 case "struct": 4239 var err error 4240 it.Struct, err = graphql.UnmarshalString(v) 4241 if err != nil { 4242 return it, err 4243 } 4244 case "chan": 4245 var err error 4246 it.Chan, err = graphql.UnmarshalString(v) 4247 if err != nil { 4248 return it, err 4249 } 4250 case "else": 4251 var err error 4252 it.Else, err = graphql.UnmarshalString(v) 4253 if err != nil { 4254 return it, err 4255 } 4256 case "goto": 4257 var err error 4258 it.Goto, err = graphql.UnmarshalString(v) 4259 if err != nil { 4260 return it, err 4261 } 4262 case "package": 4263 var err error 4264 it.Package, err = graphql.UnmarshalString(v) 4265 if err != nil { 4266 return it, err 4267 } 4268 case "switch": 4269 var err error 4270 it.Switch, err = graphql.UnmarshalString(v) 4271 if err != nil { 4272 return it, err 4273 } 4274 case "const": 4275 var err error 4276 it.Const, err = graphql.UnmarshalString(v) 4277 if err != nil { 4278 return it, err 4279 } 4280 case "fallthrough": 4281 var err error 4282 it.Fallthrough, err = graphql.UnmarshalString(v) 4283 if err != nil { 4284 return it, err 4285 } 4286 case "if": 4287 var err error 4288 it.If, err = graphql.UnmarshalString(v) 4289 if err != nil { 4290 return it, err 4291 } 4292 case "range": 4293 var err error 4294 it.Range, err = graphql.UnmarshalString(v) 4295 if err != nil { 4296 return it, err 4297 } 4298 case "type": 4299 var err error 4300 it.Type, err = graphql.UnmarshalString(v) 4301 if err != nil { 4302 return it, err 4303 } 4304 case "continue": 4305 var err error 4306 it.Continue, err = graphql.UnmarshalString(v) 4307 if err != nil { 4308 return it, err 4309 } 4310 case "for": 4311 var err error 4312 it.For, err = graphql.UnmarshalString(v) 4313 if err != nil { 4314 return it, err 4315 } 4316 case "import": 4317 var err error 4318 it.Import, err = graphql.UnmarshalString(v) 4319 if err != nil { 4320 return it, err 4321 } 4322 case "return": 4323 var err error 4324 it.Return, err = graphql.UnmarshalString(v) 4325 if err != nil { 4326 return it, err 4327 } 4328 case "var": 4329 var err error 4330 it.Var, err = graphql.UnmarshalString(v) 4331 if err != nil { 4332 return it, err 4333 } 4334 } 4335 } 4336 4337 return it, nil 4338 } 4339 4340 func UnmarshalOuterInput(v interface{}) (OuterInput, error) { 4341 var it OuterInput 4342 var asMap = v.(map[string]interface{}) 4343 4344 for k, v := range asMap { 4345 switch k { 4346 case "inner": 4347 var err error 4348 it.Inner, err = UnmarshalInnerInput(v) 4349 if err != nil { 4350 return it, err 4351 } 4352 } 4353 } 4354 4355 return it, nil 4356 } 4357 4358 func UnmarshalRecursiveInputSlice(v interface{}) (RecursiveInputSlice, error) { 4359 var it RecursiveInputSlice 4360 var asMap = v.(map[string]interface{}) 4361 4362 for k, v := range asMap { 4363 switch k { 4364 case "self": 4365 var err error 4366 var rawIf1 []interface{} 4367 if v != nil { 4368 if tmp1, ok := v.([]interface{}); ok { 4369 rawIf1 = tmp1 4370 } else { 4371 rawIf1 = []interface{}{v} 4372 } 4373 } 4374 it.Self = make([]RecursiveInputSlice, len(rawIf1)) 4375 for idx1 := range rawIf1 { 4376 it.Self[idx1], err = UnmarshalRecursiveInputSlice(rawIf1[idx1]) 4377 } 4378 if err != nil { 4379 return it, err 4380 } 4381 } 4382 } 4383 4384 return it, nil 4385 } 4386 4387 func (ec *executionContext) FieldMiddleware(ctx context.Context, obj interface{}, next graphql.Resolver) (ret interface{}) { 4388 defer func() { 4389 if r := recover(); r != nil { 4390 ec.Error(ctx, ec.Recover(ctx, r)) 4391 ret = nil 4392 } 4393 }() 4394 res, err := ec.ResolverMiddleware(ctx, next) 4395 if err != nil { 4396 ec.Error(ctx, err) 4397 return nil 4398 } 4399 return res 4400 } 4401 4402 func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { 4403 if ec.DisableIntrospection { 4404 return nil, errors.New("introspection disabled") 4405 } 4406 return introspection.WrapSchema(parsedSchema), nil 4407 } 4408 4409 func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { 4410 if ec.DisableIntrospection { 4411 return nil, errors.New("introspection disabled") 4412 } 4413 return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil 4414 } 4415 4416 var parsedSchema = gqlparser.MustLoadSchema( 4417 &ast.Source{Name: "schema.graphql", Input: `type Query { 4418 invalidIdentifier: InvalidIdentifier 4419 collision: It 4420 mapInput(input: Changes): Boolean 4421 recursive(input: RecursiveInputSlice): Boolean 4422 nestedInputs(input: [[OuterInput]] = [[{inner: {id: 1}}]]): Boolean 4423 nestedOutputs: [[OuterObject]] 4424 keywords(input: Keywords): Boolean! 4425 shapes: [Shape] 4426 errorBubble: Error 4427 modelMethods: ModelMethods 4428 valid: String! 4429 user(id: Int!): User! 4430 nullableArg(arg: Int = 123): String 4431 } 4432 4433 type Subscription { 4434 updated: String! 4435 initPayload: String! 4436 } 4437 4438 type User { 4439 id: Int! 4440 friends: [User!]! 4441 } 4442 4443 type Error { 4444 id: ID! 4445 errorOnNonRequiredField: String 4446 errorOnRequiredField: String! 4447 nilOnRequiredField: String! 4448 } 4449 4450 type ModelMethods { 4451 resolverField: Boolean! 4452 noContext: Boolean! 4453 withContext: Boolean! 4454 } 4455 4456 type InvalidIdentifier { 4457 id: Int! 4458 } 4459 4460 type It { 4461 id: ID! 4462 } 4463 4464 input Changes { 4465 a: Int 4466 b: Int 4467 } 4468 4469 input RecursiveInputSlice { 4470 self: [RecursiveInputSlice!] 4471 } 4472 4473 input InnerInput { 4474 id:Int! 4475 } 4476 4477 input OuterInput { 4478 inner: InnerInput! 4479 } 4480 4481 type OuterObject { 4482 inner: InnerObject! 4483 } 4484 4485 type InnerObject { 4486 id: Int! 4487 } 4488 4489 input Keywords { 4490 break: String! 4491 default: String! 4492 func: String! 4493 interface: String! 4494 select: String! 4495 case: String! 4496 defer: String! 4497 go: String! 4498 map: String! 4499 struct: String! 4500 chan: String! 4501 else: String! 4502 goto: String! 4503 package: String! 4504 switch: String! 4505 const: String! 4506 fallthrough: String! 4507 if: String! 4508 range: String! 4509 type: String! 4510 continue: String! 4511 for: String! 4512 import: String! 4513 return: String! 4514 var: String! 4515 } 4516 4517 extend type Query { 4518 keywordArgs( 4519 break: String!, 4520 default: String!, 4521 func: String!, 4522 interface: String!, 4523 select: String!, 4524 case: String!, 4525 defer: String!, 4526 go: String!, 4527 map: String!, 4528 struct: String!, 4529 chan: String!, 4530 else: String!, 4531 goto: String!, 4532 package: String!, 4533 switch: String!, 4534 const: String!, 4535 fallthrough: String!, 4536 if: String!, 4537 range: String!, 4538 type: String!, 4539 continue: String!, 4540 for: String!, 4541 import: String!, 4542 return: String!, 4543 var: String!, 4544 ): Boolean! 4545 } 4546 4547 interface Shape { 4548 area: Float 4549 } 4550 type Circle implements Shape { 4551 radius: Float 4552 area: Float 4553 } 4554 type Rectangle implements Shape { 4555 length: Float 4556 width: Float 4557 area: Float 4558 } 4559 union ShapeUnion = Circle | Rectangle 4560 4561 type ForcedResolver { 4562 field: Circle 4563 } 4564 4565 type EmbeddedPointer { 4566 ID: String 4567 Title: String 4568 } 4569 `}, 4570 )