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