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