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