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