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