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