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