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