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