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