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