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