github.com/maeglindeveloper/gqlgen@v0.13.1-0.20210413081235-57808b12a0a0/example/selection/generated.go (about) 1 // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. 2 3 package selection 4 5 import ( 6 "bytes" 7 "context" 8 "errors" 9 "fmt" 10 "strconv" 11 "sync" 12 "time" 13 14 "github.com/99designs/gqlgen/graphql" 15 "github.com/99designs/gqlgen/graphql/introspection" 16 gqlparser "github.com/vektah/gqlparser/v2" 17 "github.com/vektah/gqlparser/v2/ast" 18 ) 19 20 // region ************************** generated!.gotpl ************************** 21 22 // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. 23 func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { 24 return &executableSchema{ 25 resolvers: cfg.Resolvers, 26 directives: cfg.Directives, 27 complexity: cfg.Complexity, 28 } 29 } 30 31 type Config struct { 32 Resolvers ResolverRoot 33 Directives DirectiveRoot 34 Complexity ComplexityRoot 35 } 36 37 type ResolverRoot interface { 38 Query() QueryResolver 39 } 40 41 type DirectiveRoot struct { 42 } 43 44 type ComplexityRoot struct { 45 Like struct { 46 Collected func(childComplexity int) int 47 Reaction func(childComplexity int) int 48 Selection func(childComplexity int) int 49 Sent func(childComplexity int) int 50 } 51 52 Post struct { 53 Collected func(childComplexity int) int 54 Message func(childComplexity int) int 55 Selection func(childComplexity int) int 56 Sent func(childComplexity int) int 57 } 58 59 Query struct { 60 Events func(childComplexity int) int 61 } 62 } 63 64 type QueryResolver interface { 65 Events(ctx context.Context) ([]Event, error) 66 } 67 68 type executableSchema struct { 69 resolvers ResolverRoot 70 directives DirectiveRoot 71 complexity ComplexityRoot 72 } 73 74 func (e *executableSchema) Schema() *ast.Schema { 75 return parsedSchema 76 } 77 78 func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { 79 ec := executionContext{nil, e} 80 _ = ec 81 switch typeName + "." + field { 82 83 case "Like.collected": 84 if e.complexity.Like.Collected == nil { 85 break 86 } 87 88 return e.complexity.Like.Collected(childComplexity), true 89 90 case "Like.reaction": 91 if e.complexity.Like.Reaction == nil { 92 break 93 } 94 95 return e.complexity.Like.Reaction(childComplexity), true 96 97 case "Like.selection": 98 if e.complexity.Like.Selection == nil { 99 break 100 } 101 102 return e.complexity.Like.Selection(childComplexity), true 103 104 case "Like.sent": 105 if e.complexity.Like.Sent == nil { 106 break 107 } 108 109 return e.complexity.Like.Sent(childComplexity), true 110 111 case "Post.collected": 112 if e.complexity.Post.Collected == nil { 113 break 114 } 115 116 return e.complexity.Post.Collected(childComplexity), true 117 118 case "Post.message": 119 if e.complexity.Post.Message == nil { 120 break 121 } 122 123 return e.complexity.Post.Message(childComplexity), true 124 125 case "Post.selection": 126 if e.complexity.Post.Selection == nil { 127 break 128 } 129 130 return e.complexity.Post.Selection(childComplexity), true 131 132 case "Post.sent": 133 if e.complexity.Post.Sent == nil { 134 break 135 } 136 137 return e.complexity.Post.Sent(childComplexity), true 138 139 case "Query.events": 140 if e.complexity.Query.Events == nil { 141 break 142 } 143 144 return e.complexity.Query.Events(childComplexity), true 145 146 } 147 return 0, false 148 } 149 150 func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { 151 rc := graphql.GetOperationContext(ctx) 152 ec := executionContext{rc, e} 153 first := true 154 155 switch rc.Operation.Operation { 156 case ast.Query: 157 return func(ctx context.Context) *graphql.Response { 158 if !first { 159 return nil 160 } 161 first = false 162 data := ec._Query(ctx, rc.Operation.SelectionSet) 163 var buf bytes.Buffer 164 data.MarshalGQL(&buf) 165 166 return &graphql.Response{ 167 Data: buf.Bytes(), 168 } 169 } 170 171 default: 172 return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) 173 } 174 } 175 176 type executionContext struct { 177 *graphql.OperationContext 178 *executableSchema 179 } 180 181 func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { 182 if ec.DisableIntrospection { 183 return nil, errors.New("introspection disabled") 184 } 185 return introspection.WrapSchema(parsedSchema), nil 186 } 187 188 func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { 189 if ec.DisableIntrospection { 190 return nil, errors.New("introspection disabled") 191 } 192 return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil 193 } 194 195 var sources = []*ast.Source{ 196 {Name: "schema.graphql", Input: `interface Event { 197 selection: [String!] 198 collected: [String!] 199 } 200 201 type Post implements Event { 202 message: String! 203 sent: Time! 204 selection: [String!] 205 collected: [String!] 206 } 207 208 type Like implements Event { 209 reaction: String! 210 sent: Time! 211 selection: [String!] 212 collected: [String!] 213 } 214 215 type Query { 216 events: [Event!] 217 } 218 219 scalar Time 220 `, BuiltIn: false}, 221 } 222 var parsedSchema = gqlparser.MustLoadSchema(sources...) 223 224 // endregion ************************** generated!.gotpl ************************** 225 226 // region ***************************** args.gotpl ***************************** 227 228 func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 229 var err error 230 args := map[string]interface{}{} 231 var arg0 string 232 if tmp, ok := rawArgs["name"]; ok { 233 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) 234 arg0, err = ec.unmarshalNString2string(ctx, tmp) 235 if err != nil { 236 return nil, err 237 } 238 } 239 args["name"] = arg0 240 return args, nil 241 } 242 243 func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 244 var err error 245 args := map[string]interface{}{} 246 var arg0 bool 247 if tmp, ok := rawArgs["includeDeprecated"]; ok { 248 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) 249 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 250 if err != nil { 251 return nil, err 252 } 253 } 254 args["includeDeprecated"] = arg0 255 return args, nil 256 } 257 258 func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 259 var err error 260 args := map[string]interface{}{} 261 var arg0 bool 262 if tmp, ok := rawArgs["includeDeprecated"]; ok { 263 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) 264 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 265 if err != nil { 266 return nil, err 267 } 268 } 269 args["includeDeprecated"] = arg0 270 return args, nil 271 } 272 273 // endregion ***************************** args.gotpl ***************************** 274 275 // region ************************** directives.gotpl ************************** 276 277 // endregion ************************** directives.gotpl ************************** 278 279 // region **************************** field.gotpl ***************************** 280 281 func (ec *executionContext) _Like_reaction(ctx context.Context, field graphql.CollectedField, obj *Like) (ret graphql.Marshaler) { 282 defer func() { 283 if r := recover(); r != nil { 284 ec.Error(ctx, ec.Recover(ctx, r)) 285 ret = graphql.Null 286 } 287 }() 288 fc := &graphql.FieldContext{ 289 Object: "Like", 290 Field: field, 291 Args: nil, 292 IsMethod: false, 293 IsResolver: false, 294 } 295 296 ctx = graphql.WithFieldContext(ctx, fc) 297 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 298 ctx = rctx // use context from middleware stack in children 299 return obj.Reaction, nil 300 }) 301 if err != nil { 302 ec.Error(ctx, err) 303 return graphql.Null 304 } 305 if resTmp == nil { 306 if !graphql.HasFieldError(ctx, fc) { 307 ec.Errorf(ctx, "must not be null") 308 } 309 return graphql.Null 310 } 311 res := resTmp.(string) 312 fc.Result = res 313 return ec.marshalNString2string(ctx, field.Selections, res) 314 } 315 316 func (ec *executionContext) _Like_sent(ctx context.Context, field graphql.CollectedField, obj *Like) (ret graphql.Marshaler) { 317 defer func() { 318 if r := recover(); r != nil { 319 ec.Error(ctx, ec.Recover(ctx, r)) 320 ret = graphql.Null 321 } 322 }() 323 fc := &graphql.FieldContext{ 324 Object: "Like", 325 Field: field, 326 Args: nil, 327 IsMethod: false, 328 IsResolver: false, 329 } 330 331 ctx = graphql.WithFieldContext(ctx, fc) 332 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 333 ctx = rctx // use context from middleware stack in children 334 return obj.Sent, nil 335 }) 336 if err != nil { 337 ec.Error(ctx, err) 338 return graphql.Null 339 } 340 if resTmp == nil { 341 if !graphql.HasFieldError(ctx, fc) { 342 ec.Errorf(ctx, "must not be null") 343 } 344 return graphql.Null 345 } 346 res := resTmp.(time.Time) 347 fc.Result = res 348 return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) 349 } 350 351 func (ec *executionContext) _Like_selection(ctx context.Context, field graphql.CollectedField, obj *Like) (ret graphql.Marshaler) { 352 defer func() { 353 if r := recover(); r != nil { 354 ec.Error(ctx, ec.Recover(ctx, r)) 355 ret = graphql.Null 356 } 357 }() 358 fc := &graphql.FieldContext{ 359 Object: "Like", 360 Field: field, 361 Args: nil, 362 IsMethod: false, 363 IsResolver: false, 364 } 365 366 ctx = graphql.WithFieldContext(ctx, fc) 367 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 368 ctx = rctx // use context from middleware stack in children 369 return obj.Selection, nil 370 }) 371 if err != nil { 372 ec.Error(ctx, err) 373 return graphql.Null 374 } 375 if resTmp == nil { 376 return graphql.Null 377 } 378 res := resTmp.([]string) 379 fc.Result = res 380 return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) 381 } 382 383 func (ec *executionContext) _Like_collected(ctx context.Context, field graphql.CollectedField, obj *Like) (ret graphql.Marshaler) { 384 defer func() { 385 if r := recover(); r != nil { 386 ec.Error(ctx, ec.Recover(ctx, r)) 387 ret = graphql.Null 388 } 389 }() 390 fc := &graphql.FieldContext{ 391 Object: "Like", 392 Field: field, 393 Args: nil, 394 IsMethod: false, 395 IsResolver: false, 396 } 397 398 ctx = graphql.WithFieldContext(ctx, fc) 399 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 400 ctx = rctx // use context from middleware stack in children 401 return obj.Collected, nil 402 }) 403 if err != nil { 404 ec.Error(ctx, err) 405 return graphql.Null 406 } 407 if resTmp == nil { 408 return graphql.Null 409 } 410 res := resTmp.([]string) 411 fc.Result = res 412 return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) 413 } 414 415 func (ec *executionContext) _Post_message(ctx context.Context, field graphql.CollectedField, obj *Post) (ret graphql.Marshaler) { 416 defer func() { 417 if r := recover(); r != nil { 418 ec.Error(ctx, ec.Recover(ctx, r)) 419 ret = graphql.Null 420 } 421 }() 422 fc := &graphql.FieldContext{ 423 Object: "Post", 424 Field: field, 425 Args: nil, 426 IsMethod: false, 427 IsResolver: false, 428 } 429 430 ctx = graphql.WithFieldContext(ctx, fc) 431 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 432 ctx = rctx // use context from middleware stack in children 433 return obj.Message, nil 434 }) 435 if err != nil { 436 ec.Error(ctx, err) 437 return graphql.Null 438 } 439 if resTmp == nil { 440 if !graphql.HasFieldError(ctx, fc) { 441 ec.Errorf(ctx, "must not be null") 442 } 443 return graphql.Null 444 } 445 res := resTmp.(string) 446 fc.Result = res 447 return ec.marshalNString2string(ctx, field.Selections, res) 448 } 449 450 func (ec *executionContext) _Post_sent(ctx context.Context, field graphql.CollectedField, obj *Post) (ret graphql.Marshaler) { 451 defer func() { 452 if r := recover(); r != nil { 453 ec.Error(ctx, ec.Recover(ctx, r)) 454 ret = graphql.Null 455 } 456 }() 457 fc := &graphql.FieldContext{ 458 Object: "Post", 459 Field: field, 460 Args: nil, 461 IsMethod: false, 462 IsResolver: false, 463 } 464 465 ctx = graphql.WithFieldContext(ctx, fc) 466 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 467 ctx = rctx // use context from middleware stack in children 468 return obj.Sent, nil 469 }) 470 if err != nil { 471 ec.Error(ctx, err) 472 return graphql.Null 473 } 474 if resTmp == nil { 475 if !graphql.HasFieldError(ctx, fc) { 476 ec.Errorf(ctx, "must not be null") 477 } 478 return graphql.Null 479 } 480 res := resTmp.(time.Time) 481 fc.Result = res 482 return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) 483 } 484 485 func (ec *executionContext) _Post_selection(ctx context.Context, field graphql.CollectedField, obj *Post) (ret graphql.Marshaler) { 486 defer func() { 487 if r := recover(); r != nil { 488 ec.Error(ctx, ec.Recover(ctx, r)) 489 ret = graphql.Null 490 } 491 }() 492 fc := &graphql.FieldContext{ 493 Object: "Post", 494 Field: field, 495 Args: nil, 496 IsMethod: false, 497 IsResolver: false, 498 } 499 500 ctx = graphql.WithFieldContext(ctx, fc) 501 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 502 ctx = rctx // use context from middleware stack in children 503 return obj.Selection, nil 504 }) 505 if err != nil { 506 ec.Error(ctx, err) 507 return graphql.Null 508 } 509 if resTmp == nil { 510 return graphql.Null 511 } 512 res := resTmp.([]string) 513 fc.Result = res 514 return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) 515 } 516 517 func (ec *executionContext) _Post_collected(ctx context.Context, field graphql.CollectedField, obj *Post) (ret graphql.Marshaler) { 518 defer func() { 519 if r := recover(); r != nil { 520 ec.Error(ctx, ec.Recover(ctx, r)) 521 ret = graphql.Null 522 } 523 }() 524 fc := &graphql.FieldContext{ 525 Object: "Post", 526 Field: field, 527 Args: nil, 528 IsMethod: false, 529 IsResolver: false, 530 } 531 532 ctx = graphql.WithFieldContext(ctx, fc) 533 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 534 ctx = rctx // use context from middleware stack in children 535 return obj.Collected, nil 536 }) 537 if err != nil { 538 ec.Error(ctx, err) 539 return graphql.Null 540 } 541 if resTmp == nil { 542 return graphql.Null 543 } 544 res := resTmp.([]string) 545 fc.Result = res 546 return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) 547 } 548 549 func (ec *executionContext) _Query_events(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 550 defer func() { 551 if r := recover(); r != nil { 552 ec.Error(ctx, ec.Recover(ctx, r)) 553 ret = graphql.Null 554 } 555 }() 556 fc := &graphql.FieldContext{ 557 Object: "Query", 558 Field: field, 559 Args: nil, 560 IsMethod: true, 561 IsResolver: true, 562 } 563 564 ctx = graphql.WithFieldContext(ctx, fc) 565 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 566 ctx = rctx // use context from middleware stack in children 567 return ec.resolvers.Query().Events(rctx) 568 }) 569 if err != nil { 570 ec.Error(ctx, err) 571 return graphql.Null 572 } 573 if resTmp == nil { 574 return graphql.Null 575 } 576 res := resTmp.([]Event) 577 fc.Result = res 578 return ec.marshalOEvent2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋselectionᚐEventᚄ(ctx, field.Selections, res) 579 } 580 581 func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 582 defer func() { 583 if r := recover(); r != nil { 584 ec.Error(ctx, ec.Recover(ctx, r)) 585 ret = graphql.Null 586 } 587 }() 588 fc := &graphql.FieldContext{ 589 Object: "Query", 590 Field: field, 591 Args: nil, 592 IsMethod: true, 593 IsResolver: false, 594 } 595 596 ctx = graphql.WithFieldContext(ctx, fc) 597 rawArgs := field.ArgumentMap(ec.Variables) 598 args, err := ec.field_Query___type_args(ctx, rawArgs) 599 if err != nil { 600 ec.Error(ctx, err) 601 return graphql.Null 602 } 603 fc.Args = args 604 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 605 ctx = rctx // use context from middleware stack in children 606 return ec.introspectType(args["name"].(string)) 607 }) 608 if err != nil { 609 ec.Error(ctx, err) 610 return graphql.Null 611 } 612 if resTmp == nil { 613 return graphql.Null 614 } 615 res := resTmp.(*introspection.Type) 616 fc.Result = res 617 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 618 } 619 620 func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 621 defer func() { 622 if r := recover(); r != nil { 623 ec.Error(ctx, ec.Recover(ctx, r)) 624 ret = graphql.Null 625 } 626 }() 627 fc := &graphql.FieldContext{ 628 Object: "Query", 629 Field: field, 630 Args: nil, 631 IsMethod: true, 632 IsResolver: false, 633 } 634 635 ctx = graphql.WithFieldContext(ctx, fc) 636 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 637 ctx = rctx // use context from middleware stack in children 638 return ec.introspectSchema() 639 }) 640 if err != nil { 641 ec.Error(ctx, err) 642 return graphql.Null 643 } 644 if resTmp == nil { 645 return graphql.Null 646 } 647 res := resTmp.(*introspection.Schema) 648 fc.Result = res 649 return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) 650 } 651 652 func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 653 defer func() { 654 if r := recover(); r != nil { 655 ec.Error(ctx, ec.Recover(ctx, r)) 656 ret = graphql.Null 657 } 658 }() 659 fc := &graphql.FieldContext{ 660 Object: "__Directive", 661 Field: field, 662 Args: nil, 663 IsMethod: false, 664 IsResolver: false, 665 } 666 667 ctx = graphql.WithFieldContext(ctx, fc) 668 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 669 ctx = rctx // use context from middleware stack in children 670 return obj.Name, nil 671 }) 672 if err != nil { 673 ec.Error(ctx, err) 674 return graphql.Null 675 } 676 if resTmp == nil { 677 if !graphql.HasFieldError(ctx, fc) { 678 ec.Errorf(ctx, "must not be null") 679 } 680 return graphql.Null 681 } 682 res := resTmp.(string) 683 fc.Result = res 684 return ec.marshalNString2string(ctx, field.Selections, res) 685 } 686 687 func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 688 defer func() { 689 if r := recover(); r != nil { 690 ec.Error(ctx, ec.Recover(ctx, r)) 691 ret = graphql.Null 692 } 693 }() 694 fc := &graphql.FieldContext{ 695 Object: "__Directive", 696 Field: field, 697 Args: nil, 698 IsMethod: false, 699 IsResolver: false, 700 } 701 702 ctx = graphql.WithFieldContext(ctx, fc) 703 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 704 ctx = rctx // use context from middleware stack in children 705 return obj.Description, nil 706 }) 707 if err != nil { 708 ec.Error(ctx, err) 709 return graphql.Null 710 } 711 if resTmp == nil { 712 return graphql.Null 713 } 714 res := resTmp.(string) 715 fc.Result = res 716 return ec.marshalOString2string(ctx, field.Selections, res) 717 } 718 719 func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 720 defer func() { 721 if r := recover(); r != nil { 722 ec.Error(ctx, ec.Recover(ctx, r)) 723 ret = graphql.Null 724 } 725 }() 726 fc := &graphql.FieldContext{ 727 Object: "__Directive", 728 Field: field, 729 Args: nil, 730 IsMethod: false, 731 IsResolver: false, 732 } 733 734 ctx = graphql.WithFieldContext(ctx, fc) 735 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 736 ctx = rctx // use context from middleware stack in children 737 return obj.Locations, nil 738 }) 739 if err != nil { 740 ec.Error(ctx, err) 741 return graphql.Null 742 } 743 if resTmp == nil { 744 if !graphql.HasFieldError(ctx, fc) { 745 ec.Errorf(ctx, "must not be null") 746 } 747 return graphql.Null 748 } 749 res := resTmp.([]string) 750 fc.Result = res 751 return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) 752 } 753 754 func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 755 defer func() { 756 if r := recover(); r != nil { 757 ec.Error(ctx, ec.Recover(ctx, r)) 758 ret = graphql.Null 759 } 760 }() 761 fc := &graphql.FieldContext{ 762 Object: "__Directive", 763 Field: field, 764 Args: nil, 765 IsMethod: false, 766 IsResolver: false, 767 } 768 769 ctx = graphql.WithFieldContext(ctx, fc) 770 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 771 ctx = rctx // use context from middleware stack in children 772 return obj.Args, nil 773 }) 774 if err != nil { 775 ec.Error(ctx, err) 776 return graphql.Null 777 } 778 if resTmp == nil { 779 if !graphql.HasFieldError(ctx, fc) { 780 ec.Errorf(ctx, "must not be null") 781 } 782 return graphql.Null 783 } 784 res := resTmp.([]introspection.InputValue) 785 fc.Result = res 786 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 787 } 788 789 func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 790 defer func() { 791 if r := recover(); r != nil { 792 ec.Error(ctx, ec.Recover(ctx, r)) 793 ret = graphql.Null 794 } 795 }() 796 fc := &graphql.FieldContext{ 797 Object: "__EnumValue", 798 Field: field, 799 Args: nil, 800 IsMethod: false, 801 IsResolver: false, 802 } 803 804 ctx = graphql.WithFieldContext(ctx, fc) 805 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 806 ctx = rctx // use context from middleware stack in children 807 return obj.Name, nil 808 }) 809 if err != nil { 810 ec.Error(ctx, err) 811 return graphql.Null 812 } 813 if resTmp == nil { 814 if !graphql.HasFieldError(ctx, fc) { 815 ec.Errorf(ctx, "must not be null") 816 } 817 return graphql.Null 818 } 819 res := resTmp.(string) 820 fc.Result = res 821 return ec.marshalNString2string(ctx, field.Selections, res) 822 } 823 824 func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 825 defer func() { 826 if r := recover(); r != nil { 827 ec.Error(ctx, ec.Recover(ctx, r)) 828 ret = graphql.Null 829 } 830 }() 831 fc := &graphql.FieldContext{ 832 Object: "__EnumValue", 833 Field: field, 834 Args: nil, 835 IsMethod: false, 836 IsResolver: false, 837 } 838 839 ctx = graphql.WithFieldContext(ctx, fc) 840 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 841 ctx = rctx // use context from middleware stack in children 842 return obj.Description, nil 843 }) 844 if err != nil { 845 ec.Error(ctx, err) 846 return graphql.Null 847 } 848 if resTmp == nil { 849 return graphql.Null 850 } 851 res := resTmp.(string) 852 fc.Result = res 853 return ec.marshalOString2string(ctx, field.Selections, res) 854 } 855 856 func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 857 defer func() { 858 if r := recover(); r != nil { 859 ec.Error(ctx, ec.Recover(ctx, r)) 860 ret = graphql.Null 861 } 862 }() 863 fc := &graphql.FieldContext{ 864 Object: "__EnumValue", 865 Field: field, 866 Args: nil, 867 IsMethod: true, 868 IsResolver: false, 869 } 870 871 ctx = graphql.WithFieldContext(ctx, fc) 872 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 873 ctx = rctx // use context from middleware stack in children 874 return obj.IsDeprecated(), nil 875 }) 876 if err != nil { 877 ec.Error(ctx, err) 878 return graphql.Null 879 } 880 if resTmp == nil { 881 if !graphql.HasFieldError(ctx, fc) { 882 ec.Errorf(ctx, "must not be null") 883 } 884 return graphql.Null 885 } 886 res := resTmp.(bool) 887 fc.Result = res 888 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 889 } 890 891 func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 892 defer func() { 893 if r := recover(); r != nil { 894 ec.Error(ctx, ec.Recover(ctx, r)) 895 ret = graphql.Null 896 } 897 }() 898 fc := &graphql.FieldContext{ 899 Object: "__EnumValue", 900 Field: field, 901 Args: nil, 902 IsMethod: true, 903 IsResolver: false, 904 } 905 906 ctx = graphql.WithFieldContext(ctx, fc) 907 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 908 ctx = rctx // use context from middleware stack in children 909 return obj.DeprecationReason(), nil 910 }) 911 if err != nil { 912 ec.Error(ctx, err) 913 return graphql.Null 914 } 915 if resTmp == nil { 916 return graphql.Null 917 } 918 res := resTmp.(*string) 919 fc.Result = res 920 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 921 } 922 923 func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 924 defer func() { 925 if r := recover(); r != nil { 926 ec.Error(ctx, ec.Recover(ctx, r)) 927 ret = graphql.Null 928 } 929 }() 930 fc := &graphql.FieldContext{ 931 Object: "__Field", 932 Field: field, 933 Args: nil, 934 IsMethod: false, 935 IsResolver: false, 936 } 937 938 ctx = graphql.WithFieldContext(ctx, fc) 939 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 940 ctx = rctx // use context from middleware stack in children 941 return obj.Name, nil 942 }) 943 if err != nil { 944 ec.Error(ctx, err) 945 return graphql.Null 946 } 947 if resTmp == nil { 948 if !graphql.HasFieldError(ctx, fc) { 949 ec.Errorf(ctx, "must not be null") 950 } 951 return graphql.Null 952 } 953 res := resTmp.(string) 954 fc.Result = res 955 return ec.marshalNString2string(ctx, field.Selections, res) 956 } 957 958 func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 959 defer func() { 960 if r := recover(); r != nil { 961 ec.Error(ctx, ec.Recover(ctx, r)) 962 ret = graphql.Null 963 } 964 }() 965 fc := &graphql.FieldContext{ 966 Object: "__Field", 967 Field: field, 968 Args: nil, 969 IsMethod: false, 970 IsResolver: false, 971 } 972 973 ctx = graphql.WithFieldContext(ctx, fc) 974 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 975 ctx = rctx // use context from middleware stack in children 976 return obj.Description, nil 977 }) 978 if err != nil { 979 ec.Error(ctx, err) 980 return graphql.Null 981 } 982 if resTmp == nil { 983 return graphql.Null 984 } 985 res := resTmp.(string) 986 fc.Result = res 987 return ec.marshalOString2string(ctx, field.Selections, res) 988 } 989 990 func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 991 defer func() { 992 if r := recover(); r != nil { 993 ec.Error(ctx, ec.Recover(ctx, r)) 994 ret = graphql.Null 995 } 996 }() 997 fc := &graphql.FieldContext{ 998 Object: "__Field", 999 Field: field, 1000 Args: nil, 1001 IsMethod: false, 1002 IsResolver: false, 1003 } 1004 1005 ctx = graphql.WithFieldContext(ctx, fc) 1006 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1007 ctx = rctx // use context from middleware stack in children 1008 return obj.Args, nil 1009 }) 1010 if err != nil { 1011 ec.Error(ctx, err) 1012 return graphql.Null 1013 } 1014 if resTmp == nil { 1015 if !graphql.HasFieldError(ctx, fc) { 1016 ec.Errorf(ctx, "must not be null") 1017 } 1018 return graphql.Null 1019 } 1020 res := resTmp.([]introspection.InputValue) 1021 fc.Result = res 1022 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 1023 } 1024 1025 func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1026 defer func() { 1027 if r := recover(); r != nil { 1028 ec.Error(ctx, ec.Recover(ctx, r)) 1029 ret = graphql.Null 1030 } 1031 }() 1032 fc := &graphql.FieldContext{ 1033 Object: "__Field", 1034 Field: field, 1035 Args: nil, 1036 IsMethod: false, 1037 IsResolver: false, 1038 } 1039 1040 ctx = graphql.WithFieldContext(ctx, fc) 1041 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1042 ctx = rctx // use context from middleware stack in children 1043 return obj.Type, nil 1044 }) 1045 if err != nil { 1046 ec.Error(ctx, err) 1047 return graphql.Null 1048 } 1049 if resTmp == nil { 1050 if !graphql.HasFieldError(ctx, fc) { 1051 ec.Errorf(ctx, "must not be null") 1052 } 1053 return graphql.Null 1054 } 1055 res := resTmp.(*introspection.Type) 1056 fc.Result = res 1057 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1058 } 1059 1060 func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1061 defer func() { 1062 if r := recover(); r != nil { 1063 ec.Error(ctx, ec.Recover(ctx, r)) 1064 ret = graphql.Null 1065 } 1066 }() 1067 fc := &graphql.FieldContext{ 1068 Object: "__Field", 1069 Field: field, 1070 Args: nil, 1071 IsMethod: true, 1072 IsResolver: false, 1073 } 1074 1075 ctx = graphql.WithFieldContext(ctx, fc) 1076 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1077 ctx = rctx // use context from middleware stack in children 1078 return obj.IsDeprecated(), nil 1079 }) 1080 if err != nil { 1081 ec.Error(ctx, err) 1082 return graphql.Null 1083 } 1084 if resTmp == nil { 1085 if !graphql.HasFieldError(ctx, fc) { 1086 ec.Errorf(ctx, "must not be null") 1087 } 1088 return graphql.Null 1089 } 1090 res := resTmp.(bool) 1091 fc.Result = res 1092 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 1093 } 1094 1095 func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1096 defer func() { 1097 if r := recover(); r != nil { 1098 ec.Error(ctx, ec.Recover(ctx, r)) 1099 ret = graphql.Null 1100 } 1101 }() 1102 fc := &graphql.FieldContext{ 1103 Object: "__Field", 1104 Field: field, 1105 Args: nil, 1106 IsMethod: true, 1107 IsResolver: false, 1108 } 1109 1110 ctx = graphql.WithFieldContext(ctx, fc) 1111 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1112 ctx = rctx // use context from middleware stack in children 1113 return obj.DeprecationReason(), nil 1114 }) 1115 if err != nil { 1116 ec.Error(ctx, err) 1117 return graphql.Null 1118 } 1119 if resTmp == nil { 1120 return graphql.Null 1121 } 1122 res := resTmp.(*string) 1123 fc.Result = res 1124 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1125 } 1126 1127 func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1128 defer func() { 1129 if r := recover(); r != nil { 1130 ec.Error(ctx, ec.Recover(ctx, r)) 1131 ret = graphql.Null 1132 } 1133 }() 1134 fc := &graphql.FieldContext{ 1135 Object: "__InputValue", 1136 Field: field, 1137 Args: nil, 1138 IsMethod: false, 1139 IsResolver: false, 1140 } 1141 1142 ctx = graphql.WithFieldContext(ctx, fc) 1143 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1144 ctx = rctx // use context from middleware stack in children 1145 return obj.Name, nil 1146 }) 1147 if err != nil { 1148 ec.Error(ctx, err) 1149 return graphql.Null 1150 } 1151 if resTmp == nil { 1152 if !graphql.HasFieldError(ctx, fc) { 1153 ec.Errorf(ctx, "must not be null") 1154 } 1155 return graphql.Null 1156 } 1157 res := resTmp.(string) 1158 fc.Result = res 1159 return ec.marshalNString2string(ctx, field.Selections, res) 1160 } 1161 1162 func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1163 defer func() { 1164 if r := recover(); r != nil { 1165 ec.Error(ctx, ec.Recover(ctx, r)) 1166 ret = graphql.Null 1167 } 1168 }() 1169 fc := &graphql.FieldContext{ 1170 Object: "__InputValue", 1171 Field: field, 1172 Args: nil, 1173 IsMethod: false, 1174 IsResolver: false, 1175 } 1176 1177 ctx = graphql.WithFieldContext(ctx, fc) 1178 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1179 ctx = rctx // use context from middleware stack in children 1180 return obj.Description, nil 1181 }) 1182 if err != nil { 1183 ec.Error(ctx, err) 1184 return graphql.Null 1185 } 1186 if resTmp == nil { 1187 return graphql.Null 1188 } 1189 res := resTmp.(string) 1190 fc.Result = res 1191 return ec.marshalOString2string(ctx, field.Selections, res) 1192 } 1193 1194 func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1195 defer func() { 1196 if r := recover(); r != nil { 1197 ec.Error(ctx, ec.Recover(ctx, r)) 1198 ret = graphql.Null 1199 } 1200 }() 1201 fc := &graphql.FieldContext{ 1202 Object: "__InputValue", 1203 Field: field, 1204 Args: nil, 1205 IsMethod: false, 1206 IsResolver: false, 1207 } 1208 1209 ctx = graphql.WithFieldContext(ctx, fc) 1210 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1211 ctx = rctx // use context from middleware stack in children 1212 return obj.Type, nil 1213 }) 1214 if err != nil { 1215 ec.Error(ctx, err) 1216 return graphql.Null 1217 } 1218 if resTmp == nil { 1219 if !graphql.HasFieldError(ctx, fc) { 1220 ec.Errorf(ctx, "must not be null") 1221 } 1222 return graphql.Null 1223 } 1224 res := resTmp.(*introspection.Type) 1225 fc.Result = res 1226 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1227 } 1228 1229 func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1230 defer func() { 1231 if r := recover(); r != nil { 1232 ec.Error(ctx, ec.Recover(ctx, r)) 1233 ret = graphql.Null 1234 } 1235 }() 1236 fc := &graphql.FieldContext{ 1237 Object: "__InputValue", 1238 Field: field, 1239 Args: nil, 1240 IsMethod: false, 1241 IsResolver: false, 1242 } 1243 1244 ctx = graphql.WithFieldContext(ctx, fc) 1245 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1246 ctx = rctx // use context from middleware stack in children 1247 return obj.DefaultValue, nil 1248 }) 1249 if err != nil { 1250 ec.Error(ctx, err) 1251 return graphql.Null 1252 } 1253 if resTmp == nil { 1254 return graphql.Null 1255 } 1256 res := resTmp.(*string) 1257 fc.Result = res 1258 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1259 } 1260 1261 func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1262 defer func() { 1263 if r := recover(); r != nil { 1264 ec.Error(ctx, ec.Recover(ctx, r)) 1265 ret = graphql.Null 1266 } 1267 }() 1268 fc := &graphql.FieldContext{ 1269 Object: "__Schema", 1270 Field: field, 1271 Args: nil, 1272 IsMethod: true, 1273 IsResolver: false, 1274 } 1275 1276 ctx = graphql.WithFieldContext(ctx, fc) 1277 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1278 ctx = rctx // use context from middleware stack in children 1279 return obj.Types(), nil 1280 }) 1281 if err != nil { 1282 ec.Error(ctx, err) 1283 return graphql.Null 1284 } 1285 if resTmp == nil { 1286 if !graphql.HasFieldError(ctx, fc) { 1287 ec.Errorf(ctx, "must not be null") 1288 } 1289 return graphql.Null 1290 } 1291 res := resTmp.([]introspection.Type) 1292 fc.Result = res 1293 return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 1294 } 1295 1296 func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1297 defer func() { 1298 if r := recover(); r != nil { 1299 ec.Error(ctx, ec.Recover(ctx, r)) 1300 ret = graphql.Null 1301 } 1302 }() 1303 fc := &graphql.FieldContext{ 1304 Object: "__Schema", 1305 Field: field, 1306 Args: nil, 1307 IsMethod: true, 1308 IsResolver: false, 1309 } 1310 1311 ctx = graphql.WithFieldContext(ctx, fc) 1312 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1313 ctx = rctx // use context from middleware stack in children 1314 return obj.QueryType(), nil 1315 }) 1316 if err != nil { 1317 ec.Error(ctx, err) 1318 return graphql.Null 1319 } 1320 if resTmp == nil { 1321 if !graphql.HasFieldError(ctx, fc) { 1322 ec.Errorf(ctx, "must not be null") 1323 } 1324 return graphql.Null 1325 } 1326 res := resTmp.(*introspection.Type) 1327 fc.Result = res 1328 return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1329 } 1330 1331 func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1332 defer func() { 1333 if r := recover(); r != nil { 1334 ec.Error(ctx, ec.Recover(ctx, r)) 1335 ret = graphql.Null 1336 } 1337 }() 1338 fc := &graphql.FieldContext{ 1339 Object: "__Schema", 1340 Field: field, 1341 Args: nil, 1342 IsMethod: true, 1343 IsResolver: false, 1344 } 1345 1346 ctx = graphql.WithFieldContext(ctx, fc) 1347 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1348 ctx = rctx // use context from middleware stack in children 1349 return obj.MutationType(), nil 1350 }) 1351 if err != nil { 1352 ec.Error(ctx, err) 1353 return graphql.Null 1354 } 1355 if resTmp == nil { 1356 return graphql.Null 1357 } 1358 res := resTmp.(*introspection.Type) 1359 fc.Result = res 1360 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1361 } 1362 1363 func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1364 defer func() { 1365 if r := recover(); r != nil { 1366 ec.Error(ctx, ec.Recover(ctx, r)) 1367 ret = graphql.Null 1368 } 1369 }() 1370 fc := &graphql.FieldContext{ 1371 Object: "__Schema", 1372 Field: field, 1373 Args: nil, 1374 IsMethod: true, 1375 IsResolver: false, 1376 } 1377 1378 ctx = graphql.WithFieldContext(ctx, fc) 1379 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1380 ctx = rctx // use context from middleware stack in children 1381 return obj.SubscriptionType(), nil 1382 }) 1383 if err != nil { 1384 ec.Error(ctx, err) 1385 return graphql.Null 1386 } 1387 if resTmp == nil { 1388 return graphql.Null 1389 } 1390 res := resTmp.(*introspection.Type) 1391 fc.Result = res 1392 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1393 } 1394 1395 func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1396 defer func() { 1397 if r := recover(); r != nil { 1398 ec.Error(ctx, ec.Recover(ctx, r)) 1399 ret = graphql.Null 1400 } 1401 }() 1402 fc := &graphql.FieldContext{ 1403 Object: "__Schema", 1404 Field: field, 1405 Args: nil, 1406 IsMethod: true, 1407 IsResolver: false, 1408 } 1409 1410 ctx = graphql.WithFieldContext(ctx, fc) 1411 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1412 ctx = rctx // use context from middleware stack in children 1413 return obj.Directives(), nil 1414 }) 1415 if err != nil { 1416 ec.Error(ctx, err) 1417 return graphql.Null 1418 } 1419 if resTmp == nil { 1420 if !graphql.HasFieldError(ctx, fc) { 1421 ec.Errorf(ctx, "must not be null") 1422 } 1423 return graphql.Null 1424 } 1425 res := resTmp.([]introspection.Directive) 1426 fc.Result = res 1427 return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) 1428 } 1429 1430 func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1431 defer func() { 1432 if r := recover(); r != nil { 1433 ec.Error(ctx, ec.Recover(ctx, r)) 1434 ret = graphql.Null 1435 } 1436 }() 1437 fc := &graphql.FieldContext{ 1438 Object: "__Type", 1439 Field: field, 1440 Args: nil, 1441 IsMethod: true, 1442 IsResolver: false, 1443 } 1444 1445 ctx = graphql.WithFieldContext(ctx, fc) 1446 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1447 ctx = rctx // use context from middleware stack in children 1448 return obj.Kind(), nil 1449 }) 1450 if err != nil { 1451 ec.Error(ctx, err) 1452 return graphql.Null 1453 } 1454 if resTmp == nil { 1455 if !graphql.HasFieldError(ctx, fc) { 1456 ec.Errorf(ctx, "must not be null") 1457 } 1458 return graphql.Null 1459 } 1460 res := resTmp.(string) 1461 fc.Result = res 1462 return ec.marshalN__TypeKind2string(ctx, field.Selections, res) 1463 } 1464 1465 func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1466 defer func() { 1467 if r := recover(); r != nil { 1468 ec.Error(ctx, ec.Recover(ctx, r)) 1469 ret = graphql.Null 1470 } 1471 }() 1472 fc := &graphql.FieldContext{ 1473 Object: "__Type", 1474 Field: field, 1475 Args: nil, 1476 IsMethod: true, 1477 IsResolver: false, 1478 } 1479 1480 ctx = graphql.WithFieldContext(ctx, fc) 1481 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1482 ctx = rctx // use context from middleware stack in children 1483 return obj.Name(), nil 1484 }) 1485 if err != nil { 1486 ec.Error(ctx, err) 1487 return graphql.Null 1488 } 1489 if resTmp == nil { 1490 return graphql.Null 1491 } 1492 res := resTmp.(*string) 1493 fc.Result = res 1494 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1495 } 1496 1497 func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1498 defer func() { 1499 if r := recover(); r != nil { 1500 ec.Error(ctx, ec.Recover(ctx, r)) 1501 ret = graphql.Null 1502 } 1503 }() 1504 fc := &graphql.FieldContext{ 1505 Object: "__Type", 1506 Field: field, 1507 Args: nil, 1508 IsMethod: true, 1509 IsResolver: false, 1510 } 1511 1512 ctx = graphql.WithFieldContext(ctx, fc) 1513 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1514 ctx = rctx // use context from middleware stack in children 1515 return obj.Description(), nil 1516 }) 1517 if err != nil { 1518 ec.Error(ctx, err) 1519 return graphql.Null 1520 } 1521 if resTmp == nil { 1522 return graphql.Null 1523 } 1524 res := resTmp.(string) 1525 fc.Result = res 1526 return ec.marshalOString2string(ctx, field.Selections, res) 1527 } 1528 1529 func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1530 defer func() { 1531 if r := recover(); r != nil { 1532 ec.Error(ctx, ec.Recover(ctx, r)) 1533 ret = graphql.Null 1534 } 1535 }() 1536 fc := &graphql.FieldContext{ 1537 Object: "__Type", 1538 Field: field, 1539 Args: nil, 1540 IsMethod: true, 1541 IsResolver: false, 1542 } 1543 1544 ctx = graphql.WithFieldContext(ctx, fc) 1545 rawArgs := field.ArgumentMap(ec.Variables) 1546 args, err := ec.field___Type_fields_args(ctx, rawArgs) 1547 if err != nil { 1548 ec.Error(ctx, err) 1549 return graphql.Null 1550 } 1551 fc.Args = args 1552 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1553 ctx = rctx // use context from middleware stack in children 1554 return obj.Fields(args["includeDeprecated"].(bool)), nil 1555 }) 1556 if err != nil { 1557 ec.Error(ctx, err) 1558 return graphql.Null 1559 } 1560 if resTmp == nil { 1561 return graphql.Null 1562 } 1563 res := resTmp.([]introspection.Field) 1564 fc.Result = res 1565 return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) 1566 } 1567 1568 func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1569 defer func() { 1570 if r := recover(); r != nil { 1571 ec.Error(ctx, ec.Recover(ctx, r)) 1572 ret = graphql.Null 1573 } 1574 }() 1575 fc := &graphql.FieldContext{ 1576 Object: "__Type", 1577 Field: field, 1578 Args: nil, 1579 IsMethod: true, 1580 IsResolver: false, 1581 } 1582 1583 ctx = graphql.WithFieldContext(ctx, fc) 1584 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1585 ctx = rctx // use context from middleware stack in children 1586 return obj.Interfaces(), nil 1587 }) 1588 if err != nil { 1589 ec.Error(ctx, err) 1590 return graphql.Null 1591 } 1592 if resTmp == nil { 1593 return graphql.Null 1594 } 1595 res := resTmp.([]introspection.Type) 1596 fc.Result = res 1597 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 1598 } 1599 1600 func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1601 defer func() { 1602 if r := recover(); r != nil { 1603 ec.Error(ctx, ec.Recover(ctx, r)) 1604 ret = graphql.Null 1605 } 1606 }() 1607 fc := &graphql.FieldContext{ 1608 Object: "__Type", 1609 Field: field, 1610 Args: nil, 1611 IsMethod: true, 1612 IsResolver: false, 1613 } 1614 1615 ctx = graphql.WithFieldContext(ctx, fc) 1616 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1617 ctx = rctx // use context from middleware stack in children 1618 return obj.PossibleTypes(), nil 1619 }) 1620 if err != nil { 1621 ec.Error(ctx, err) 1622 return graphql.Null 1623 } 1624 if resTmp == nil { 1625 return graphql.Null 1626 } 1627 res := resTmp.([]introspection.Type) 1628 fc.Result = res 1629 return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 1630 } 1631 1632 func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1633 defer func() { 1634 if r := recover(); r != nil { 1635 ec.Error(ctx, ec.Recover(ctx, r)) 1636 ret = graphql.Null 1637 } 1638 }() 1639 fc := &graphql.FieldContext{ 1640 Object: "__Type", 1641 Field: field, 1642 Args: nil, 1643 IsMethod: true, 1644 IsResolver: false, 1645 } 1646 1647 ctx = graphql.WithFieldContext(ctx, fc) 1648 rawArgs := field.ArgumentMap(ec.Variables) 1649 args, err := ec.field___Type_enumValues_args(ctx, rawArgs) 1650 if err != nil { 1651 ec.Error(ctx, err) 1652 return graphql.Null 1653 } 1654 fc.Args = args 1655 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1656 ctx = rctx // use context from middleware stack in children 1657 return obj.EnumValues(args["includeDeprecated"].(bool)), nil 1658 }) 1659 if err != nil { 1660 ec.Error(ctx, err) 1661 return graphql.Null 1662 } 1663 if resTmp == nil { 1664 return graphql.Null 1665 } 1666 res := resTmp.([]introspection.EnumValue) 1667 fc.Result = res 1668 return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) 1669 } 1670 1671 func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1672 defer func() { 1673 if r := recover(); r != nil { 1674 ec.Error(ctx, ec.Recover(ctx, r)) 1675 ret = graphql.Null 1676 } 1677 }() 1678 fc := &graphql.FieldContext{ 1679 Object: "__Type", 1680 Field: field, 1681 Args: nil, 1682 IsMethod: true, 1683 IsResolver: false, 1684 } 1685 1686 ctx = graphql.WithFieldContext(ctx, fc) 1687 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1688 ctx = rctx // use context from middleware stack in children 1689 return obj.InputFields(), nil 1690 }) 1691 if err != nil { 1692 ec.Error(ctx, err) 1693 return graphql.Null 1694 } 1695 if resTmp == nil { 1696 return graphql.Null 1697 } 1698 res := resTmp.([]introspection.InputValue) 1699 fc.Result = res 1700 return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 1701 } 1702 1703 func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 1704 defer func() { 1705 if r := recover(); r != nil { 1706 ec.Error(ctx, ec.Recover(ctx, r)) 1707 ret = graphql.Null 1708 } 1709 }() 1710 fc := &graphql.FieldContext{ 1711 Object: "__Type", 1712 Field: field, 1713 Args: nil, 1714 IsMethod: true, 1715 IsResolver: false, 1716 } 1717 1718 ctx = graphql.WithFieldContext(ctx, fc) 1719 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1720 ctx = rctx // use context from middleware stack in children 1721 return obj.OfType(), nil 1722 }) 1723 if err != nil { 1724 ec.Error(ctx, err) 1725 return graphql.Null 1726 } 1727 if resTmp == nil { 1728 return graphql.Null 1729 } 1730 res := resTmp.(*introspection.Type) 1731 fc.Result = res 1732 return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1733 } 1734 1735 // endregion **************************** field.gotpl ***************************** 1736 1737 // region **************************** input.gotpl ***************************** 1738 1739 // endregion **************************** input.gotpl ***************************** 1740 1741 // region ************************** interface.gotpl *************************** 1742 1743 func (ec *executionContext) _Event(ctx context.Context, sel ast.SelectionSet, obj Event) graphql.Marshaler { 1744 switch obj := (obj).(type) { 1745 case nil: 1746 return graphql.Null 1747 case Post: 1748 return ec._Post(ctx, sel, &obj) 1749 case *Post: 1750 if obj == nil { 1751 return graphql.Null 1752 } 1753 return ec._Post(ctx, sel, obj) 1754 case Like: 1755 return ec._Like(ctx, sel, &obj) 1756 case *Like: 1757 if obj == nil { 1758 return graphql.Null 1759 } 1760 return ec._Like(ctx, sel, obj) 1761 default: 1762 panic(fmt.Errorf("unexpected type %T", obj)) 1763 } 1764 } 1765 1766 // endregion ************************** interface.gotpl *************************** 1767 1768 // region **************************** object.gotpl **************************** 1769 1770 var likeImplementors = []string{"Like", "Event"} 1771 1772 func (ec *executionContext) _Like(ctx context.Context, sel ast.SelectionSet, obj *Like) graphql.Marshaler { 1773 fields := graphql.CollectFields(ec.OperationContext, sel, likeImplementors) 1774 1775 out := graphql.NewFieldSet(fields) 1776 var invalids uint32 1777 for i, field := range fields { 1778 switch field.Name { 1779 case "__typename": 1780 out.Values[i] = graphql.MarshalString("Like") 1781 case "reaction": 1782 out.Values[i] = ec._Like_reaction(ctx, field, obj) 1783 if out.Values[i] == graphql.Null { 1784 invalids++ 1785 } 1786 case "sent": 1787 out.Values[i] = ec._Like_sent(ctx, field, obj) 1788 if out.Values[i] == graphql.Null { 1789 invalids++ 1790 } 1791 case "selection": 1792 out.Values[i] = ec._Like_selection(ctx, field, obj) 1793 case "collected": 1794 out.Values[i] = ec._Like_collected(ctx, field, obj) 1795 default: 1796 panic("unknown field " + strconv.Quote(field.Name)) 1797 } 1798 } 1799 out.Dispatch() 1800 if invalids > 0 { 1801 return graphql.Null 1802 } 1803 return out 1804 } 1805 1806 var postImplementors = []string{"Post", "Event"} 1807 1808 func (ec *executionContext) _Post(ctx context.Context, sel ast.SelectionSet, obj *Post) graphql.Marshaler { 1809 fields := graphql.CollectFields(ec.OperationContext, sel, postImplementors) 1810 1811 out := graphql.NewFieldSet(fields) 1812 var invalids uint32 1813 for i, field := range fields { 1814 switch field.Name { 1815 case "__typename": 1816 out.Values[i] = graphql.MarshalString("Post") 1817 case "message": 1818 out.Values[i] = ec._Post_message(ctx, field, obj) 1819 if out.Values[i] == graphql.Null { 1820 invalids++ 1821 } 1822 case "sent": 1823 out.Values[i] = ec._Post_sent(ctx, field, obj) 1824 if out.Values[i] == graphql.Null { 1825 invalids++ 1826 } 1827 case "selection": 1828 out.Values[i] = ec._Post_selection(ctx, field, obj) 1829 case "collected": 1830 out.Values[i] = ec._Post_collected(ctx, field, obj) 1831 default: 1832 panic("unknown field " + strconv.Quote(field.Name)) 1833 } 1834 } 1835 out.Dispatch() 1836 if invalids > 0 { 1837 return graphql.Null 1838 } 1839 return out 1840 } 1841 1842 var queryImplementors = []string{"Query"} 1843 1844 func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 1845 fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) 1846 1847 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ 1848 Object: "Query", 1849 }) 1850 1851 out := graphql.NewFieldSet(fields) 1852 var invalids uint32 1853 for i, field := range fields { 1854 switch field.Name { 1855 case "__typename": 1856 out.Values[i] = graphql.MarshalString("Query") 1857 case "events": 1858 field := field 1859 out.Concurrently(i, func() (res graphql.Marshaler) { 1860 defer func() { 1861 if r := recover(); r != nil { 1862 ec.Error(ctx, ec.Recover(ctx, r)) 1863 } 1864 }() 1865 res = ec._Query_events(ctx, field) 1866 return res 1867 }) 1868 case "__type": 1869 out.Values[i] = ec._Query___type(ctx, field) 1870 case "__schema": 1871 out.Values[i] = ec._Query___schema(ctx, field) 1872 default: 1873 panic("unknown field " + strconv.Quote(field.Name)) 1874 } 1875 } 1876 out.Dispatch() 1877 if invalids > 0 { 1878 return graphql.Null 1879 } 1880 return out 1881 } 1882 1883 var __DirectiveImplementors = []string{"__Directive"} 1884 1885 func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { 1886 fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) 1887 1888 out := graphql.NewFieldSet(fields) 1889 var invalids uint32 1890 for i, field := range fields { 1891 switch field.Name { 1892 case "__typename": 1893 out.Values[i] = graphql.MarshalString("__Directive") 1894 case "name": 1895 out.Values[i] = ec.___Directive_name(ctx, field, obj) 1896 if out.Values[i] == graphql.Null { 1897 invalids++ 1898 } 1899 case "description": 1900 out.Values[i] = ec.___Directive_description(ctx, field, obj) 1901 case "locations": 1902 out.Values[i] = ec.___Directive_locations(ctx, field, obj) 1903 if out.Values[i] == graphql.Null { 1904 invalids++ 1905 } 1906 case "args": 1907 out.Values[i] = ec.___Directive_args(ctx, field, obj) 1908 if out.Values[i] == graphql.Null { 1909 invalids++ 1910 } 1911 default: 1912 panic("unknown field " + strconv.Quote(field.Name)) 1913 } 1914 } 1915 out.Dispatch() 1916 if invalids > 0 { 1917 return graphql.Null 1918 } 1919 return out 1920 } 1921 1922 var __EnumValueImplementors = []string{"__EnumValue"} 1923 1924 func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { 1925 fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) 1926 1927 out := graphql.NewFieldSet(fields) 1928 var invalids uint32 1929 for i, field := range fields { 1930 switch field.Name { 1931 case "__typename": 1932 out.Values[i] = graphql.MarshalString("__EnumValue") 1933 case "name": 1934 out.Values[i] = ec.___EnumValue_name(ctx, field, obj) 1935 if out.Values[i] == graphql.Null { 1936 invalids++ 1937 } 1938 case "description": 1939 out.Values[i] = ec.___EnumValue_description(ctx, field, obj) 1940 case "isDeprecated": 1941 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) 1942 if out.Values[i] == graphql.Null { 1943 invalids++ 1944 } 1945 case "deprecationReason": 1946 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) 1947 default: 1948 panic("unknown field " + strconv.Quote(field.Name)) 1949 } 1950 } 1951 out.Dispatch() 1952 if invalids > 0 { 1953 return graphql.Null 1954 } 1955 return out 1956 } 1957 1958 var __FieldImplementors = []string{"__Field"} 1959 1960 func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { 1961 fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) 1962 1963 out := graphql.NewFieldSet(fields) 1964 var invalids uint32 1965 for i, field := range fields { 1966 switch field.Name { 1967 case "__typename": 1968 out.Values[i] = graphql.MarshalString("__Field") 1969 case "name": 1970 out.Values[i] = ec.___Field_name(ctx, field, obj) 1971 if out.Values[i] == graphql.Null { 1972 invalids++ 1973 } 1974 case "description": 1975 out.Values[i] = ec.___Field_description(ctx, field, obj) 1976 case "args": 1977 out.Values[i] = ec.___Field_args(ctx, field, obj) 1978 if out.Values[i] == graphql.Null { 1979 invalids++ 1980 } 1981 case "type": 1982 out.Values[i] = ec.___Field_type(ctx, field, obj) 1983 if out.Values[i] == graphql.Null { 1984 invalids++ 1985 } 1986 case "isDeprecated": 1987 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) 1988 if out.Values[i] == graphql.Null { 1989 invalids++ 1990 } 1991 case "deprecationReason": 1992 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) 1993 default: 1994 panic("unknown field " + strconv.Quote(field.Name)) 1995 } 1996 } 1997 out.Dispatch() 1998 if invalids > 0 { 1999 return graphql.Null 2000 } 2001 return out 2002 } 2003 2004 var __InputValueImplementors = []string{"__InputValue"} 2005 2006 func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { 2007 fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) 2008 2009 out := graphql.NewFieldSet(fields) 2010 var invalids uint32 2011 for i, field := range fields { 2012 switch field.Name { 2013 case "__typename": 2014 out.Values[i] = graphql.MarshalString("__InputValue") 2015 case "name": 2016 out.Values[i] = ec.___InputValue_name(ctx, field, obj) 2017 if out.Values[i] == graphql.Null { 2018 invalids++ 2019 } 2020 case "description": 2021 out.Values[i] = ec.___InputValue_description(ctx, field, obj) 2022 case "type": 2023 out.Values[i] = ec.___InputValue_type(ctx, field, obj) 2024 if out.Values[i] == graphql.Null { 2025 invalids++ 2026 } 2027 case "defaultValue": 2028 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) 2029 default: 2030 panic("unknown field " + strconv.Quote(field.Name)) 2031 } 2032 } 2033 out.Dispatch() 2034 if invalids > 0 { 2035 return graphql.Null 2036 } 2037 return out 2038 } 2039 2040 var __SchemaImplementors = []string{"__Schema"} 2041 2042 func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { 2043 fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) 2044 2045 out := graphql.NewFieldSet(fields) 2046 var invalids uint32 2047 for i, field := range fields { 2048 switch field.Name { 2049 case "__typename": 2050 out.Values[i] = graphql.MarshalString("__Schema") 2051 case "types": 2052 out.Values[i] = ec.___Schema_types(ctx, field, obj) 2053 if out.Values[i] == graphql.Null { 2054 invalids++ 2055 } 2056 case "queryType": 2057 out.Values[i] = ec.___Schema_queryType(ctx, field, obj) 2058 if out.Values[i] == graphql.Null { 2059 invalids++ 2060 } 2061 case "mutationType": 2062 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) 2063 case "subscriptionType": 2064 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) 2065 case "directives": 2066 out.Values[i] = ec.___Schema_directives(ctx, field, obj) 2067 if out.Values[i] == graphql.Null { 2068 invalids++ 2069 } 2070 default: 2071 panic("unknown field " + strconv.Quote(field.Name)) 2072 } 2073 } 2074 out.Dispatch() 2075 if invalids > 0 { 2076 return graphql.Null 2077 } 2078 return out 2079 } 2080 2081 var __TypeImplementors = []string{"__Type"} 2082 2083 func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { 2084 fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) 2085 2086 out := graphql.NewFieldSet(fields) 2087 var invalids uint32 2088 for i, field := range fields { 2089 switch field.Name { 2090 case "__typename": 2091 out.Values[i] = graphql.MarshalString("__Type") 2092 case "kind": 2093 out.Values[i] = ec.___Type_kind(ctx, field, obj) 2094 if out.Values[i] == graphql.Null { 2095 invalids++ 2096 } 2097 case "name": 2098 out.Values[i] = ec.___Type_name(ctx, field, obj) 2099 case "description": 2100 out.Values[i] = ec.___Type_description(ctx, field, obj) 2101 case "fields": 2102 out.Values[i] = ec.___Type_fields(ctx, field, obj) 2103 case "interfaces": 2104 out.Values[i] = ec.___Type_interfaces(ctx, field, obj) 2105 case "possibleTypes": 2106 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) 2107 case "enumValues": 2108 out.Values[i] = ec.___Type_enumValues(ctx, field, obj) 2109 case "inputFields": 2110 out.Values[i] = ec.___Type_inputFields(ctx, field, obj) 2111 case "ofType": 2112 out.Values[i] = ec.___Type_ofType(ctx, field, obj) 2113 default: 2114 panic("unknown field " + strconv.Quote(field.Name)) 2115 } 2116 } 2117 out.Dispatch() 2118 if invalids > 0 { 2119 return graphql.Null 2120 } 2121 return out 2122 } 2123 2124 // endregion **************************** object.gotpl **************************** 2125 2126 // region ***************************** type.gotpl ***************************** 2127 2128 func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 2129 res, err := graphql.UnmarshalBoolean(v) 2130 return res, graphql.ErrorOnPath(ctx, err) 2131 } 2132 2133 func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 2134 res := graphql.MarshalBoolean(v) 2135 if res == graphql.Null { 2136 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 2137 ec.Errorf(ctx, "must not be null") 2138 } 2139 } 2140 return res 2141 } 2142 2143 func (ec *executionContext) marshalNEvent2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋselectionᚐEvent(ctx context.Context, sel ast.SelectionSet, v Event) graphql.Marshaler { 2144 if v == nil { 2145 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 2146 ec.Errorf(ctx, "must not be null") 2147 } 2148 return graphql.Null 2149 } 2150 return ec._Event(ctx, sel, v) 2151 } 2152 2153 func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { 2154 res, err := graphql.UnmarshalString(v) 2155 return res, graphql.ErrorOnPath(ctx, err) 2156 } 2157 2158 func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 2159 res := graphql.MarshalString(v) 2160 if res == graphql.Null { 2161 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 2162 ec.Errorf(ctx, "must not be null") 2163 } 2164 } 2165 return res 2166 } 2167 2168 func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { 2169 res, err := graphql.UnmarshalTime(v) 2170 return res, graphql.ErrorOnPath(ctx, err) 2171 } 2172 2173 func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { 2174 res := graphql.MarshalTime(v) 2175 if res == graphql.Null { 2176 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 2177 ec.Errorf(ctx, "must not be null") 2178 } 2179 } 2180 return res 2181 } 2182 2183 func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { 2184 return ec.___Directive(ctx, sel, &v) 2185 } 2186 2187 func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { 2188 ret := make(graphql.Array, len(v)) 2189 var wg sync.WaitGroup 2190 isLen1 := len(v) == 1 2191 if !isLen1 { 2192 wg.Add(len(v)) 2193 } 2194 for i := range v { 2195 i := i 2196 fc := &graphql.FieldContext{ 2197 Index: &i, 2198 Result: &v[i], 2199 } 2200 ctx := graphql.WithFieldContext(ctx, fc) 2201 f := func(i int) { 2202 defer func() { 2203 if r := recover(); r != nil { 2204 ec.Error(ctx, ec.Recover(ctx, r)) 2205 ret = nil 2206 } 2207 }() 2208 if !isLen1 { 2209 defer wg.Done() 2210 } 2211 ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) 2212 } 2213 if isLen1 { 2214 f(i) 2215 } else { 2216 go f(i) 2217 } 2218 2219 } 2220 wg.Wait() 2221 2222 for _, e := range ret { 2223 if e == graphql.Null { 2224 return graphql.Null 2225 } 2226 } 2227 2228 return ret 2229 } 2230 2231 func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { 2232 res, err := graphql.UnmarshalString(v) 2233 return res, graphql.ErrorOnPath(ctx, err) 2234 } 2235 2236 func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 2237 res := graphql.MarshalString(v) 2238 if res == graphql.Null { 2239 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 2240 ec.Errorf(ctx, "must not be null") 2241 } 2242 } 2243 return res 2244 } 2245 2246 func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { 2247 var vSlice []interface{} 2248 if v != nil { 2249 if tmp1, ok := v.([]interface{}); ok { 2250 vSlice = tmp1 2251 } else { 2252 vSlice = []interface{}{v} 2253 } 2254 } 2255 var err error 2256 res := make([]string, len(vSlice)) 2257 for i := range vSlice { 2258 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) 2259 res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) 2260 if err != nil { 2261 return nil, err 2262 } 2263 } 2264 return res, nil 2265 } 2266 2267 func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { 2268 ret := make(graphql.Array, len(v)) 2269 var wg sync.WaitGroup 2270 isLen1 := len(v) == 1 2271 if !isLen1 { 2272 wg.Add(len(v)) 2273 } 2274 for i := range v { 2275 i := i 2276 fc := &graphql.FieldContext{ 2277 Index: &i, 2278 Result: &v[i], 2279 } 2280 ctx := graphql.WithFieldContext(ctx, fc) 2281 f := func(i int) { 2282 defer func() { 2283 if r := recover(); r != nil { 2284 ec.Error(ctx, ec.Recover(ctx, r)) 2285 ret = nil 2286 } 2287 }() 2288 if !isLen1 { 2289 defer wg.Done() 2290 } 2291 ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) 2292 } 2293 if isLen1 { 2294 f(i) 2295 } else { 2296 go f(i) 2297 } 2298 2299 } 2300 wg.Wait() 2301 2302 for _, e := range ret { 2303 if e == graphql.Null { 2304 return graphql.Null 2305 } 2306 } 2307 2308 return ret 2309 } 2310 2311 func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { 2312 return ec.___EnumValue(ctx, sel, &v) 2313 } 2314 2315 func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { 2316 return ec.___Field(ctx, sel, &v) 2317 } 2318 2319 func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { 2320 return ec.___InputValue(ctx, sel, &v) 2321 } 2322 2323 func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 2324 ret := make(graphql.Array, len(v)) 2325 var wg sync.WaitGroup 2326 isLen1 := len(v) == 1 2327 if !isLen1 { 2328 wg.Add(len(v)) 2329 } 2330 for i := range v { 2331 i := i 2332 fc := &graphql.FieldContext{ 2333 Index: &i, 2334 Result: &v[i], 2335 } 2336 ctx := graphql.WithFieldContext(ctx, fc) 2337 f := func(i int) { 2338 defer func() { 2339 if r := recover(); r != nil { 2340 ec.Error(ctx, ec.Recover(ctx, r)) 2341 ret = nil 2342 } 2343 }() 2344 if !isLen1 { 2345 defer wg.Done() 2346 } 2347 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 2348 } 2349 if isLen1 { 2350 f(i) 2351 } else { 2352 go f(i) 2353 } 2354 2355 } 2356 wg.Wait() 2357 2358 for _, e := range ret { 2359 if e == graphql.Null { 2360 return graphql.Null 2361 } 2362 } 2363 2364 return ret 2365 } 2366 2367 func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { 2368 return ec.___Type(ctx, sel, &v) 2369 } 2370 2371 func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 2372 ret := make(graphql.Array, len(v)) 2373 var wg sync.WaitGroup 2374 isLen1 := len(v) == 1 2375 if !isLen1 { 2376 wg.Add(len(v)) 2377 } 2378 for i := range v { 2379 i := i 2380 fc := &graphql.FieldContext{ 2381 Index: &i, 2382 Result: &v[i], 2383 } 2384 ctx := graphql.WithFieldContext(ctx, fc) 2385 f := func(i int) { 2386 defer func() { 2387 if r := recover(); r != nil { 2388 ec.Error(ctx, ec.Recover(ctx, r)) 2389 ret = nil 2390 } 2391 }() 2392 if !isLen1 { 2393 defer wg.Done() 2394 } 2395 ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 2396 } 2397 if isLen1 { 2398 f(i) 2399 } else { 2400 go f(i) 2401 } 2402 2403 } 2404 wg.Wait() 2405 2406 for _, e := range ret { 2407 if e == graphql.Null { 2408 return graphql.Null 2409 } 2410 } 2411 2412 return ret 2413 } 2414 2415 func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 2416 if v == nil { 2417 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 2418 ec.Errorf(ctx, "must not be null") 2419 } 2420 return graphql.Null 2421 } 2422 return ec.___Type(ctx, sel, v) 2423 } 2424 2425 func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { 2426 res, err := graphql.UnmarshalString(v) 2427 return res, graphql.ErrorOnPath(ctx, err) 2428 } 2429 2430 func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 2431 res := graphql.MarshalString(v) 2432 if res == graphql.Null { 2433 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 2434 ec.Errorf(ctx, "must not be null") 2435 } 2436 } 2437 return res 2438 } 2439 2440 func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 2441 res, err := graphql.UnmarshalBoolean(v) 2442 return res, graphql.ErrorOnPath(ctx, err) 2443 } 2444 2445 func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 2446 return graphql.MarshalBoolean(v) 2447 } 2448 2449 func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { 2450 if v == nil { 2451 return nil, nil 2452 } 2453 res, err := graphql.UnmarshalBoolean(v) 2454 return &res, graphql.ErrorOnPath(ctx, err) 2455 } 2456 2457 func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { 2458 if v == nil { 2459 return graphql.Null 2460 } 2461 return graphql.MarshalBoolean(*v) 2462 } 2463 2464 func (ec *executionContext) marshalOEvent2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋselectionᚐEventᚄ(ctx context.Context, sel ast.SelectionSet, v []Event) graphql.Marshaler { 2465 if v == nil { 2466 return graphql.Null 2467 } 2468 ret := make(graphql.Array, len(v)) 2469 var wg sync.WaitGroup 2470 isLen1 := len(v) == 1 2471 if !isLen1 { 2472 wg.Add(len(v)) 2473 } 2474 for i := range v { 2475 i := i 2476 fc := &graphql.FieldContext{ 2477 Index: &i, 2478 Result: &v[i], 2479 } 2480 ctx := graphql.WithFieldContext(ctx, fc) 2481 f := func(i int) { 2482 defer func() { 2483 if r := recover(); r != nil { 2484 ec.Error(ctx, ec.Recover(ctx, r)) 2485 ret = nil 2486 } 2487 }() 2488 if !isLen1 { 2489 defer wg.Done() 2490 } 2491 ret[i] = ec.marshalNEvent2githubᚗcomᚋ99designsᚋgqlgenᚋexampleᚋselectionᚐEvent(ctx, sel, v[i]) 2492 } 2493 if isLen1 { 2494 f(i) 2495 } else { 2496 go f(i) 2497 } 2498 2499 } 2500 wg.Wait() 2501 2502 for _, e := range ret { 2503 if e == graphql.Null { 2504 return graphql.Null 2505 } 2506 } 2507 2508 return ret 2509 } 2510 2511 func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { 2512 res, err := graphql.UnmarshalString(v) 2513 return res, graphql.ErrorOnPath(ctx, err) 2514 } 2515 2516 func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 2517 return graphql.MarshalString(v) 2518 } 2519 2520 func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { 2521 if v == nil { 2522 return nil, nil 2523 } 2524 var vSlice []interface{} 2525 if v != nil { 2526 if tmp1, ok := v.([]interface{}); ok { 2527 vSlice = tmp1 2528 } else { 2529 vSlice = []interface{}{v} 2530 } 2531 } 2532 var err error 2533 res := make([]string, len(vSlice)) 2534 for i := range vSlice { 2535 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) 2536 res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) 2537 if err != nil { 2538 return nil, err 2539 } 2540 } 2541 return res, nil 2542 } 2543 2544 func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { 2545 if v == nil { 2546 return graphql.Null 2547 } 2548 ret := make(graphql.Array, len(v)) 2549 for i := range v { 2550 ret[i] = ec.marshalNString2string(ctx, sel, v[i]) 2551 } 2552 2553 for _, e := range ret { 2554 if e == graphql.Null { 2555 return graphql.Null 2556 } 2557 } 2558 2559 return ret 2560 } 2561 2562 func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { 2563 if v == nil { 2564 return nil, nil 2565 } 2566 res, err := graphql.UnmarshalString(v) 2567 return &res, graphql.ErrorOnPath(ctx, err) 2568 } 2569 2570 func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { 2571 if v == nil { 2572 return graphql.Null 2573 } 2574 return graphql.MarshalString(*v) 2575 } 2576 2577 func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { 2578 if v == nil { 2579 return graphql.Null 2580 } 2581 ret := make(graphql.Array, len(v)) 2582 var wg sync.WaitGroup 2583 isLen1 := len(v) == 1 2584 if !isLen1 { 2585 wg.Add(len(v)) 2586 } 2587 for i := range v { 2588 i := i 2589 fc := &graphql.FieldContext{ 2590 Index: &i, 2591 Result: &v[i], 2592 } 2593 ctx := graphql.WithFieldContext(ctx, fc) 2594 f := func(i int) { 2595 defer func() { 2596 if r := recover(); r != nil { 2597 ec.Error(ctx, ec.Recover(ctx, r)) 2598 ret = nil 2599 } 2600 }() 2601 if !isLen1 { 2602 defer wg.Done() 2603 } 2604 ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) 2605 } 2606 if isLen1 { 2607 f(i) 2608 } else { 2609 go f(i) 2610 } 2611 2612 } 2613 wg.Wait() 2614 2615 for _, e := range ret { 2616 if e == graphql.Null { 2617 return graphql.Null 2618 } 2619 } 2620 2621 return ret 2622 } 2623 2624 func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { 2625 if v == nil { 2626 return graphql.Null 2627 } 2628 ret := make(graphql.Array, len(v)) 2629 var wg sync.WaitGroup 2630 isLen1 := len(v) == 1 2631 if !isLen1 { 2632 wg.Add(len(v)) 2633 } 2634 for i := range v { 2635 i := i 2636 fc := &graphql.FieldContext{ 2637 Index: &i, 2638 Result: &v[i], 2639 } 2640 ctx := graphql.WithFieldContext(ctx, fc) 2641 f := func(i int) { 2642 defer func() { 2643 if r := recover(); r != nil { 2644 ec.Error(ctx, ec.Recover(ctx, r)) 2645 ret = nil 2646 } 2647 }() 2648 if !isLen1 { 2649 defer wg.Done() 2650 } 2651 ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) 2652 } 2653 if isLen1 { 2654 f(i) 2655 } else { 2656 go f(i) 2657 } 2658 2659 } 2660 wg.Wait() 2661 2662 for _, e := range ret { 2663 if e == graphql.Null { 2664 return graphql.Null 2665 } 2666 } 2667 2668 return ret 2669 } 2670 2671 func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 2672 if v == nil { 2673 return graphql.Null 2674 } 2675 ret := make(graphql.Array, len(v)) 2676 var wg sync.WaitGroup 2677 isLen1 := len(v) == 1 2678 if !isLen1 { 2679 wg.Add(len(v)) 2680 } 2681 for i := range v { 2682 i := i 2683 fc := &graphql.FieldContext{ 2684 Index: &i, 2685 Result: &v[i], 2686 } 2687 ctx := graphql.WithFieldContext(ctx, fc) 2688 f := func(i int) { 2689 defer func() { 2690 if r := recover(); r != nil { 2691 ec.Error(ctx, ec.Recover(ctx, r)) 2692 ret = nil 2693 } 2694 }() 2695 if !isLen1 { 2696 defer wg.Done() 2697 } 2698 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 2699 } 2700 if isLen1 { 2701 f(i) 2702 } else { 2703 go f(i) 2704 } 2705 2706 } 2707 wg.Wait() 2708 2709 for _, e := range ret { 2710 if e == graphql.Null { 2711 return graphql.Null 2712 } 2713 } 2714 2715 return ret 2716 } 2717 2718 func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { 2719 if v == nil { 2720 return graphql.Null 2721 } 2722 return ec.___Schema(ctx, sel, v) 2723 } 2724 2725 func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 2726 if v == nil { 2727 return graphql.Null 2728 } 2729 ret := make(graphql.Array, len(v)) 2730 var wg sync.WaitGroup 2731 isLen1 := len(v) == 1 2732 if !isLen1 { 2733 wg.Add(len(v)) 2734 } 2735 for i := range v { 2736 i := i 2737 fc := &graphql.FieldContext{ 2738 Index: &i, 2739 Result: &v[i], 2740 } 2741 ctx := graphql.WithFieldContext(ctx, fc) 2742 f := func(i int) { 2743 defer func() { 2744 if r := recover(); r != nil { 2745 ec.Error(ctx, ec.Recover(ctx, r)) 2746 ret = nil 2747 } 2748 }() 2749 if !isLen1 { 2750 defer wg.Done() 2751 } 2752 ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 2753 } 2754 if isLen1 { 2755 f(i) 2756 } else { 2757 go f(i) 2758 } 2759 2760 } 2761 wg.Wait() 2762 2763 for _, e := range ret { 2764 if e == graphql.Null { 2765 return graphql.Null 2766 } 2767 } 2768 2769 return ret 2770 } 2771 2772 func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 2773 if v == nil { 2774 return graphql.Null 2775 } 2776 return ec.___Type(ctx, sel, v) 2777 } 2778 2779 // endregion ***************************** type.gotpl *****************************