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