github.com/mstephano/gqlgen-schemagen@v0.0.0-20230113041936-dd2cd4ea46aa/api/testdata/default/graph/generated.go (about) 1 // Code generated by github.com/mstephano/gqlgen-schemagen, DO NOT EDIT. 2 3 package graph 4 5 import ( 6 "bytes" 7 "context" 8 "embed" 9 "errors" 10 "fmt" 11 "strconv" 12 "sync" 13 14 "github.com/mstephano/gqlgen-schemagen/api/testdata/default/graph/model" 15 "github.com/mstephano/gqlgen-schemagen/graphql" 16 "github.com/mstephano/gqlgen-schemagen/graphql/introspection" 17 gqlparser "github.com/vektah/gqlparser/v2" 18 "github.com/vektah/gqlparser/v2/ast" 19 ) 20 21 // region ************************** generated!.gotpl ************************** 22 23 // NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. 24 func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { 25 return &executableSchema{ 26 resolvers: cfg.Resolvers, 27 directives: cfg.Directives, 28 complexity: cfg.Complexity, 29 } 30 } 31 32 type Config struct { 33 Resolvers ResolverRoot 34 Directives DirectiveRoot 35 Complexity ComplexityRoot 36 } 37 38 type ResolverRoot interface { 39 Mutation() MutationResolver 40 Query() QueryResolver 41 } 42 43 type DirectiveRoot struct { 44 } 45 46 type ComplexityRoot struct { 47 Mutation struct { 48 CreateTodo func(childComplexity int, input model.NewTodo) int 49 } 50 51 Query struct { 52 Todos func(childComplexity int) int 53 } 54 55 Todo struct { 56 Done func(childComplexity int) int 57 ID func(childComplexity int) int 58 Text func(childComplexity int) int 59 User func(childComplexity int) int 60 } 61 62 User struct { 63 ID func(childComplexity int) int 64 Name func(childComplexity int) int 65 } 66 } 67 68 type MutationResolver interface { 69 CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error) 70 } 71 type QueryResolver interface { 72 Todos(ctx context.Context) ([]*model.Todo, error) 73 } 74 75 type executableSchema struct { 76 resolvers ResolverRoot 77 directives DirectiveRoot 78 complexity ComplexityRoot 79 } 80 81 func (e *executableSchema) Schema() *ast.Schema { 82 return parsedSchema 83 } 84 85 func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { 86 ec := executionContext{nil, e} 87 _ = ec 88 switch typeName + "." + field { 89 90 case "Mutation.createTodo": 91 if e.complexity.Mutation.CreateTodo == nil { 92 break 93 } 94 95 args, err := ec.field_Mutation_createTodo_args(context.TODO(), rawArgs) 96 if err != nil { 97 return 0, false 98 } 99 100 return e.complexity.Mutation.CreateTodo(childComplexity, args["input"].(model.NewTodo)), true 101 102 case "Query.todos": 103 if e.complexity.Query.Todos == nil { 104 break 105 } 106 107 return e.complexity.Query.Todos(childComplexity), true 108 109 case "Todo.done": 110 if e.complexity.Todo.Done == nil { 111 break 112 } 113 114 return e.complexity.Todo.Done(childComplexity), true 115 116 case "Todo.id": 117 if e.complexity.Todo.ID == nil { 118 break 119 } 120 121 return e.complexity.Todo.ID(childComplexity), true 122 123 case "Todo.text": 124 if e.complexity.Todo.Text == nil { 125 break 126 } 127 128 return e.complexity.Todo.Text(childComplexity), true 129 130 case "Todo.user": 131 if e.complexity.Todo.User == nil { 132 break 133 } 134 135 return e.complexity.Todo.User(childComplexity), true 136 137 case "User.id": 138 if e.complexity.User.ID == nil { 139 break 140 } 141 142 return e.complexity.User.ID(childComplexity), true 143 144 case "User.name": 145 if e.complexity.User.Name == nil { 146 break 147 } 148 149 return e.complexity.User.Name(childComplexity), true 150 151 } 152 return 0, false 153 } 154 155 func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { 156 rc := graphql.GetOperationContext(ctx) 157 ec := executionContext{rc, e} 158 inputUnmarshalMap := graphql.BuildUnmarshalerMap( 159 ec.unmarshalInputNewTodo, 160 ) 161 first := true 162 163 switch rc.Operation.Operation { 164 case ast.Query: 165 return func(ctx context.Context) *graphql.Response { 166 if !first { 167 return nil 168 } 169 first = false 170 ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) 171 data := ec._Query(ctx, rc.Operation.SelectionSet) 172 var buf bytes.Buffer 173 data.MarshalGQL(&buf) 174 175 return &graphql.Response{ 176 Data: buf.Bytes(), 177 } 178 } 179 case ast.Mutation: 180 return func(ctx context.Context) *graphql.Response { 181 if !first { 182 return nil 183 } 184 first = false 185 ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) 186 data := ec._Mutation(ctx, rc.Operation.SelectionSet) 187 var buf bytes.Buffer 188 data.MarshalGQL(&buf) 189 190 return &graphql.Response{ 191 Data: buf.Bytes(), 192 } 193 } 194 195 default: 196 return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) 197 } 198 } 199 200 type executionContext struct { 201 *graphql.OperationContext 202 *executableSchema 203 } 204 205 func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { 206 if ec.DisableIntrospection { 207 return nil, errors.New("introspection disabled") 208 } 209 return introspection.WrapSchema(parsedSchema), nil 210 } 211 212 func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { 213 if ec.DisableIntrospection { 214 return nil, errors.New("introspection disabled") 215 } 216 return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil 217 } 218 219 //go:embed "schema.graphqls" 220 var sourcesFS embed.FS 221 222 func sourceData(filename string) string { 223 data, err := sourcesFS.ReadFile(filename) 224 if err != nil { 225 panic(fmt.Sprintf("codegen problem: %s not available", filename)) 226 } 227 return string(data) 228 } 229 230 var sources = []*ast.Source{ 231 {Name: "schema.graphqls", Input: sourceData("schema.graphqls"), BuiltIn: false}, 232 } 233 var parsedSchema = gqlparser.MustLoadSchema(sources...) 234 235 // endregion ************************** generated!.gotpl ************************** 236 237 // region ***************************** args.gotpl ***************************** 238 239 func (ec *executionContext) field_Mutation_createTodo_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 240 var err error 241 args := map[string]interface{}{} 242 var arg0 model.NewTodo 243 if tmp, ok := rawArgs["input"]; ok { 244 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) 245 arg0, err = ec.unmarshalNNewTodo2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐNewTodo(ctx, tmp) 246 if err != nil { 247 return nil, err 248 } 249 } 250 args["input"] = arg0 251 return args, nil 252 } 253 254 func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 255 var err error 256 args := map[string]interface{}{} 257 var arg0 string 258 if tmp, ok := rawArgs["name"]; ok { 259 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) 260 arg0, err = ec.unmarshalNString2string(ctx, tmp) 261 if err != nil { 262 return nil, err 263 } 264 } 265 args["name"] = arg0 266 return args, nil 267 } 268 269 func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 270 var err error 271 args := map[string]interface{}{} 272 var arg0 bool 273 if tmp, ok := rawArgs["includeDeprecated"]; ok { 274 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) 275 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 276 if err != nil { 277 return nil, err 278 } 279 } 280 args["includeDeprecated"] = arg0 281 return args, nil 282 } 283 284 func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 285 var err error 286 args := map[string]interface{}{} 287 var arg0 bool 288 if tmp, ok := rawArgs["includeDeprecated"]; ok { 289 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) 290 arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) 291 if err != nil { 292 return nil, err 293 } 294 } 295 args["includeDeprecated"] = arg0 296 return args, nil 297 } 298 299 // endregion ***************************** args.gotpl ***************************** 300 301 // region ************************** directives.gotpl ************************** 302 303 // endregion ************************** directives.gotpl ************************** 304 305 // region **************************** field.gotpl ***************************** 306 307 func (ec *executionContext) _Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 308 fc, err := ec.fieldContext_Mutation_createTodo(ctx, field) 309 if err != nil { 310 return graphql.Null 311 } 312 ctx = graphql.WithFieldContext(ctx, fc) 313 defer func() { 314 if r := recover(); r != nil { 315 ec.Error(ctx, ec.Recover(ctx, r)) 316 ret = graphql.Null 317 } 318 }() 319 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 320 ctx = rctx // use context from middleware stack in children 321 return ec.resolvers.Mutation().CreateTodo(rctx, fc.Args["input"].(model.NewTodo)) 322 }) 323 if err != nil { 324 ec.Error(ctx, err) 325 } 326 if resTmp == nil { 327 if !graphql.HasFieldError(ctx, fc) { 328 ec.Errorf(ctx, "must not be null") 329 } 330 return graphql.Null 331 } 332 res := resTmp.(*model.Todo) 333 fc.Result = res 334 return ec.marshalNTodo2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐTodo(ctx, field.Selections, res) 335 } 336 337 func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 338 fc = &graphql.FieldContext{ 339 Object: "Mutation", 340 Field: field, 341 IsMethod: true, 342 IsResolver: true, 343 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 344 switch field.Name { 345 case "id": 346 return ec.fieldContext_Todo_id(ctx, field) 347 case "text": 348 return ec.fieldContext_Todo_text(ctx, field) 349 case "done": 350 return ec.fieldContext_Todo_done(ctx, field) 351 case "user": 352 return ec.fieldContext_Todo_user(ctx, field) 353 } 354 return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) 355 }, 356 } 357 defer func() { 358 if r := recover(); r != nil { 359 err = ec.Recover(ctx, r) 360 ec.Error(ctx, err) 361 } 362 }() 363 ctx = graphql.WithFieldContext(ctx, fc) 364 if fc.Args, err = ec.field_Mutation_createTodo_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { 365 ec.Error(ctx, err) 366 return 367 } 368 return fc, nil 369 } 370 371 func (ec *executionContext) _Query_todos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 372 fc, err := ec.fieldContext_Query_todos(ctx, field) 373 if err != nil { 374 return graphql.Null 375 } 376 ctx = graphql.WithFieldContext(ctx, fc) 377 defer func() { 378 if r := recover(); r != nil { 379 ec.Error(ctx, ec.Recover(ctx, r)) 380 ret = graphql.Null 381 } 382 }() 383 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 384 ctx = rctx // use context from middleware stack in children 385 return ec.resolvers.Query().Todos(rctx) 386 }) 387 if err != nil { 388 ec.Error(ctx, err) 389 } 390 if resTmp == nil { 391 if !graphql.HasFieldError(ctx, fc) { 392 ec.Errorf(ctx, "must not be null") 393 } 394 return graphql.Null 395 } 396 res := resTmp.([]*model.Todo) 397 fc.Result = res 398 return ec.marshalNTodo2ᚕᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐTodoᚄ(ctx, field.Selections, res) 399 } 400 401 func (ec *executionContext) fieldContext_Query_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 402 fc = &graphql.FieldContext{ 403 Object: "Query", 404 Field: field, 405 IsMethod: true, 406 IsResolver: true, 407 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 408 switch field.Name { 409 case "id": 410 return ec.fieldContext_Todo_id(ctx, field) 411 case "text": 412 return ec.fieldContext_Todo_text(ctx, field) 413 case "done": 414 return ec.fieldContext_Todo_done(ctx, field) 415 case "user": 416 return ec.fieldContext_Todo_user(ctx, field) 417 } 418 return nil, fmt.Errorf("no field named %q was found under type Todo", field.Name) 419 }, 420 } 421 return fc, nil 422 } 423 424 func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 425 fc, err := ec.fieldContext_Query___type(ctx, field) 426 if err != nil { 427 return graphql.Null 428 } 429 ctx = graphql.WithFieldContext(ctx, fc) 430 defer func() { 431 if r := recover(); r != nil { 432 ec.Error(ctx, ec.Recover(ctx, r)) 433 ret = graphql.Null 434 } 435 }() 436 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 437 ctx = rctx // use context from middleware stack in children 438 return ec.introspectType(fc.Args["name"].(string)) 439 }) 440 if err != nil { 441 ec.Error(ctx, err) 442 } 443 if resTmp == nil { 444 return graphql.Null 445 } 446 res := resTmp.(*introspection.Type) 447 fc.Result = res 448 return ec.marshalO__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 449 } 450 451 func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 452 fc = &graphql.FieldContext{ 453 Object: "Query", 454 Field: field, 455 IsMethod: true, 456 IsResolver: false, 457 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 458 switch field.Name { 459 case "kind": 460 return ec.fieldContext___Type_kind(ctx, field) 461 case "name": 462 return ec.fieldContext___Type_name(ctx, field) 463 case "description": 464 return ec.fieldContext___Type_description(ctx, field) 465 case "fields": 466 return ec.fieldContext___Type_fields(ctx, field) 467 case "interfaces": 468 return ec.fieldContext___Type_interfaces(ctx, field) 469 case "possibleTypes": 470 return ec.fieldContext___Type_possibleTypes(ctx, field) 471 case "enumValues": 472 return ec.fieldContext___Type_enumValues(ctx, field) 473 case "inputFields": 474 return ec.fieldContext___Type_inputFields(ctx, field) 475 case "ofType": 476 return ec.fieldContext___Type_ofType(ctx, field) 477 case "specifiedByURL": 478 return ec.fieldContext___Type_specifiedByURL(ctx, field) 479 } 480 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 481 }, 482 } 483 defer func() { 484 if r := recover(); r != nil { 485 err = ec.Recover(ctx, r) 486 ec.Error(ctx, err) 487 } 488 }() 489 ctx = graphql.WithFieldContext(ctx, fc) 490 if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { 491 ec.Error(ctx, err) 492 return 493 } 494 return fc, nil 495 } 496 497 func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { 498 fc, err := ec.fieldContext_Query___schema(ctx, field) 499 if err != nil { 500 return graphql.Null 501 } 502 ctx = graphql.WithFieldContext(ctx, fc) 503 defer func() { 504 if r := recover(); r != nil { 505 ec.Error(ctx, ec.Recover(ctx, r)) 506 ret = graphql.Null 507 } 508 }() 509 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 510 ctx = rctx // use context from middleware stack in children 511 return ec.introspectSchema() 512 }) 513 if err != nil { 514 ec.Error(ctx, err) 515 } 516 if resTmp == nil { 517 return graphql.Null 518 } 519 res := resTmp.(*introspection.Schema) 520 fc.Result = res 521 return ec.marshalO__Schema2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) 522 } 523 524 func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 525 fc = &graphql.FieldContext{ 526 Object: "Query", 527 Field: field, 528 IsMethod: true, 529 IsResolver: false, 530 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 531 switch field.Name { 532 case "description": 533 return ec.fieldContext___Schema_description(ctx, field) 534 case "types": 535 return ec.fieldContext___Schema_types(ctx, field) 536 case "queryType": 537 return ec.fieldContext___Schema_queryType(ctx, field) 538 case "mutationType": 539 return ec.fieldContext___Schema_mutationType(ctx, field) 540 case "subscriptionType": 541 return ec.fieldContext___Schema_subscriptionType(ctx, field) 542 case "directives": 543 return ec.fieldContext___Schema_directives(ctx, field) 544 } 545 return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) 546 }, 547 } 548 return fc, nil 549 } 550 551 func (ec *executionContext) _Todo_id(ctx context.Context, field graphql.CollectedField, obj *model.Todo) (ret graphql.Marshaler) { 552 fc, err := ec.fieldContext_Todo_id(ctx, field) 553 if err != nil { 554 return graphql.Null 555 } 556 ctx = graphql.WithFieldContext(ctx, fc) 557 defer func() { 558 if r := recover(); r != nil { 559 ec.Error(ctx, ec.Recover(ctx, r)) 560 ret = graphql.Null 561 } 562 }() 563 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 564 ctx = rctx // use context from middleware stack in children 565 return obj.ID, nil 566 }) 567 if err != nil { 568 ec.Error(ctx, err) 569 return graphql.Null 570 } 571 if resTmp == nil { 572 if !graphql.HasFieldError(ctx, fc) { 573 ec.Errorf(ctx, "must not be null") 574 } 575 return graphql.Null 576 } 577 res := resTmp.(string) 578 fc.Result = res 579 return ec.marshalNID2string(ctx, field.Selections, res) 580 } 581 582 func (ec *executionContext) fieldContext_Todo_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 583 fc = &graphql.FieldContext{ 584 Object: "Todo", 585 Field: field, 586 IsMethod: false, 587 IsResolver: false, 588 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 589 return nil, errors.New("field of type ID does not have child fields") 590 }, 591 } 592 return fc, nil 593 } 594 595 func (ec *executionContext) _Todo_text(ctx context.Context, field graphql.CollectedField, obj *model.Todo) (ret graphql.Marshaler) { 596 fc, err := ec.fieldContext_Todo_text(ctx, field) 597 if err != nil { 598 return graphql.Null 599 } 600 ctx = graphql.WithFieldContext(ctx, fc) 601 defer func() { 602 if r := recover(); r != nil { 603 ec.Error(ctx, ec.Recover(ctx, r)) 604 ret = graphql.Null 605 } 606 }() 607 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 608 ctx = rctx // use context from middleware stack in children 609 return obj.Text, nil 610 }) 611 if err != nil { 612 ec.Error(ctx, err) 613 return graphql.Null 614 } 615 if resTmp == nil { 616 if !graphql.HasFieldError(ctx, fc) { 617 ec.Errorf(ctx, "must not be null") 618 } 619 return graphql.Null 620 } 621 res := resTmp.(string) 622 fc.Result = res 623 return ec.marshalNString2string(ctx, field.Selections, res) 624 } 625 626 func (ec *executionContext) fieldContext_Todo_text(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 627 fc = &graphql.FieldContext{ 628 Object: "Todo", 629 Field: field, 630 IsMethod: false, 631 IsResolver: false, 632 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 633 return nil, errors.New("field of type String does not have child fields") 634 }, 635 } 636 return fc, nil 637 } 638 639 func (ec *executionContext) _Todo_done(ctx context.Context, field graphql.CollectedField, obj *model.Todo) (ret graphql.Marshaler) { 640 fc, err := ec.fieldContext_Todo_done(ctx, field) 641 if err != nil { 642 return graphql.Null 643 } 644 ctx = graphql.WithFieldContext(ctx, fc) 645 defer func() { 646 if r := recover(); r != nil { 647 ec.Error(ctx, ec.Recover(ctx, r)) 648 ret = graphql.Null 649 } 650 }() 651 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 652 ctx = rctx // use context from middleware stack in children 653 return obj.Done, nil 654 }) 655 if err != nil { 656 ec.Error(ctx, err) 657 return graphql.Null 658 } 659 if resTmp == nil { 660 if !graphql.HasFieldError(ctx, fc) { 661 ec.Errorf(ctx, "must not be null") 662 } 663 return graphql.Null 664 } 665 res := resTmp.(bool) 666 fc.Result = res 667 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 668 } 669 670 func (ec *executionContext) fieldContext_Todo_done(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 671 fc = &graphql.FieldContext{ 672 Object: "Todo", 673 Field: field, 674 IsMethod: false, 675 IsResolver: false, 676 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 677 return nil, errors.New("field of type Boolean does not have child fields") 678 }, 679 } 680 return fc, nil 681 } 682 683 func (ec *executionContext) _Todo_user(ctx context.Context, field graphql.CollectedField, obj *model.Todo) (ret graphql.Marshaler) { 684 fc, err := ec.fieldContext_Todo_user(ctx, field) 685 if err != nil { 686 return graphql.Null 687 } 688 ctx = graphql.WithFieldContext(ctx, fc) 689 defer func() { 690 if r := recover(); r != nil { 691 ec.Error(ctx, ec.Recover(ctx, r)) 692 ret = graphql.Null 693 } 694 }() 695 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 696 ctx = rctx // use context from middleware stack in children 697 return obj.User, nil 698 }) 699 if err != nil { 700 ec.Error(ctx, err) 701 return graphql.Null 702 } 703 if resTmp == nil { 704 if !graphql.HasFieldError(ctx, fc) { 705 ec.Errorf(ctx, "must not be null") 706 } 707 return graphql.Null 708 } 709 res := resTmp.(*model.User) 710 fc.Result = res 711 return ec.marshalNUser2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) 712 } 713 714 func (ec *executionContext) fieldContext_Todo_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 715 fc = &graphql.FieldContext{ 716 Object: "Todo", 717 Field: field, 718 IsMethod: false, 719 IsResolver: false, 720 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 721 switch field.Name { 722 case "id": 723 return ec.fieldContext_User_id(ctx, field) 724 case "name": 725 return ec.fieldContext_User_name(ctx, field) 726 } 727 return nil, fmt.Errorf("no field named %q was found under type User", field.Name) 728 }, 729 } 730 return fc, nil 731 } 732 733 func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { 734 fc, err := ec.fieldContext_User_id(ctx, field) 735 if err != nil { 736 return graphql.Null 737 } 738 ctx = graphql.WithFieldContext(ctx, fc) 739 defer func() { 740 if r := recover(); r != nil { 741 ec.Error(ctx, ec.Recover(ctx, r)) 742 ret = graphql.Null 743 } 744 }() 745 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 746 ctx = rctx // use context from middleware stack in children 747 return obj.ID, nil 748 }) 749 if err != nil { 750 ec.Error(ctx, err) 751 return graphql.Null 752 } 753 if resTmp == nil { 754 if !graphql.HasFieldError(ctx, fc) { 755 ec.Errorf(ctx, "must not be null") 756 } 757 return graphql.Null 758 } 759 res := resTmp.(string) 760 fc.Result = res 761 return ec.marshalNID2string(ctx, field.Selections, res) 762 } 763 764 func (ec *executionContext) fieldContext_User_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 765 fc = &graphql.FieldContext{ 766 Object: "User", 767 Field: field, 768 IsMethod: false, 769 IsResolver: false, 770 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 771 return nil, errors.New("field of type ID does not have child fields") 772 }, 773 } 774 return fc, nil 775 } 776 777 func (ec *executionContext) _User_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { 778 fc, err := ec.fieldContext_User_name(ctx, field) 779 if err != nil { 780 return graphql.Null 781 } 782 ctx = graphql.WithFieldContext(ctx, fc) 783 defer func() { 784 if r := recover(); r != nil { 785 ec.Error(ctx, ec.Recover(ctx, r)) 786 ret = graphql.Null 787 } 788 }() 789 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 790 ctx = rctx // use context from middleware stack in children 791 return obj.Name, nil 792 }) 793 if err != nil { 794 ec.Error(ctx, err) 795 return graphql.Null 796 } 797 if resTmp == nil { 798 if !graphql.HasFieldError(ctx, fc) { 799 ec.Errorf(ctx, "must not be null") 800 } 801 return graphql.Null 802 } 803 res := resTmp.(string) 804 fc.Result = res 805 return ec.marshalNString2string(ctx, field.Selections, res) 806 } 807 808 func (ec *executionContext) fieldContext_User_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 809 fc = &graphql.FieldContext{ 810 Object: "User", 811 Field: field, 812 IsMethod: false, 813 IsResolver: false, 814 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 815 return nil, errors.New("field of type String does not have child fields") 816 }, 817 } 818 return fc, nil 819 } 820 821 func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 822 fc, err := ec.fieldContext___Directive_name(ctx, field) 823 if err != nil { 824 return graphql.Null 825 } 826 ctx = graphql.WithFieldContext(ctx, fc) 827 defer func() { 828 if r := recover(); r != nil { 829 ec.Error(ctx, ec.Recover(ctx, r)) 830 ret = graphql.Null 831 } 832 }() 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.Name, 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.(string) 848 fc.Result = res 849 return ec.marshalNString2string(ctx, field.Selections, res) 850 } 851 852 func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 853 fc = &graphql.FieldContext{ 854 Object: "__Directive", 855 Field: field, 856 IsMethod: false, 857 IsResolver: false, 858 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 859 return nil, errors.New("field of type String does not have child fields") 860 }, 861 } 862 return fc, nil 863 } 864 865 func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 866 fc, err := ec.fieldContext___Directive_description(ctx, field) 867 if err != nil { 868 return graphql.Null 869 } 870 ctx = graphql.WithFieldContext(ctx, fc) 871 defer func() { 872 if r := recover(); r != nil { 873 ec.Error(ctx, ec.Recover(ctx, r)) 874 ret = graphql.Null 875 } 876 }() 877 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 878 ctx = rctx // use context from middleware stack in children 879 return obj.Description(), nil 880 }) 881 if err != nil { 882 ec.Error(ctx, err) 883 return graphql.Null 884 } 885 if resTmp == nil { 886 return graphql.Null 887 } 888 res := resTmp.(*string) 889 fc.Result = res 890 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 891 } 892 893 func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 894 fc = &graphql.FieldContext{ 895 Object: "__Directive", 896 Field: field, 897 IsMethod: true, 898 IsResolver: false, 899 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 900 return nil, errors.New("field of type String does not have child fields") 901 }, 902 } 903 return fc, nil 904 } 905 906 func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 907 fc, err := ec.fieldContext___Directive_locations(ctx, field) 908 if err != nil { 909 return graphql.Null 910 } 911 ctx = graphql.WithFieldContext(ctx, fc) 912 defer func() { 913 if r := recover(); r != nil { 914 ec.Error(ctx, ec.Recover(ctx, r)) 915 ret = graphql.Null 916 } 917 }() 918 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 919 ctx = rctx // use context from middleware stack in children 920 return obj.Locations, nil 921 }) 922 if err != nil { 923 ec.Error(ctx, err) 924 return graphql.Null 925 } 926 if resTmp == nil { 927 if !graphql.HasFieldError(ctx, fc) { 928 ec.Errorf(ctx, "must not be null") 929 } 930 return graphql.Null 931 } 932 res := resTmp.([]string) 933 fc.Result = res 934 return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) 935 } 936 937 func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 938 fc = &graphql.FieldContext{ 939 Object: "__Directive", 940 Field: field, 941 IsMethod: false, 942 IsResolver: false, 943 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 944 return nil, errors.New("field of type __DirectiveLocation does not have child fields") 945 }, 946 } 947 return fc, nil 948 } 949 950 func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 951 fc, err := ec.fieldContext___Directive_args(ctx, field) 952 if err != nil { 953 return graphql.Null 954 } 955 ctx = graphql.WithFieldContext(ctx, fc) 956 defer func() { 957 if r := recover(); r != nil { 958 ec.Error(ctx, ec.Recover(ctx, r)) 959 ret = graphql.Null 960 } 961 }() 962 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 963 ctx = rctx // use context from middleware stack in children 964 return obj.Args, nil 965 }) 966 if err != nil { 967 ec.Error(ctx, err) 968 return graphql.Null 969 } 970 if resTmp == nil { 971 if !graphql.HasFieldError(ctx, fc) { 972 ec.Errorf(ctx, "must not be null") 973 } 974 return graphql.Null 975 } 976 res := resTmp.([]introspection.InputValue) 977 fc.Result = res 978 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 979 } 980 981 func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 982 fc = &graphql.FieldContext{ 983 Object: "__Directive", 984 Field: field, 985 IsMethod: false, 986 IsResolver: false, 987 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 988 switch field.Name { 989 case "name": 990 return ec.fieldContext___InputValue_name(ctx, field) 991 case "description": 992 return ec.fieldContext___InputValue_description(ctx, field) 993 case "type": 994 return ec.fieldContext___InputValue_type(ctx, field) 995 case "defaultValue": 996 return ec.fieldContext___InputValue_defaultValue(ctx, field) 997 } 998 return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) 999 }, 1000 } 1001 return fc, nil 1002 } 1003 1004 func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { 1005 fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) 1006 if err != nil { 1007 return graphql.Null 1008 } 1009 ctx = graphql.WithFieldContext(ctx, fc) 1010 defer func() { 1011 if r := recover(); r != nil { 1012 ec.Error(ctx, ec.Recover(ctx, r)) 1013 ret = graphql.Null 1014 } 1015 }() 1016 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1017 ctx = rctx // use context from middleware stack in children 1018 return obj.IsRepeatable, nil 1019 }) 1020 if err != nil { 1021 ec.Error(ctx, err) 1022 return graphql.Null 1023 } 1024 if resTmp == nil { 1025 if !graphql.HasFieldError(ctx, fc) { 1026 ec.Errorf(ctx, "must not be null") 1027 } 1028 return graphql.Null 1029 } 1030 res := resTmp.(bool) 1031 fc.Result = res 1032 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 1033 } 1034 1035 func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1036 fc = &graphql.FieldContext{ 1037 Object: "__Directive", 1038 Field: field, 1039 IsMethod: false, 1040 IsResolver: false, 1041 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1042 return nil, errors.New("field of type Boolean does not have child fields") 1043 }, 1044 } 1045 return fc, nil 1046 } 1047 1048 func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1049 fc, err := ec.fieldContext___EnumValue_name(ctx, field) 1050 if err != nil { 1051 return graphql.Null 1052 } 1053 ctx = graphql.WithFieldContext(ctx, fc) 1054 defer func() { 1055 if r := recover(); r != nil { 1056 ec.Error(ctx, ec.Recover(ctx, r)) 1057 ret = graphql.Null 1058 } 1059 }() 1060 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1061 ctx = rctx // use context from middleware stack in children 1062 return obj.Name, nil 1063 }) 1064 if err != nil { 1065 ec.Error(ctx, err) 1066 return graphql.Null 1067 } 1068 if resTmp == nil { 1069 if !graphql.HasFieldError(ctx, fc) { 1070 ec.Errorf(ctx, "must not be null") 1071 } 1072 return graphql.Null 1073 } 1074 res := resTmp.(string) 1075 fc.Result = res 1076 return ec.marshalNString2string(ctx, field.Selections, res) 1077 } 1078 1079 func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1080 fc = &graphql.FieldContext{ 1081 Object: "__EnumValue", 1082 Field: field, 1083 IsMethod: false, 1084 IsResolver: false, 1085 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1086 return nil, errors.New("field of type String does not have child fields") 1087 }, 1088 } 1089 return fc, nil 1090 } 1091 1092 func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1093 fc, err := ec.fieldContext___EnumValue_description(ctx, field) 1094 if err != nil { 1095 return graphql.Null 1096 } 1097 ctx = graphql.WithFieldContext(ctx, fc) 1098 defer func() { 1099 if r := recover(); r != nil { 1100 ec.Error(ctx, ec.Recover(ctx, r)) 1101 ret = graphql.Null 1102 } 1103 }() 1104 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1105 ctx = rctx // use context from middleware stack in children 1106 return obj.Description(), nil 1107 }) 1108 if err != nil { 1109 ec.Error(ctx, err) 1110 return graphql.Null 1111 } 1112 if resTmp == nil { 1113 return graphql.Null 1114 } 1115 res := resTmp.(*string) 1116 fc.Result = res 1117 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1118 } 1119 1120 func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1121 fc = &graphql.FieldContext{ 1122 Object: "__EnumValue", 1123 Field: field, 1124 IsMethod: true, 1125 IsResolver: false, 1126 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1127 return nil, errors.New("field of type String does not have child fields") 1128 }, 1129 } 1130 return fc, nil 1131 } 1132 1133 func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1134 fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) 1135 if err != nil { 1136 return graphql.Null 1137 } 1138 ctx = graphql.WithFieldContext(ctx, fc) 1139 defer func() { 1140 if r := recover(); r != nil { 1141 ec.Error(ctx, ec.Recover(ctx, r)) 1142 ret = graphql.Null 1143 } 1144 }() 1145 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1146 ctx = rctx // use context from middleware stack in children 1147 return obj.IsDeprecated(), nil 1148 }) 1149 if err != nil { 1150 ec.Error(ctx, err) 1151 return graphql.Null 1152 } 1153 if resTmp == nil { 1154 if !graphql.HasFieldError(ctx, fc) { 1155 ec.Errorf(ctx, "must not be null") 1156 } 1157 return graphql.Null 1158 } 1159 res := resTmp.(bool) 1160 fc.Result = res 1161 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 1162 } 1163 1164 func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1165 fc = &graphql.FieldContext{ 1166 Object: "__EnumValue", 1167 Field: field, 1168 IsMethod: true, 1169 IsResolver: false, 1170 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1171 return nil, errors.New("field of type Boolean does not have child fields") 1172 }, 1173 } 1174 return fc, nil 1175 } 1176 1177 func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { 1178 fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) 1179 if err != nil { 1180 return graphql.Null 1181 } 1182 ctx = graphql.WithFieldContext(ctx, fc) 1183 defer func() { 1184 if r := recover(); r != nil { 1185 ec.Error(ctx, ec.Recover(ctx, r)) 1186 ret = graphql.Null 1187 } 1188 }() 1189 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1190 ctx = rctx // use context from middleware stack in children 1191 return obj.DeprecationReason(), nil 1192 }) 1193 if err != nil { 1194 ec.Error(ctx, err) 1195 return graphql.Null 1196 } 1197 if resTmp == nil { 1198 return graphql.Null 1199 } 1200 res := resTmp.(*string) 1201 fc.Result = res 1202 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1203 } 1204 1205 func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1206 fc = &graphql.FieldContext{ 1207 Object: "__EnumValue", 1208 Field: field, 1209 IsMethod: true, 1210 IsResolver: false, 1211 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1212 return nil, errors.New("field of type String does not have child fields") 1213 }, 1214 } 1215 return fc, nil 1216 } 1217 1218 func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1219 fc, err := ec.fieldContext___Field_name(ctx, field) 1220 if err != nil { 1221 return graphql.Null 1222 } 1223 ctx = graphql.WithFieldContext(ctx, fc) 1224 defer func() { 1225 if r := recover(); r != nil { 1226 ec.Error(ctx, ec.Recover(ctx, r)) 1227 ret = graphql.Null 1228 } 1229 }() 1230 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1231 ctx = rctx // use context from middleware stack in children 1232 return obj.Name, nil 1233 }) 1234 if err != nil { 1235 ec.Error(ctx, err) 1236 return graphql.Null 1237 } 1238 if resTmp == nil { 1239 if !graphql.HasFieldError(ctx, fc) { 1240 ec.Errorf(ctx, "must not be null") 1241 } 1242 return graphql.Null 1243 } 1244 res := resTmp.(string) 1245 fc.Result = res 1246 return ec.marshalNString2string(ctx, field.Selections, res) 1247 } 1248 1249 func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1250 fc = &graphql.FieldContext{ 1251 Object: "__Field", 1252 Field: field, 1253 IsMethod: false, 1254 IsResolver: false, 1255 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1256 return nil, errors.New("field of type String does not have child fields") 1257 }, 1258 } 1259 return fc, nil 1260 } 1261 1262 func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1263 fc, err := ec.fieldContext___Field_description(ctx, field) 1264 if err != nil { 1265 return graphql.Null 1266 } 1267 ctx = graphql.WithFieldContext(ctx, fc) 1268 defer func() { 1269 if r := recover(); r != nil { 1270 ec.Error(ctx, ec.Recover(ctx, r)) 1271 ret = graphql.Null 1272 } 1273 }() 1274 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1275 ctx = rctx // use context from middleware stack in children 1276 return obj.Description(), nil 1277 }) 1278 if err != nil { 1279 ec.Error(ctx, err) 1280 return graphql.Null 1281 } 1282 if resTmp == nil { 1283 return graphql.Null 1284 } 1285 res := resTmp.(*string) 1286 fc.Result = res 1287 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1288 } 1289 1290 func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1291 fc = &graphql.FieldContext{ 1292 Object: "__Field", 1293 Field: field, 1294 IsMethod: true, 1295 IsResolver: false, 1296 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1297 return nil, errors.New("field of type String does not have child fields") 1298 }, 1299 } 1300 return fc, nil 1301 } 1302 1303 func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1304 fc, err := ec.fieldContext___Field_args(ctx, field) 1305 if err != nil { 1306 return graphql.Null 1307 } 1308 ctx = graphql.WithFieldContext(ctx, fc) 1309 defer func() { 1310 if r := recover(); r != nil { 1311 ec.Error(ctx, ec.Recover(ctx, r)) 1312 ret = graphql.Null 1313 } 1314 }() 1315 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1316 ctx = rctx // use context from middleware stack in children 1317 return obj.Args, nil 1318 }) 1319 if err != nil { 1320 ec.Error(ctx, err) 1321 return graphql.Null 1322 } 1323 if resTmp == nil { 1324 if !graphql.HasFieldError(ctx, fc) { 1325 ec.Errorf(ctx, "must not be null") 1326 } 1327 return graphql.Null 1328 } 1329 res := resTmp.([]introspection.InputValue) 1330 fc.Result = res 1331 return ec.marshalN__InputValue2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 1332 } 1333 1334 func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1335 fc = &graphql.FieldContext{ 1336 Object: "__Field", 1337 Field: field, 1338 IsMethod: false, 1339 IsResolver: false, 1340 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1341 switch field.Name { 1342 case "name": 1343 return ec.fieldContext___InputValue_name(ctx, field) 1344 case "description": 1345 return ec.fieldContext___InputValue_description(ctx, field) 1346 case "type": 1347 return ec.fieldContext___InputValue_type(ctx, field) 1348 case "defaultValue": 1349 return ec.fieldContext___InputValue_defaultValue(ctx, field) 1350 } 1351 return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) 1352 }, 1353 } 1354 return fc, nil 1355 } 1356 1357 func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1358 fc, err := ec.fieldContext___Field_type(ctx, field) 1359 if err != nil { 1360 return graphql.Null 1361 } 1362 ctx = graphql.WithFieldContext(ctx, fc) 1363 defer func() { 1364 if r := recover(); r != nil { 1365 ec.Error(ctx, ec.Recover(ctx, r)) 1366 ret = graphql.Null 1367 } 1368 }() 1369 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1370 ctx = rctx // use context from middleware stack in children 1371 return obj.Type, nil 1372 }) 1373 if err != nil { 1374 ec.Error(ctx, err) 1375 return graphql.Null 1376 } 1377 if resTmp == nil { 1378 if !graphql.HasFieldError(ctx, fc) { 1379 ec.Errorf(ctx, "must not be null") 1380 } 1381 return graphql.Null 1382 } 1383 res := resTmp.(*introspection.Type) 1384 fc.Result = res 1385 return ec.marshalN__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1386 } 1387 1388 func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1389 fc = &graphql.FieldContext{ 1390 Object: "__Field", 1391 Field: field, 1392 IsMethod: false, 1393 IsResolver: false, 1394 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1395 switch field.Name { 1396 case "kind": 1397 return ec.fieldContext___Type_kind(ctx, field) 1398 case "name": 1399 return ec.fieldContext___Type_name(ctx, field) 1400 case "description": 1401 return ec.fieldContext___Type_description(ctx, field) 1402 case "fields": 1403 return ec.fieldContext___Type_fields(ctx, field) 1404 case "interfaces": 1405 return ec.fieldContext___Type_interfaces(ctx, field) 1406 case "possibleTypes": 1407 return ec.fieldContext___Type_possibleTypes(ctx, field) 1408 case "enumValues": 1409 return ec.fieldContext___Type_enumValues(ctx, field) 1410 case "inputFields": 1411 return ec.fieldContext___Type_inputFields(ctx, field) 1412 case "ofType": 1413 return ec.fieldContext___Type_ofType(ctx, field) 1414 case "specifiedByURL": 1415 return ec.fieldContext___Type_specifiedByURL(ctx, field) 1416 } 1417 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 1418 }, 1419 } 1420 return fc, nil 1421 } 1422 1423 func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1424 fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) 1425 if err != nil { 1426 return graphql.Null 1427 } 1428 ctx = graphql.WithFieldContext(ctx, fc) 1429 defer func() { 1430 if r := recover(); r != nil { 1431 ec.Error(ctx, ec.Recover(ctx, r)) 1432 ret = graphql.Null 1433 } 1434 }() 1435 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1436 ctx = rctx // use context from middleware stack in children 1437 return obj.IsDeprecated(), nil 1438 }) 1439 if err != nil { 1440 ec.Error(ctx, err) 1441 return graphql.Null 1442 } 1443 if resTmp == nil { 1444 if !graphql.HasFieldError(ctx, fc) { 1445 ec.Errorf(ctx, "must not be null") 1446 } 1447 return graphql.Null 1448 } 1449 res := resTmp.(bool) 1450 fc.Result = res 1451 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 1452 } 1453 1454 func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1455 fc = &graphql.FieldContext{ 1456 Object: "__Field", 1457 Field: field, 1458 IsMethod: true, 1459 IsResolver: false, 1460 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1461 return nil, errors.New("field of type Boolean does not have child fields") 1462 }, 1463 } 1464 return fc, nil 1465 } 1466 1467 func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { 1468 fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) 1469 if err != nil { 1470 return graphql.Null 1471 } 1472 ctx = graphql.WithFieldContext(ctx, fc) 1473 defer func() { 1474 if r := recover(); r != nil { 1475 ec.Error(ctx, ec.Recover(ctx, r)) 1476 ret = graphql.Null 1477 } 1478 }() 1479 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1480 ctx = rctx // use context from middleware stack in children 1481 return obj.DeprecationReason(), nil 1482 }) 1483 if err != nil { 1484 ec.Error(ctx, err) 1485 return graphql.Null 1486 } 1487 if resTmp == nil { 1488 return graphql.Null 1489 } 1490 res := resTmp.(*string) 1491 fc.Result = res 1492 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1493 } 1494 1495 func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1496 fc = &graphql.FieldContext{ 1497 Object: "__Field", 1498 Field: field, 1499 IsMethod: true, 1500 IsResolver: false, 1501 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1502 return nil, errors.New("field of type String does not have child fields") 1503 }, 1504 } 1505 return fc, nil 1506 } 1507 1508 func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1509 fc, err := ec.fieldContext___InputValue_name(ctx, field) 1510 if err != nil { 1511 return graphql.Null 1512 } 1513 ctx = graphql.WithFieldContext(ctx, fc) 1514 defer func() { 1515 if r := recover(); r != nil { 1516 ec.Error(ctx, ec.Recover(ctx, r)) 1517 ret = graphql.Null 1518 } 1519 }() 1520 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1521 ctx = rctx // use context from middleware stack in children 1522 return obj.Name, nil 1523 }) 1524 if err != nil { 1525 ec.Error(ctx, err) 1526 return graphql.Null 1527 } 1528 if resTmp == nil { 1529 if !graphql.HasFieldError(ctx, fc) { 1530 ec.Errorf(ctx, "must not be null") 1531 } 1532 return graphql.Null 1533 } 1534 res := resTmp.(string) 1535 fc.Result = res 1536 return ec.marshalNString2string(ctx, field.Selections, res) 1537 } 1538 1539 func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1540 fc = &graphql.FieldContext{ 1541 Object: "__InputValue", 1542 Field: field, 1543 IsMethod: false, 1544 IsResolver: false, 1545 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1546 return nil, errors.New("field of type String does not have child fields") 1547 }, 1548 } 1549 return fc, nil 1550 } 1551 1552 func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1553 fc, err := ec.fieldContext___InputValue_description(ctx, field) 1554 if err != nil { 1555 return graphql.Null 1556 } 1557 ctx = graphql.WithFieldContext(ctx, fc) 1558 defer func() { 1559 if r := recover(); r != nil { 1560 ec.Error(ctx, ec.Recover(ctx, r)) 1561 ret = graphql.Null 1562 } 1563 }() 1564 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1565 ctx = rctx // use context from middleware stack in children 1566 return obj.Description(), nil 1567 }) 1568 if err != nil { 1569 ec.Error(ctx, err) 1570 return graphql.Null 1571 } 1572 if resTmp == nil { 1573 return graphql.Null 1574 } 1575 res := resTmp.(*string) 1576 fc.Result = res 1577 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1578 } 1579 1580 func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1581 fc = &graphql.FieldContext{ 1582 Object: "__InputValue", 1583 Field: field, 1584 IsMethod: true, 1585 IsResolver: false, 1586 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1587 return nil, errors.New("field of type String does not have child fields") 1588 }, 1589 } 1590 return fc, nil 1591 } 1592 1593 func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1594 fc, err := ec.fieldContext___InputValue_type(ctx, field) 1595 if err != nil { 1596 return graphql.Null 1597 } 1598 ctx = graphql.WithFieldContext(ctx, fc) 1599 defer func() { 1600 if r := recover(); r != nil { 1601 ec.Error(ctx, ec.Recover(ctx, r)) 1602 ret = graphql.Null 1603 } 1604 }() 1605 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1606 ctx = rctx // use context from middleware stack in children 1607 return obj.Type, nil 1608 }) 1609 if err != nil { 1610 ec.Error(ctx, err) 1611 return graphql.Null 1612 } 1613 if resTmp == nil { 1614 if !graphql.HasFieldError(ctx, fc) { 1615 ec.Errorf(ctx, "must not be null") 1616 } 1617 return graphql.Null 1618 } 1619 res := resTmp.(*introspection.Type) 1620 fc.Result = res 1621 return ec.marshalN__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1622 } 1623 1624 func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1625 fc = &graphql.FieldContext{ 1626 Object: "__InputValue", 1627 Field: field, 1628 IsMethod: false, 1629 IsResolver: false, 1630 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1631 switch field.Name { 1632 case "kind": 1633 return ec.fieldContext___Type_kind(ctx, field) 1634 case "name": 1635 return ec.fieldContext___Type_name(ctx, field) 1636 case "description": 1637 return ec.fieldContext___Type_description(ctx, field) 1638 case "fields": 1639 return ec.fieldContext___Type_fields(ctx, field) 1640 case "interfaces": 1641 return ec.fieldContext___Type_interfaces(ctx, field) 1642 case "possibleTypes": 1643 return ec.fieldContext___Type_possibleTypes(ctx, field) 1644 case "enumValues": 1645 return ec.fieldContext___Type_enumValues(ctx, field) 1646 case "inputFields": 1647 return ec.fieldContext___Type_inputFields(ctx, field) 1648 case "ofType": 1649 return ec.fieldContext___Type_ofType(ctx, field) 1650 case "specifiedByURL": 1651 return ec.fieldContext___Type_specifiedByURL(ctx, field) 1652 } 1653 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 1654 }, 1655 } 1656 return fc, nil 1657 } 1658 1659 func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { 1660 fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) 1661 if err != nil { 1662 return graphql.Null 1663 } 1664 ctx = graphql.WithFieldContext(ctx, fc) 1665 defer func() { 1666 if r := recover(); r != nil { 1667 ec.Error(ctx, ec.Recover(ctx, r)) 1668 ret = graphql.Null 1669 } 1670 }() 1671 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1672 ctx = rctx // use context from middleware stack in children 1673 return obj.DefaultValue, nil 1674 }) 1675 if err != nil { 1676 ec.Error(ctx, err) 1677 return graphql.Null 1678 } 1679 if resTmp == nil { 1680 return graphql.Null 1681 } 1682 res := resTmp.(*string) 1683 fc.Result = res 1684 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1685 } 1686 1687 func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1688 fc = &graphql.FieldContext{ 1689 Object: "__InputValue", 1690 Field: field, 1691 IsMethod: false, 1692 IsResolver: false, 1693 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1694 return nil, errors.New("field of type String does not have child fields") 1695 }, 1696 } 1697 return fc, nil 1698 } 1699 1700 func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1701 fc, err := ec.fieldContext___Schema_description(ctx, field) 1702 if err != nil { 1703 return graphql.Null 1704 } 1705 ctx = graphql.WithFieldContext(ctx, fc) 1706 defer func() { 1707 if r := recover(); r != nil { 1708 ec.Error(ctx, ec.Recover(ctx, r)) 1709 ret = graphql.Null 1710 } 1711 }() 1712 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1713 ctx = rctx // use context from middleware stack in children 1714 return obj.Description(), nil 1715 }) 1716 if err != nil { 1717 ec.Error(ctx, err) 1718 return graphql.Null 1719 } 1720 if resTmp == nil { 1721 return graphql.Null 1722 } 1723 res := resTmp.(*string) 1724 fc.Result = res 1725 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 1726 } 1727 1728 func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1729 fc = &graphql.FieldContext{ 1730 Object: "__Schema", 1731 Field: field, 1732 IsMethod: true, 1733 IsResolver: false, 1734 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1735 return nil, errors.New("field of type String does not have child fields") 1736 }, 1737 } 1738 return fc, nil 1739 } 1740 1741 func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1742 fc, err := ec.fieldContext___Schema_types(ctx, field) 1743 if err != nil { 1744 return graphql.Null 1745 } 1746 ctx = graphql.WithFieldContext(ctx, fc) 1747 defer func() { 1748 if r := recover(); r != nil { 1749 ec.Error(ctx, ec.Recover(ctx, r)) 1750 ret = graphql.Null 1751 } 1752 }() 1753 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1754 ctx = rctx // use context from middleware stack in children 1755 return obj.Types(), nil 1756 }) 1757 if err != nil { 1758 ec.Error(ctx, err) 1759 return graphql.Null 1760 } 1761 if resTmp == nil { 1762 if !graphql.HasFieldError(ctx, fc) { 1763 ec.Errorf(ctx, "must not be null") 1764 } 1765 return graphql.Null 1766 } 1767 res := resTmp.([]introspection.Type) 1768 fc.Result = res 1769 return ec.marshalN__Type2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 1770 } 1771 1772 func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1773 fc = &graphql.FieldContext{ 1774 Object: "__Schema", 1775 Field: field, 1776 IsMethod: true, 1777 IsResolver: false, 1778 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1779 switch field.Name { 1780 case "kind": 1781 return ec.fieldContext___Type_kind(ctx, field) 1782 case "name": 1783 return ec.fieldContext___Type_name(ctx, field) 1784 case "description": 1785 return ec.fieldContext___Type_description(ctx, field) 1786 case "fields": 1787 return ec.fieldContext___Type_fields(ctx, field) 1788 case "interfaces": 1789 return ec.fieldContext___Type_interfaces(ctx, field) 1790 case "possibleTypes": 1791 return ec.fieldContext___Type_possibleTypes(ctx, field) 1792 case "enumValues": 1793 return ec.fieldContext___Type_enumValues(ctx, field) 1794 case "inputFields": 1795 return ec.fieldContext___Type_inputFields(ctx, field) 1796 case "ofType": 1797 return ec.fieldContext___Type_ofType(ctx, field) 1798 case "specifiedByURL": 1799 return ec.fieldContext___Type_specifiedByURL(ctx, field) 1800 } 1801 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 1802 }, 1803 } 1804 return fc, nil 1805 } 1806 1807 func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1808 fc, err := ec.fieldContext___Schema_queryType(ctx, field) 1809 if err != nil { 1810 return graphql.Null 1811 } 1812 ctx = graphql.WithFieldContext(ctx, fc) 1813 defer func() { 1814 if r := recover(); r != nil { 1815 ec.Error(ctx, ec.Recover(ctx, r)) 1816 ret = graphql.Null 1817 } 1818 }() 1819 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1820 ctx = rctx // use context from middleware stack in children 1821 return obj.QueryType(), nil 1822 }) 1823 if err != nil { 1824 ec.Error(ctx, err) 1825 return graphql.Null 1826 } 1827 if resTmp == nil { 1828 if !graphql.HasFieldError(ctx, fc) { 1829 ec.Errorf(ctx, "must not be null") 1830 } 1831 return graphql.Null 1832 } 1833 res := resTmp.(*introspection.Type) 1834 fc.Result = res 1835 return ec.marshalN__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1836 } 1837 1838 func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1839 fc = &graphql.FieldContext{ 1840 Object: "__Schema", 1841 Field: field, 1842 IsMethod: true, 1843 IsResolver: false, 1844 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1845 switch field.Name { 1846 case "kind": 1847 return ec.fieldContext___Type_kind(ctx, field) 1848 case "name": 1849 return ec.fieldContext___Type_name(ctx, field) 1850 case "description": 1851 return ec.fieldContext___Type_description(ctx, field) 1852 case "fields": 1853 return ec.fieldContext___Type_fields(ctx, field) 1854 case "interfaces": 1855 return ec.fieldContext___Type_interfaces(ctx, field) 1856 case "possibleTypes": 1857 return ec.fieldContext___Type_possibleTypes(ctx, field) 1858 case "enumValues": 1859 return ec.fieldContext___Type_enumValues(ctx, field) 1860 case "inputFields": 1861 return ec.fieldContext___Type_inputFields(ctx, field) 1862 case "ofType": 1863 return ec.fieldContext___Type_ofType(ctx, field) 1864 case "specifiedByURL": 1865 return ec.fieldContext___Type_specifiedByURL(ctx, field) 1866 } 1867 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 1868 }, 1869 } 1870 return fc, nil 1871 } 1872 1873 func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1874 fc, err := ec.fieldContext___Schema_mutationType(ctx, field) 1875 if err != nil { 1876 return graphql.Null 1877 } 1878 ctx = graphql.WithFieldContext(ctx, fc) 1879 defer func() { 1880 if r := recover(); r != nil { 1881 ec.Error(ctx, ec.Recover(ctx, r)) 1882 ret = graphql.Null 1883 } 1884 }() 1885 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1886 ctx = rctx // use context from middleware stack in children 1887 return obj.MutationType(), nil 1888 }) 1889 if err != nil { 1890 ec.Error(ctx, err) 1891 return graphql.Null 1892 } 1893 if resTmp == nil { 1894 return graphql.Null 1895 } 1896 res := resTmp.(*introspection.Type) 1897 fc.Result = res 1898 return ec.marshalO__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1899 } 1900 1901 func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1902 fc = &graphql.FieldContext{ 1903 Object: "__Schema", 1904 Field: field, 1905 IsMethod: true, 1906 IsResolver: false, 1907 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1908 switch field.Name { 1909 case "kind": 1910 return ec.fieldContext___Type_kind(ctx, field) 1911 case "name": 1912 return ec.fieldContext___Type_name(ctx, field) 1913 case "description": 1914 return ec.fieldContext___Type_description(ctx, field) 1915 case "fields": 1916 return ec.fieldContext___Type_fields(ctx, field) 1917 case "interfaces": 1918 return ec.fieldContext___Type_interfaces(ctx, field) 1919 case "possibleTypes": 1920 return ec.fieldContext___Type_possibleTypes(ctx, field) 1921 case "enumValues": 1922 return ec.fieldContext___Type_enumValues(ctx, field) 1923 case "inputFields": 1924 return ec.fieldContext___Type_inputFields(ctx, field) 1925 case "ofType": 1926 return ec.fieldContext___Type_ofType(ctx, field) 1927 case "specifiedByURL": 1928 return ec.fieldContext___Type_specifiedByURL(ctx, field) 1929 } 1930 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 1931 }, 1932 } 1933 return fc, nil 1934 } 1935 1936 func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 1937 fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) 1938 if err != nil { 1939 return graphql.Null 1940 } 1941 ctx = graphql.WithFieldContext(ctx, fc) 1942 defer func() { 1943 if r := recover(); r != nil { 1944 ec.Error(ctx, ec.Recover(ctx, r)) 1945 ret = graphql.Null 1946 } 1947 }() 1948 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 1949 ctx = rctx // use context from middleware stack in children 1950 return obj.SubscriptionType(), nil 1951 }) 1952 if err != nil { 1953 ec.Error(ctx, err) 1954 return graphql.Null 1955 } 1956 if resTmp == nil { 1957 return graphql.Null 1958 } 1959 res := resTmp.(*introspection.Type) 1960 fc.Result = res 1961 return ec.marshalO__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 1962 } 1963 1964 func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 1965 fc = &graphql.FieldContext{ 1966 Object: "__Schema", 1967 Field: field, 1968 IsMethod: true, 1969 IsResolver: false, 1970 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 1971 switch field.Name { 1972 case "kind": 1973 return ec.fieldContext___Type_kind(ctx, field) 1974 case "name": 1975 return ec.fieldContext___Type_name(ctx, field) 1976 case "description": 1977 return ec.fieldContext___Type_description(ctx, field) 1978 case "fields": 1979 return ec.fieldContext___Type_fields(ctx, field) 1980 case "interfaces": 1981 return ec.fieldContext___Type_interfaces(ctx, field) 1982 case "possibleTypes": 1983 return ec.fieldContext___Type_possibleTypes(ctx, field) 1984 case "enumValues": 1985 return ec.fieldContext___Type_enumValues(ctx, field) 1986 case "inputFields": 1987 return ec.fieldContext___Type_inputFields(ctx, field) 1988 case "ofType": 1989 return ec.fieldContext___Type_ofType(ctx, field) 1990 case "specifiedByURL": 1991 return ec.fieldContext___Type_specifiedByURL(ctx, field) 1992 } 1993 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 1994 }, 1995 } 1996 return fc, nil 1997 } 1998 1999 func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { 2000 fc, err := ec.fieldContext___Schema_directives(ctx, field) 2001 if err != nil { 2002 return graphql.Null 2003 } 2004 ctx = graphql.WithFieldContext(ctx, fc) 2005 defer func() { 2006 if r := recover(); r != nil { 2007 ec.Error(ctx, ec.Recover(ctx, r)) 2008 ret = graphql.Null 2009 } 2010 }() 2011 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2012 ctx = rctx // use context from middleware stack in children 2013 return obj.Directives(), nil 2014 }) 2015 if err != nil { 2016 ec.Error(ctx, err) 2017 return graphql.Null 2018 } 2019 if resTmp == nil { 2020 if !graphql.HasFieldError(ctx, fc) { 2021 ec.Errorf(ctx, "must not be null") 2022 } 2023 return graphql.Null 2024 } 2025 res := resTmp.([]introspection.Directive) 2026 fc.Result = res 2027 return ec.marshalN__Directive2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) 2028 } 2029 2030 func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2031 fc = &graphql.FieldContext{ 2032 Object: "__Schema", 2033 Field: field, 2034 IsMethod: true, 2035 IsResolver: false, 2036 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2037 switch field.Name { 2038 case "name": 2039 return ec.fieldContext___Directive_name(ctx, field) 2040 case "description": 2041 return ec.fieldContext___Directive_description(ctx, field) 2042 case "locations": 2043 return ec.fieldContext___Directive_locations(ctx, field) 2044 case "args": 2045 return ec.fieldContext___Directive_args(ctx, field) 2046 case "isRepeatable": 2047 return ec.fieldContext___Directive_isRepeatable(ctx, field) 2048 } 2049 return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) 2050 }, 2051 } 2052 return fc, nil 2053 } 2054 2055 func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2056 fc, err := ec.fieldContext___Type_kind(ctx, field) 2057 if err != nil { 2058 return graphql.Null 2059 } 2060 ctx = graphql.WithFieldContext(ctx, fc) 2061 defer func() { 2062 if r := recover(); r != nil { 2063 ec.Error(ctx, ec.Recover(ctx, r)) 2064 ret = graphql.Null 2065 } 2066 }() 2067 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2068 ctx = rctx // use context from middleware stack in children 2069 return obj.Kind(), nil 2070 }) 2071 if err != nil { 2072 ec.Error(ctx, err) 2073 return graphql.Null 2074 } 2075 if resTmp == nil { 2076 if !graphql.HasFieldError(ctx, fc) { 2077 ec.Errorf(ctx, "must not be null") 2078 } 2079 return graphql.Null 2080 } 2081 res := resTmp.(string) 2082 fc.Result = res 2083 return ec.marshalN__TypeKind2string(ctx, field.Selections, res) 2084 } 2085 2086 func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2087 fc = &graphql.FieldContext{ 2088 Object: "__Type", 2089 Field: field, 2090 IsMethod: true, 2091 IsResolver: false, 2092 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2093 return nil, errors.New("field of type __TypeKind does not have child fields") 2094 }, 2095 } 2096 return fc, nil 2097 } 2098 2099 func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2100 fc, err := ec.fieldContext___Type_name(ctx, field) 2101 if err != nil { 2102 return graphql.Null 2103 } 2104 ctx = graphql.WithFieldContext(ctx, fc) 2105 defer func() { 2106 if r := recover(); r != nil { 2107 ec.Error(ctx, ec.Recover(ctx, r)) 2108 ret = graphql.Null 2109 } 2110 }() 2111 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2112 ctx = rctx // use context from middleware stack in children 2113 return obj.Name(), nil 2114 }) 2115 if err != nil { 2116 ec.Error(ctx, err) 2117 return graphql.Null 2118 } 2119 if resTmp == nil { 2120 return graphql.Null 2121 } 2122 res := resTmp.(*string) 2123 fc.Result = res 2124 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2125 } 2126 2127 func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2128 fc = &graphql.FieldContext{ 2129 Object: "__Type", 2130 Field: field, 2131 IsMethod: true, 2132 IsResolver: false, 2133 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2134 return nil, errors.New("field of type String does not have child fields") 2135 }, 2136 } 2137 return fc, nil 2138 } 2139 2140 func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2141 fc, err := ec.fieldContext___Type_description(ctx, field) 2142 if err != nil { 2143 return graphql.Null 2144 } 2145 ctx = graphql.WithFieldContext(ctx, fc) 2146 defer func() { 2147 if r := recover(); r != nil { 2148 ec.Error(ctx, ec.Recover(ctx, r)) 2149 ret = graphql.Null 2150 } 2151 }() 2152 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2153 ctx = rctx // use context from middleware stack in children 2154 return obj.Description(), nil 2155 }) 2156 if err != nil { 2157 ec.Error(ctx, err) 2158 return graphql.Null 2159 } 2160 if resTmp == nil { 2161 return graphql.Null 2162 } 2163 res := resTmp.(*string) 2164 fc.Result = res 2165 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2166 } 2167 2168 func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2169 fc = &graphql.FieldContext{ 2170 Object: "__Type", 2171 Field: field, 2172 IsMethod: true, 2173 IsResolver: false, 2174 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2175 return nil, errors.New("field of type String does not have child fields") 2176 }, 2177 } 2178 return fc, nil 2179 } 2180 2181 func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2182 fc, err := ec.fieldContext___Type_fields(ctx, field) 2183 if err != nil { 2184 return graphql.Null 2185 } 2186 ctx = graphql.WithFieldContext(ctx, fc) 2187 defer func() { 2188 if r := recover(); r != nil { 2189 ec.Error(ctx, ec.Recover(ctx, r)) 2190 ret = graphql.Null 2191 } 2192 }() 2193 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2194 ctx = rctx // use context from middleware stack in children 2195 return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil 2196 }) 2197 if err != nil { 2198 ec.Error(ctx, err) 2199 return graphql.Null 2200 } 2201 if resTmp == nil { 2202 return graphql.Null 2203 } 2204 res := resTmp.([]introspection.Field) 2205 fc.Result = res 2206 return ec.marshalO__Field2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) 2207 } 2208 2209 func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2210 fc = &graphql.FieldContext{ 2211 Object: "__Type", 2212 Field: field, 2213 IsMethod: true, 2214 IsResolver: false, 2215 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2216 switch field.Name { 2217 case "name": 2218 return ec.fieldContext___Field_name(ctx, field) 2219 case "description": 2220 return ec.fieldContext___Field_description(ctx, field) 2221 case "args": 2222 return ec.fieldContext___Field_args(ctx, field) 2223 case "type": 2224 return ec.fieldContext___Field_type(ctx, field) 2225 case "isDeprecated": 2226 return ec.fieldContext___Field_isDeprecated(ctx, field) 2227 case "deprecationReason": 2228 return ec.fieldContext___Field_deprecationReason(ctx, field) 2229 } 2230 return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) 2231 }, 2232 } 2233 defer func() { 2234 if r := recover(); r != nil { 2235 err = ec.Recover(ctx, r) 2236 ec.Error(ctx, err) 2237 } 2238 }() 2239 ctx = graphql.WithFieldContext(ctx, fc) 2240 if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { 2241 ec.Error(ctx, err) 2242 return 2243 } 2244 return fc, nil 2245 } 2246 2247 func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2248 fc, err := ec.fieldContext___Type_interfaces(ctx, field) 2249 if err != nil { 2250 return graphql.Null 2251 } 2252 ctx = graphql.WithFieldContext(ctx, fc) 2253 defer func() { 2254 if r := recover(); r != nil { 2255 ec.Error(ctx, ec.Recover(ctx, r)) 2256 ret = graphql.Null 2257 } 2258 }() 2259 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2260 ctx = rctx // use context from middleware stack in children 2261 return obj.Interfaces(), nil 2262 }) 2263 if err != nil { 2264 ec.Error(ctx, err) 2265 return graphql.Null 2266 } 2267 if resTmp == nil { 2268 return graphql.Null 2269 } 2270 res := resTmp.([]introspection.Type) 2271 fc.Result = res 2272 return ec.marshalO__Type2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 2273 } 2274 2275 func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2276 fc = &graphql.FieldContext{ 2277 Object: "__Type", 2278 Field: field, 2279 IsMethod: true, 2280 IsResolver: false, 2281 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2282 switch field.Name { 2283 case "kind": 2284 return ec.fieldContext___Type_kind(ctx, field) 2285 case "name": 2286 return ec.fieldContext___Type_name(ctx, field) 2287 case "description": 2288 return ec.fieldContext___Type_description(ctx, field) 2289 case "fields": 2290 return ec.fieldContext___Type_fields(ctx, field) 2291 case "interfaces": 2292 return ec.fieldContext___Type_interfaces(ctx, field) 2293 case "possibleTypes": 2294 return ec.fieldContext___Type_possibleTypes(ctx, field) 2295 case "enumValues": 2296 return ec.fieldContext___Type_enumValues(ctx, field) 2297 case "inputFields": 2298 return ec.fieldContext___Type_inputFields(ctx, field) 2299 case "ofType": 2300 return ec.fieldContext___Type_ofType(ctx, field) 2301 case "specifiedByURL": 2302 return ec.fieldContext___Type_specifiedByURL(ctx, field) 2303 } 2304 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 2305 }, 2306 } 2307 return fc, nil 2308 } 2309 2310 func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2311 fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) 2312 if err != nil { 2313 return graphql.Null 2314 } 2315 ctx = graphql.WithFieldContext(ctx, fc) 2316 defer func() { 2317 if r := recover(); r != nil { 2318 ec.Error(ctx, ec.Recover(ctx, r)) 2319 ret = graphql.Null 2320 } 2321 }() 2322 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2323 ctx = rctx // use context from middleware stack in children 2324 return obj.PossibleTypes(), nil 2325 }) 2326 if err != nil { 2327 ec.Error(ctx, err) 2328 return graphql.Null 2329 } 2330 if resTmp == nil { 2331 return graphql.Null 2332 } 2333 res := resTmp.([]introspection.Type) 2334 fc.Result = res 2335 return ec.marshalO__Type2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) 2336 } 2337 2338 func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2339 fc = &graphql.FieldContext{ 2340 Object: "__Type", 2341 Field: field, 2342 IsMethod: true, 2343 IsResolver: false, 2344 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2345 switch field.Name { 2346 case "kind": 2347 return ec.fieldContext___Type_kind(ctx, field) 2348 case "name": 2349 return ec.fieldContext___Type_name(ctx, field) 2350 case "description": 2351 return ec.fieldContext___Type_description(ctx, field) 2352 case "fields": 2353 return ec.fieldContext___Type_fields(ctx, field) 2354 case "interfaces": 2355 return ec.fieldContext___Type_interfaces(ctx, field) 2356 case "possibleTypes": 2357 return ec.fieldContext___Type_possibleTypes(ctx, field) 2358 case "enumValues": 2359 return ec.fieldContext___Type_enumValues(ctx, field) 2360 case "inputFields": 2361 return ec.fieldContext___Type_inputFields(ctx, field) 2362 case "ofType": 2363 return ec.fieldContext___Type_ofType(ctx, field) 2364 case "specifiedByURL": 2365 return ec.fieldContext___Type_specifiedByURL(ctx, field) 2366 } 2367 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 2368 }, 2369 } 2370 return fc, nil 2371 } 2372 2373 func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2374 fc, err := ec.fieldContext___Type_enumValues(ctx, field) 2375 if err != nil { 2376 return graphql.Null 2377 } 2378 ctx = graphql.WithFieldContext(ctx, fc) 2379 defer func() { 2380 if r := recover(); r != nil { 2381 ec.Error(ctx, ec.Recover(ctx, r)) 2382 ret = graphql.Null 2383 } 2384 }() 2385 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2386 ctx = rctx // use context from middleware stack in children 2387 return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil 2388 }) 2389 if err != nil { 2390 ec.Error(ctx, err) 2391 return graphql.Null 2392 } 2393 if resTmp == nil { 2394 return graphql.Null 2395 } 2396 res := resTmp.([]introspection.EnumValue) 2397 fc.Result = res 2398 return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) 2399 } 2400 2401 func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2402 fc = &graphql.FieldContext{ 2403 Object: "__Type", 2404 Field: field, 2405 IsMethod: true, 2406 IsResolver: false, 2407 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2408 switch field.Name { 2409 case "name": 2410 return ec.fieldContext___EnumValue_name(ctx, field) 2411 case "description": 2412 return ec.fieldContext___EnumValue_description(ctx, field) 2413 case "isDeprecated": 2414 return ec.fieldContext___EnumValue_isDeprecated(ctx, field) 2415 case "deprecationReason": 2416 return ec.fieldContext___EnumValue_deprecationReason(ctx, field) 2417 } 2418 return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) 2419 }, 2420 } 2421 defer func() { 2422 if r := recover(); r != nil { 2423 err = ec.Recover(ctx, r) 2424 ec.Error(ctx, err) 2425 } 2426 }() 2427 ctx = graphql.WithFieldContext(ctx, fc) 2428 if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { 2429 ec.Error(ctx, err) 2430 return 2431 } 2432 return fc, nil 2433 } 2434 2435 func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2436 fc, err := ec.fieldContext___Type_inputFields(ctx, field) 2437 if err != nil { 2438 return graphql.Null 2439 } 2440 ctx = graphql.WithFieldContext(ctx, fc) 2441 defer func() { 2442 if r := recover(); r != nil { 2443 ec.Error(ctx, ec.Recover(ctx, r)) 2444 ret = graphql.Null 2445 } 2446 }() 2447 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2448 ctx = rctx // use context from middleware stack in children 2449 return obj.InputFields(), nil 2450 }) 2451 if err != nil { 2452 ec.Error(ctx, err) 2453 return graphql.Null 2454 } 2455 if resTmp == nil { 2456 return graphql.Null 2457 } 2458 res := resTmp.([]introspection.InputValue) 2459 fc.Result = res 2460 return ec.marshalO__InputValue2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) 2461 } 2462 2463 func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2464 fc = &graphql.FieldContext{ 2465 Object: "__Type", 2466 Field: field, 2467 IsMethod: true, 2468 IsResolver: false, 2469 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2470 switch field.Name { 2471 case "name": 2472 return ec.fieldContext___InputValue_name(ctx, field) 2473 case "description": 2474 return ec.fieldContext___InputValue_description(ctx, field) 2475 case "type": 2476 return ec.fieldContext___InputValue_type(ctx, field) 2477 case "defaultValue": 2478 return ec.fieldContext___InputValue_defaultValue(ctx, field) 2479 } 2480 return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) 2481 }, 2482 } 2483 return fc, nil 2484 } 2485 2486 func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2487 fc, err := ec.fieldContext___Type_ofType(ctx, field) 2488 if err != nil { 2489 return graphql.Null 2490 } 2491 ctx = graphql.WithFieldContext(ctx, fc) 2492 defer func() { 2493 if r := recover(); r != nil { 2494 ec.Error(ctx, ec.Recover(ctx, r)) 2495 ret = graphql.Null 2496 } 2497 }() 2498 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2499 ctx = rctx // use context from middleware stack in children 2500 return obj.OfType(), nil 2501 }) 2502 if err != nil { 2503 ec.Error(ctx, err) 2504 return graphql.Null 2505 } 2506 if resTmp == nil { 2507 return graphql.Null 2508 } 2509 res := resTmp.(*introspection.Type) 2510 fc.Result = res 2511 return ec.marshalO__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) 2512 } 2513 2514 func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2515 fc = &graphql.FieldContext{ 2516 Object: "__Type", 2517 Field: field, 2518 IsMethod: true, 2519 IsResolver: false, 2520 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2521 switch field.Name { 2522 case "kind": 2523 return ec.fieldContext___Type_kind(ctx, field) 2524 case "name": 2525 return ec.fieldContext___Type_name(ctx, field) 2526 case "description": 2527 return ec.fieldContext___Type_description(ctx, field) 2528 case "fields": 2529 return ec.fieldContext___Type_fields(ctx, field) 2530 case "interfaces": 2531 return ec.fieldContext___Type_interfaces(ctx, field) 2532 case "possibleTypes": 2533 return ec.fieldContext___Type_possibleTypes(ctx, field) 2534 case "enumValues": 2535 return ec.fieldContext___Type_enumValues(ctx, field) 2536 case "inputFields": 2537 return ec.fieldContext___Type_inputFields(ctx, field) 2538 case "ofType": 2539 return ec.fieldContext___Type_ofType(ctx, field) 2540 case "specifiedByURL": 2541 return ec.fieldContext___Type_specifiedByURL(ctx, field) 2542 } 2543 return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) 2544 }, 2545 } 2546 return fc, nil 2547 } 2548 2549 func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { 2550 fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) 2551 if err != nil { 2552 return graphql.Null 2553 } 2554 ctx = graphql.WithFieldContext(ctx, fc) 2555 defer func() { 2556 if r := recover(); r != nil { 2557 ec.Error(ctx, ec.Recover(ctx, r)) 2558 ret = graphql.Null 2559 } 2560 }() 2561 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { 2562 ctx = rctx // use context from middleware stack in children 2563 return obj.SpecifiedByURL(), nil 2564 }) 2565 if err != nil { 2566 ec.Error(ctx, err) 2567 return graphql.Null 2568 } 2569 if resTmp == nil { 2570 return graphql.Null 2571 } 2572 res := resTmp.(*string) 2573 fc.Result = res 2574 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 2575 } 2576 2577 func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 2578 fc = &graphql.FieldContext{ 2579 Object: "__Type", 2580 Field: field, 2581 IsMethod: true, 2582 IsResolver: false, 2583 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 2584 return nil, errors.New("field of type String does not have child fields") 2585 }, 2586 } 2587 return fc, nil 2588 } 2589 2590 // endregion **************************** field.gotpl ***************************** 2591 2592 // region **************************** input.gotpl ***************************** 2593 2594 func (ec *executionContext) unmarshalInputNewTodo(ctx context.Context, obj interface{}) (model.NewTodo, error) { 2595 var it model.NewTodo 2596 asMap := map[string]interface{}{} 2597 for k, v := range obj.(map[string]interface{}) { 2598 asMap[k] = v 2599 } 2600 2601 fieldsInOrder := [...]string{"text", "userId"} 2602 for _, k := range fieldsInOrder { 2603 v, ok := asMap[k] 2604 if !ok { 2605 continue 2606 } 2607 switch k { 2608 case "text": 2609 var err error 2610 2611 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) 2612 it.Text, err = ec.unmarshalNString2string(ctx, v) 2613 if err != nil { 2614 return it, err 2615 } 2616 case "userId": 2617 var err error 2618 2619 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) 2620 it.UserID, err = ec.unmarshalNString2string(ctx, v) 2621 if err != nil { 2622 return it, err 2623 } 2624 } 2625 } 2626 2627 return it, nil 2628 } 2629 2630 // endregion **************************** input.gotpl ***************************** 2631 2632 // region ************************** interface.gotpl *************************** 2633 2634 // endregion ************************** interface.gotpl *************************** 2635 2636 // region **************************** object.gotpl **************************** 2637 2638 var mutationImplementors = []string{"Mutation"} 2639 2640 func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 2641 fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) 2642 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ 2643 Object: "Mutation", 2644 }) 2645 2646 out := graphql.NewFieldSet(fields) 2647 for i, field := range fields { 2648 innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ 2649 Object: field.Name, 2650 Field: field, 2651 }) 2652 2653 switch field.Name { 2654 case "__typename": 2655 out.Values[i] = graphql.MarshalString("Mutation") 2656 case "createTodo": 2657 2658 out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { 2659 return ec._Mutation_createTodo(ctx, field) 2660 }) 2661 2662 default: 2663 panic("unknown field " + strconv.Quote(field.Name)) 2664 } 2665 } 2666 out.Dispatch() 2667 return out 2668 } 2669 2670 var queryImplementors = []string{"Query"} 2671 2672 func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { 2673 fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) 2674 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ 2675 Object: "Query", 2676 }) 2677 2678 out := graphql.NewFieldSet(fields) 2679 for i, field := range fields { 2680 innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ 2681 Object: field.Name, 2682 Field: field, 2683 }) 2684 2685 switch field.Name { 2686 case "__typename": 2687 out.Values[i] = graphql.MarshalString("Query") 2688 case "todos": 2689 field := field 2690 2691 innerFunc := func(ctx context.Context) (res graphql.Marshaler) { 2692 defer func() { 2693 if r := recover(); r != nil { 2694 ec.Error(ctx, ec.Recover(ctx, r)) 2695 } 2696 }() 2697 res = ec._Query_todos(ctx, field) 2698 return res 2699 } 2700 2701 rrm := func(ctx context.Context) graphql.Marshaler { 2702 return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) 2703 } 2704 2705 out.Concurrently(i, func() graphql.Marshaler { 2706 return rrm(innerCtx) 2707 }) 2708 case "__type": 2709 2710 out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { 2711 return ec._Query___type(ctx, field) 2712 }) 2713 2714 case "__schema": 2715 2716 out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { 2717 return ec._Query___schema(ctx, field) 2718 }) 2719 2720 default: 2721 panic("unknown field " + strconv.Quote(field.Name)) 2722 } 2723 } 2724 out.Dispatch() 2725 return out 2726 } 2727 2728 var todoImplementors = []string{"Todo"} 2729 2730 func (ec *executionContext) _Todo(ctx context.Context, sel ast.SelectionSet, obj *model.Todo) graphql.Marshaler { 2731 fields := graphql.CollectFields(ec.OperationContext, sel, todoImplementors) 2732 out := graphql.NewFieldSet(fields) 2733 var invalids uint32 2734 for i, field := range fields { 2735 switch field.Name { 2736 case "__typename": 2737 out.Values[i] = graphql.MarshalString("Todo") 2738 case "id": 2739 2740 out.Values[i] = ec._Todo_id(ctx, field, obj) 2741 2742 if out.Values[i] == graphql.Null { 2743 invalids++ 2744 } 2745 case "text": 2746 2747 out.Values[i] = ec._Todo_text(ctx, field, obj) 2748 2749 if out.Values[i] == graphql.Null { 2750 invalids++ 2751 } 2752 case "done": 2753 2754 out.Values[i] = ec._Todo_done(ctx, field, obj) 2755 2756 if out.Values[i] == graphql.Null { 2757 invalids++ 2758 } 2759 case "user": 2760 2761 out.Values[i] = ec._Todo_user(ctx, field, obj) 2762 2763 if out.Values[i] == graphql.Null { 2764 invalids++ 2765 } 2766 default: 2767 panic("unknown field " + strconv.Quote(field.Name)) 2768 } 2769 } 2770 out.Dispatch() 2771 if invalids > 0 { 2772 return graphql.Null 2773 } 2774 return out 2775 } 2776 2777 var userImplementors = []string{"User"} 2778 2779 func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler { 2780 fields := graphql.CollectFields(ec.OperationContext, sel, userImplementors) 2781 out := graphql.NewFieldSet(fields) 2782 var invalids uint32 2783 for i, field := range fields { 2784 switch field.Name { 2785 case "__typename": 2786 out.Values[i] = graphql.MarshalString("User") 2787 case "id": 2788 2789 out.Values[i] = ec._User_id(ctx, field, obj) 2790 2791 if out.Values[i] == graphql.Null { 2792 invalids++ 2793 } 2794 case "name": 2795 2796 out.Values[i] = ec._User_name(ctx, field, obj) 2797 2798 if out.Values[i] == graphql.Null { 2799 invalids++ 2800 } 2801 default: 2802 panic("unknown field " + strconv.Quote(field.Name)) 2803 } 2804 } 2805 out.Dispatch() 2806 if invalids > 0 { 2807 return graphql.Null 2808 } 2809 return out 2810 } 2811 2812 var __DirectiveImplementors = []string{"__Directive"} 2813 2814 func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { 2815 fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) 2816 out := graphql.NewFieldSet(fields) 2817 var invalids uint32 2818 for i, field := range fields { 2819 switch field.Name { 2820 case "__typename": 2821 out.Values[i] = graphql.MarshalString("__Directive") 2822 case "name": 2823 2824 out.Values[i] = ec.___Directive_name(ctx, field, obj) 2825 2826 if out.Values[i] == graphql.Null { 2827 invalids++ 2828 } 2829 case "description": 2830 2831 out.Values[i] = ec.___Directive_description(ctx, field, obj) 2832 2833 case "locations": 2834 2835 out.Values[i] = ec.___Directive_locations(ctx, field, obj) 2836 2837 if out.Values[i] == graphql.Null { 2838 invalids++ 2839 } 2840 case "args": 2841 2842 out.Values[i] = ec.___Directive_args(ctx, field, obj) 2843 2844 if out.Values[i] == graphql.Null { 2845 invalids++ 2846 } 2847 case "isRepeatable": 2848 2849 out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) 2850 2851 if out.Values[i] == graphql.Null { 2852 invalids++ 2853 } 2854 default: 2855 panic("unknown field " + strconv.Quote(field.Name)) 2856 } 2857 } 2858 out.Dispatch() 2859 if invalids > 0 { 2860 return graphql.Null 2861 } 2862 return out 2863 } 2864 2865 var __EnumValueImplementors = []string{"__EnumValue"} 2866 2867 func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { 2868 fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) 2869 out := graphql.NewFieldSet(fields) 2870 var invalids uint32 2871 for i, field := range fields { 2872 switch field.Name { 2873 case "__typename": 2874 out.Values[i] = graphql.MarshalString("__EnumValue") 2875 case "name": 2876 2877 out.Values[i] = ec.___EnumValue_name(ctx, field, obj) 2878 2879 if out.Values[i] == graphql.Null { 2880 invalids++ 2881 } 2882 case "description": 2883 2884 out.Values[i] = ec.___EnumValue_description(ctx, field, obj) 2885 2886 case "isDeprecated": 2887 2888 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) 2889 2890 if out.Values[i] == graphql.Null { 2891 invalids++ 2892 } 2893 case "deprecationReason": 2894 2895 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) 2896 2897 default: 2898 panic("unknown field " + strconv.Quote(field.Name)) 2899 } 2900 } 2901 out.Dispatch() 2902 if invalids > 0 { 2903 return graphql.Null 2904 } 2905 return out 2906 } 2907 2908 var __FieldImplementors = []string{"__Field"} 2909 2910 func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { 2911 fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) 2912 out := graphql.NewFieldSet(fields) 2913 var invalids uint32 2914 for i, field := range fields { 2915 switch field.Name { 2916 case "__typename": 2917 out.Values[i] = graphql.MarshalString("__Field") 2918 case "name": 2919 2920 out.Values[i] = ec.___Field_name(ctx, field, obj) 2921 2922 if out.Values[i] == graphql.Null { 2923 invalids++ 2924 } 2925 case "description": 2926 2927 out.Values[i] = ec.___Field_description(ctx, field, obj) 2928 2929 case "args": 2930 2931 out.Values[i] = ec.___Field_args(ctx, field, obj) 2932 2933 if out.Values[i] == graphql.Null { 2934 invalids++ 2935 } 2936 case "type": 2937 2938 out.Values[i] = ec.___Field_type(ctx, field, obj) 2939 2940 if out.Values[i] == graphql.Null { 2941 invalids++ 2942 } 2943 case "isDeprecated": 2944 2945 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) 2946 2947 if out.Values[i] == graphql.Null { 2948 invalids++ 2949 } 2950 case "deprecationReason": 2951 2952 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) 2953 2954 default: 2955 panic("unknown field " + strconv.Quote(field.Name)) 2956 } 2957 } 2958 out.Dispatch() 2959 if invalids > 0 { 2960 return graphql.Null 2961 } 2962 return out 2963 } 2964 2965 var __InputValueImplementors = []string{"__InputValue"} 2966 2967 func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { 2968 fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) 2969 out := graphql.NewFieldSet(fields) 2970 var invalids uint32 2971 for i, field := range fields { 2972 switch field.Name { 2973 case "__typename": 2974 out.Values[i] = graphql.MarshalString("__InputValue") 2975 case "name": 2976 2977 out.Values[i] = ec.___InputValue_name(ctx, field, obj) 2978 2979 if out.Values[i] == graphql.Null { 2980 invalids++ 2981 } 2982 case "description": 2983 2984 out.Values[i] = ec.___InputValue_description(ctx, field, obj) 2985 2986 case "type": 2987 2988 out.Values[i] = ec.___InputValue_type(ctx, field, obj) 2989 2990 if out.Values[i] == graphql.Null { 2991 invalids++ 2992 } 2993 case "defaultValue": 2994 2995 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) 2996 2997 default: 2998 panic("unknown field " + strconv.Quote(field.Name)) 2999 } 3000 } 3001 out.Dispatch() 3002 if invalids > 0 { 3003 return graphql.Null 3004 } 3005 return out 3006 } 3007 3008 var __SchemaImplementors = []string{"__Schema"} 3009 3010 func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { 3011 fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) 3012 out := graphql.NewFieldSet(fields) 3013 var invalids uint32 3014 for i, field := range fields { 3015 switch field.Name { 3016 case "__typename": 3017 out.Values[i] = graphql.MarshalString("__Schema") 3018 case "description": 3019 3020 out.Values[i] = ec.___Schema_description(ctx, field, obj) 3021 3022 case "types": 3023 3024 out.Values[i] = ec.___Schema_types(ctx, field, obj) 3025 3026 if out.Values[i] == graphql.Null { 3027 invalids++ 3028 } 3029 case "queryType": 3030 3031 out.Values[i] = ec.___Schema_queryType(ctx, field, obj) 3032 3033 if out.Values[i] == graphql.Null { 3034 invalids++ 3035 } 3036 case "mutationType": 3037 3038 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) 3039 3040 case "subscriptionType": 3041 3042 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) 3043 3044 case "directives": 3045 3046 out.Values[i] = ec.___Schema_directives(ctx, field, obj) 3047 3048 if out.Values[i] == graphql.Null { 3049 invalids++ 3050 } 3051 default: 3052 panic("unknown field " + strconv.Quote(field.Name)) 3053 } 3054 } 3055 out.Dispatch() 3056 if invalids > 0 { 3057 return graphql.Null 3058 } 3059 return out 3060 } 3061 3062 var __TypeImplementors = []string{"__Type"} 3063 3064 func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { 3065 fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) 3066 out := graphql.NewFieldSet(fields) 3067 var invalids uint32 3068 for i, field := range fields { 3069 switch field.Name { 3070 case "__typename": 3071 out.Values[i] = graphql.MarshalString("__Type") 3072 case "kind": 3073 3074 out.Values[i] = ec.___Type_kind(ctx, field, obj) 3075 3076 if out.Values[i] == graphql.Null { 3077 invalids++ 3078 } 3079 case "name": 3080 3081 out.Values[i] = ec.___Type_name(ctx, field, obj) 3082 3083 case "description": 3084 3085 out.Values[i] = ec.___Type_description(ctx, field, obj) 3086 3087 case "fields": 3088 3089 out.Values[i] = ec.___Type_fields(ctx, field, obj) 3090 3091 case "interfaces": 3092 3093 out.Values[i] = ec.___Type_interfaces(ctx, field, obj) 3094 3095 case "possibleTypes": 3096 3097 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) 3098 3099 case "enumValues": 3100 3101 out.Values[i] = ec.___Type_enumValues(ctx, field, obj) 3102 3103 case "inputFields": 3104 3105 out.Values[i] = ec.___Type_inputFields(ctx, field, obj) 3106 3107 case "ofType": 3108 3109 out.Values[i] = ec.___Type_ofType(ctx, field, obj) 3110 3111 case "specifiedByURL": 3112 3113 out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) 3114 3115 default: 3116 panic("unknown field " + strconv.Quote(field.Name)) 3117 } 3118 } 3119 out.Dispatch() 3120 if invalids > 0 { 3121 return graphql.Null 3122 } 3123 return out 3124 } 3125 3126 // endregion **************************** object.gotpl **************************** 3127 3128 // region ***************************** type.gotpl ***************************** 3129 3130 func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 3131 res, err := graphql.UnmarshalBoolean(v) 3132 return res, graphql.ErrorOnPath(ctx, err) 3133 } 3134 3135 func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 3136 res := graphql.MarshalBoolean(v) 3137 if res == graphql.Null { 3138 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3139 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3140 } 3141 } 3142 return res 3143 } 3144 3145 func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { 3146 res, err := graphql.UnmarshalID(v) 3147 return res, graphql.ErrorOnPath(ctx, err) 3148 } 3149 3150 func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3151 res := graphql.MarshalID(v) 3152 if res == graphql.Null { 3153 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3154 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3155 } 3156 } 3157 return res 3158 } 3159 3160 func (ec *executionContext) unmarshalNNewTodo2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐNewTodo(ctx context.Context, v interface{}) (model.NewTodo, error) { 3161 res, err := ec.unmarshalInputNewTodo(ctx, v) 3162 return res, graphql.ErrorOnPath(ctx, err) 3163 } 3164 3165 func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { 3166 res, err := graphql.UnmarshalString(v) 3167 return res, graphql.ErrorOnPath(ctx, err) 3168 } 3169 3170 func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3171 res := graphql.MarshalString(v) 3172 if res == graphql.Null { 3173 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3174 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3175 } 3176 } 3177 return res 3178 } 3179 3180 func (ec *executionContext) marshalNTodo2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐTodo(ctx context.Context, sel ast.SelectionSet, v model.Todo) graphql.Marshaler { 3181 return ec._Todo(ctx, sel, &v) 3182 } 3183 3184 func (ec *executionContext) marshalNTodo2ᚕᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐTodoᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Todo) graphql.Marshaler { 3185 ret := make(graphql.Array, len(v)) 3186 var wg sync.WaitGroup 3187 isLen1 := len(v) == 1 3188 if !isLen1 { 3189 wg.Add(len(v)) 3190 } 3191 for i := range v { 3192 i := i 3193 fc := &graphql.FieldContext{ 3194 Index: &i, 3195 Result: &v[i], 3196 } 3197 ctx := graphql.WithFieldContext(ctx, fc) 3198 f := func(i int) { 3199 defer func() { 3200 if r := recover(); r != nil { 3201 ec.Error(ctx, ec.Recover(ctx, r)) 3202 ret = nil 3203 } 3204 }() 3205 if !isLen1 { 3206 defer wg.Done() 3207 } 3208 ret[i] = ec.marshalNTodo2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐTodo(ctx, sel, v[i]) 3209 } 3210 if isLen1 { 3211 f(i) 3212 } else { 3213 go f(i) 3214 } 3215 3216 } 3217 wg.Wait() 3218 3219 for _, e := range ret { 3220 if e == graphql.Null { 3221 return graphql.Null 3222 } 3223 } 3224 3225 return ret 3226 } 3227 3228 func (ec *executionContext) marshalNTodo2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐTodo(ctx context.Context, sel ast.SelectionSet, v *model.Todo) graphql.Marshaler { 3229 if v == nil { 3230 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3231 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3232 } 3233 return graphql.Null 3234 } 3235 return ec._Todo(ctx, sel, v) 3236 } 3237 3238 func (ec *executionContext) marshalNUser2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋapiᚋtestdataᚋdefaultᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { 3239 if v == nil { 3240 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3241 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3242 } 3243 return graphql.Null 3244 } 3245 return ec._User(ctx, sel, v) 3246 } 3247 3248 func (ec *executionContext) marshalN__Directive2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { 3249 return ec.___Directive(ctx, sel, &v) 3250 } 3251 3252 func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { 3253 ret := make(graphql.Array, len(v)) 3254 var wg sync.WaitGroup 3255 isLen1 := len(v) == 1 3256 if !isLen1 { 3257 wg.Add(len(v)) 3258 } 3259 for i := range v { 3260 i := i 3261 fc := &graphql.FieldContext{ 3262 Index: &i, 3263 Result: &v[i], 3264 } 3265 ctx := graphql.WithFieldContext(ctx, fc) 3266 f := func(i int) { 3267 defer func() { 3268 if r := recover(); r != nil { 3269 ec.Error(ctx, ec.Recover(ctx, r)) 3270 ret = nil 3271 } 3272 }() 3273 if !isLen1 { 3274 defer wg.Done() 3275 } 3276 ret[i] = ec.marshalN__Directive2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) 3277 } 3278 if isLen1 { 3279 f(i) 3280 } else { 3281 go f(i) 3282 } 3283 3284 } 3285 wg.Wait() 3286 3287 for _, e := range ret { 3288 if e == graphql.Null { 3289 return graphql.Null 3290 } 3291 } 3292 3293 return ret 3294 } 3295 3296 func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { 3297 res, err := graphql.UnmarshalString(v) 3298 return res, graphql.ErrorOnPath(ctx, err) 3299 } 3300 3301 func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3302 res := graphql.MarshalString(v) 3303 if res == graphql.Null { 3304 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3305 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3306 } 3307 } 3308 return res 3309 } 3310 3311 func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { 3312 var vSlice []interface{} 3313 if v != nil { 3314 vSlice = graphql.CoerceList(v) 3315 } 3316 var err error 3317 res := make([]string, len(vSlice)) 3318 for i := range vSlice { 3319 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) 3320 res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) 3321 if err != nil { 3322 return nil, err 3323 } 3324 } 3325 return res, nil 3326 } 3327 3328 func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { 3329 ret := make(graphql.Array, len(v)) 3330 var wg sync.WaitGroup 3331 isLen1 := len(v) == 1 3332 if !isLen1 { 3333 wg.Add(len(v)) 3334 } 3335 for i := range v { 3336 i := i 3337 fc := &graphql.FieldContext{ 3338 Index: &i, 3339 Result: &v[i], 3340 } 3341 ctx := graphql.WithFieldContext(ctx, fc) 3342 f := func(i int) { 3343 defer func() { 3344 if r := recover(); r != nil { 3345 ec.Error(ctx, ec.Recover(ctx, r)) 3346 ret = nil 3347 } 3348 }() 3349 if !isLen1 { 3350 defer wg.Done() 3351 } 3352 ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) 3353 } 3354 if isLen1 { 3355 f(i) 3356 } else { 3357 go f(i) 3358 } 3359 3360 } 3361 wg.Wait() 3362 3363 for _, e := range ret { 3364 if e == graphql.Null { 3365 return graphql.Null 3366 } 3367 } 3368 3369 return ret 3370 } 3371 3372 func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { 3373 return ec.___EnumValue(ctx, sel, &v) 3374 } 3375 3376 func (ec *executionContext) marshalN__Field2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { 3377 return ec.___Field(ctx, sel, &v) 3378 } 3379 3380 func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { 3381 return ec.___InputValue(ctx, sel, &v) 3382 } 3383 3384 func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 3385 ret := make(graphql.Array, len(v)) 3386 var wg sync.WaitGroup 3387 isLen1 := len(v) == 1 3388 if !isLen1 { 3389 wg.Add(len(v)) 3390 } 3391 for i := range v { 3392 i := i 3393 fc := &graphql.FieldContext{ 3394 Index: &i, 3395 Result: &v[i], 3396 } 3397 ctx := graphql.WithFieldContext(ctx, fc) 3398 f := func(i int) { 3399 defer func() { 3400 if r := recover(); r != nil { 3401 ec.Error(ctx, ec.Recover(ctx, r)) 3402 ret = nil 3403 } 3404 }() 3405 if !isLen1 { 3406 defer wg.Done() 3407 } 3408 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 3409 } 3410 if isLen1 { 3411 f(i) 3412 } else { 3413 go f(i) 3414 } 3415 3416 } 3417 wg.Wait() 3418 3419 for _, e := range ret { 3420 if e == graphql.Null { 3421 return graphql.Null 3422 } 3423 } 3424 3425 return ret 3426 } 3427 3428 func (ec *executionContext) marshalN__Type2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { 3429 return ec.___Type(ctx, sel, &v) 3430 } 3431 3432 func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 3433 ret := make(graphql.Array, len(v)) 3434 var wg sync.WaitGroup 3435 isLen1 := len(v) == 1 3436 if !isLen1 { 3437 wg.Add(len(v)) 3438 } 3439 for i := range v { 3440 i := i 3441 fc := &graphql.FieldContext{ 3442 Index: &i, 3443 Result: &v[i], 3444 } 3445 ctx := graphql.WithFieldContext(ctx, fc) 3446 f := func(i int) { 3447 defer func() { 3448 if r := recover(); r != nil { 3449 ec.Error(ctx, ec.Recover(ctx, r)) 3450 ret = nil 3451 } 3452 }() 3453 if !isLen1 { 3454 defer wg.Done() 3455 } 3456 ret[i] = ec.marshalN__Type2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 3457 } 3458 if isLen1 { 3459 f(i) 3460 } else { 3461 go f(i) 3462 } 3463 3464 } 3465 wg.Wait() 3466 3467 for _, e := range ret { 3468 if e == graphql.Null { 3469 return graphql.Null 3470 } 3471 } 3472 3473 return ret 3474 } 3475 3476 func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 3477 if v == nil { 3478 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3479 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3480 } 3481 return graphql.Null 3482 } 3483 return ec.___Type(ctx, sel, v) 3484 } 3485 3486 func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { 3487 res, err := graphql.UnmarshalString(v) 3488 return res, graphql.ErrorOnPath(ctx, err) 3489 } 3490 3491 func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { 3492 res := graphql.MarshalString(v) 3493 if res == graphql.Null { 3494 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { 3495 ec.Errorf(ctx, "the requested element is null which the schema does not allow") 3496 } 3497 } 3498 return res 3499 } 3500 3501 func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { 3502 res, err := graphql.UnmarshalBoolean(v) 3503 return res, graphql.ErrorOnPath(ctx, err) 3504 } 3505 3506 func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { 3507 res := graphql.MarshalBoolean(v) 3508 return res 3509 } 3510 3511 func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { 3512 if v == nil { 3513 return nil, nil 3514 } 3515 res, err := graphql.UnmarshalBoolean(v) 3516 return &res, graphql.ErrorOnPath(ctx, err) 3517 } 3518 3519 func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { 3520 if v == nil { 3521 return graphql.Null 3522 } 3523 res := graphql.MarshalBoolean(*v) 3524 return res 3525 } 3526 3527 func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { 3528 if v == nil { 3529 return nil, nil 3530 } 3531 res, err := graphql.UnmarshalString(v) 3532 return &res, graphql.ErrorOnPath(ctx, err) 3533 } 3534 3535 func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { 3536 if v == nil { 3537 return graphql.Null 3538 } 3539 res := graphql.MarshalString(*v) 3540 return res 3541 } 3542 3543 func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { 3544 if v == nil { 3545 return graphql.Null 3546 } 3547 ret := make(graphql.Array, len(v)) 3548 var wg sync.WaitGroup 3549 isLen1 := len(v) == 1 3550 if !isLen1 { 3551 wg.Add(len(v)) 3552 } 3553 for i := range v { 3554 i := i 3555 fc := &graphql.FieldContext{ 3556 Index: &i, 3557 Result: &v[i], 3558 } 3559 ctx := graphql.WithFieldContext(ctx, fc) 3560 f := func(i int) { 3561 defer func() { 3562 if r := recover(); r != nil { 3563 ec.Error(ctx, ec.Recover(ctx, r)) 3564 ret = nil 3565 } 3566 }() 3567 if !isLen1 { 3568 defer wg.Done() 3569 } 3570 ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) 3571 } 3572 if isLen1 { 3573 f(i) 3574 } else { 3575 go f(i) 3576 } 3577 3578 } 3579 wg.Wait() 3580 3581 for _, e := range ret { 3582 if e == graphql.Null { 3583 return graphql.Null 3584 } 3585 } 3586 3587 return ret 3588 } 3589 3590 func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { 3591 if v == nil { 3592 return graphql.Null 3593 } 3594 ret := make(graphql.Array, len(v)) 3595 var wg sync.WaitGroup 3596 isLen1 := len(v) == 1 3597 if !isLen1 { 3598 wg.Add(len(v)) 3599 } 3600 for i := range v { 3601 i := i 3602 fc := &graphql.FieldContext{ 3603 Index: &i, 3604 Result: &v[i], 3605 } 3606 ctx := graphql.WithFieldContext(ctx, fc) 3607 f := func(i int) { 3608 defer func() { 3609 if r := recover(); r != nil { 3610 ec.Error(ctx, ec.Recover(ctx, r)) 3611 ret = nil 3612 } 3613 }() 3614 if !isLen1 { 3615 defer wg.Done() 3616 } 3617 ret[i] = ec.marshalN__Field2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) 3618 } 3619 if isLen1 { 3620 f(i) 3621 } else { 3622 go f(i) 3623 } 3624 3625 } 3626 wg.Wait() 3627 3628 for _, e := range ret { 3629 if e == graphql.Null { 3630 return graphql.Null 3631 } 3632 } 3633 3634 return ret 3635 } 3636 3637 func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { 3638 if v == nil { 3639 return graphql.Null 3640 } 3641 ret := make(graphql.Array, len(v)) 3642 var wg sync.WaitGroup 3643 isLen1 := len(v) == 1 3644 if !isLen1 { 3645 wg.Add(len(v)) 3646 } 3647 for i := range v { 3648 i := i 3649 fc := &graphql.FieldContext{ 3650 Index: &i, 3651 Result: &v[i], 3652 } 3653 ctx := graphql.WithFieldContext(ctx, fc) 3654 f := func(i int) { 3655 defer func() { 3656 if r := recover(); r != nil { 3657 ec.Error(ctx, ec.Recover(ctx, r)) 3658 ret = nil 3659 } 3660 }() 3661 if !isLen1 { 3662 defer wg.Done() 3663 } 3664 ret[i] = ec.marshalN__InputValue2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) 3665 } 3666 if isLen1 { 3667 f(i) 3668 } else { 3669 go f(i) 3670 } 3671 3672 } 3673 wg.Wait() 3674 3675 for _, e := range ret { 3676 if e == graphql.Null { 3677 return graphql.Null 3678 } 3679 } 3680 3681 return ret 3682 } 3683 3684 func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { 3685 if v == nil { 3686 return graphql.Null 3687 } 3688 return ec.___Schema(ctx, sel, v) 3689 } 3690 3691 func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { 3692 if v == nil { 3693 return graphql.Null 3694 } 3695 ret := make(graphql.Array, len(v)) 3696 var wg sync.WaitGroup 3697 isLen1 := len(v) == 1 3698 if !isLen1 { 3699 wg.Add(len(v)) 3700 } 3701 for i := range v { 3702 i := i 3703 fc := &graphql.FieldContext{ 3704 Index: &i, 3705 Result: &v[i], 3706 } 3707 ctx := graphql.WithFieldContext(ctx, fc) 3708 f := func(i int) { 3709 defer func() { 3710 if r := recover(); r != nil { 3711 ec.Error(ctx, ec.Recover(ctx, r)) 3712 ret = nil 3713 } 3714 }() 3715 if !isLen1 { 3716 defer wg.Done() 3717 } 3718 ret[i] = ec.marshalN__Type2githubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) 3719 } 3720 if isLen1 { 3721 f(i) 3722 } else { 3723 go f(i) 3724 } 3725 3726 } 3727 wg.Wait() 3728 3729 for _, e := range ret { 3730 if e == graphql.Null { 3731 return graphql.Null 3732 } 3733 } 3734 3735 return ret 3736 } 3737 3738 func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋmstephanoᚋgqlgenᚑschemagenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { 3739 if v == nil { 3740 return graphql.Null 3741 } 3742 return ec.___Type(ctx, sel, v) 3743 } 3744 3745 // endregion ***************************** type.gotpl *****************************