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