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