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