github.com/geneva/gqlgen@v0.17.7-0.20230801155730-7b9317164836/codegen/testserver/followschema/validtypes.generated.go (about) 1 // Code generated by github.com/geneva/gqlgen, DO NOT EDIT. 2 3 package followschema 4 5 import ( 6 "context" 7 "errors" 8 "fmt" 9 "strconv" 10 "sync/atomic" 11 12 "github.com/geneva/gqlgen/graphql" 13 "github.com/vektah/gqlparser/v2/ast" 14 ) 15 16 // region ************************** generated!.gotpl ************************** 17 18 // endregion ************************** generated!.gotpl ************************** 19 20 // region ***************************** args.gotpl ***************************** 21 22 func (ec *executionContext) field_ValidType_validArgs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 23 var err error 24 args := map[string]interface{}{} 25 var arg0 string 26 if tmp, ok := rawArgs["break"]; ok { 27 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("break")) 28 arg0, err = ec.unmarshalNString2string(ctx, tmp) 29 if err != nil { 30 return nil, err 31 } 32 } 33 args["break"] = arg0 34 var arg1 string 35 if tmp, ok := rawArgs["default"]; ok { 36 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("default")) 37 arg1, err = ec.unmarshalNString2string(ctx, tmp) 38 if err != nil { 39 return nil, err 40 } 41 } 42 args["default"] = arg1 43 var arg2 string 44 if tmp, ok := rawArgs["func"]; ok { 45 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) 46 arg2, err = ec.unmarshalNString2string(ctx, tmp) 47 if err != nil { 48 return nil, err 49 } 50 } 51 args["func"] = arg2 52 var arg3 string 53 if tmp, ok := rawArgs["interface"]; ok { 54 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interface")) 55 arg3, err = ec.unmarshalNString2string(ctx, tmp) 56 if err != nil { 57 return nil, err 58 } 59 } 60 args["interface"] = arg3 61 var arg4 string 62 if tmp, ok := rawArgs["select"]; ok { 63 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("select")) 64 arg4, err = ec.unmarshalNString2string(ctx, tmp) 65 if err != nil { 66 return nil, err 67 } 68 } 69 args["select"] = arg4 70 var arg5 string 71 if tmp, ok := rawArgs["case"]; ok { 72 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("case")) 73 arg5, err = ec.unmarshalNString2string(ctx, tmp) 74 if err != nil { 75 return nil, err 76 } 77 } 78 args["case"] = arg5 79 var arg6 string 80 if tmp, ok := rawArgs["defer"]; ok { 81 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defer")) 82 arg6, err = ec.unmarshalNString2string(ctx, tmp) 83 if err != nil { 84 return nil, err 85 } 86 } 87 args["defer"] = arg6 88 var arg7 string 89 if tmp, ok := rawArgs["go"]; ok { 90 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("go")) 91 arg7, err = ec.unmarshalNString2string(ctx, tmp) 92 if err != nil { 93 return nil, err 94 } 95 } 96 args["go"] = arg7 97 var arg8 string 98 if tmp, ok := rawArgs["map"]; ok { 99 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map")) 100 arg8, err = ec.unmarshalNString2string(ctx, tmp) 101 if err != nil { 102 return nil, err 103 } 104 } 105 args["map"] = arg8 106 var arg9 string 107 if tmp, ok := rawArgs["struct"]; ok { 108 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("struct")) 109 arg9, err = ec.unmarshalNString2string(ctx, tmp) 110 if err != nil { 111 return nil, err 112 } 113 } 114 args["struct"] = arg9 115 var arg10 string 116 if tmp, ok := rawArgs["chan"]; ok { 117 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chan")) 118 arg10, err = ec.unmarshalNString2string(ctx, tmp) 119 if err != nil { 120 return nil, err 121 } 122 } 123 args["chan"] = arg10 124 var arg11 string 125 if tmp, ok := rawArgs["else"]; ok { 126 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("else")) 127 arg11, err = ec.unmarshalNString2string(ctx, tmp) 128 if err != nil { 129 return nil, err 130 } 131 } 132 args["else"] = arg11 133 var arg12 string 134 if tmp, ok := rawArgs["goto"]; ok { 135 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("goto")) 136 arg12, err = ec.unmarshalNString2string(ctx, tmp) 137 if err != nil { 138 return nil, err 139 } 140 } 141 args["goto"] = arg12 142 var arg13 string 143 if tmp, ok := rawArgs["package"]; ok { 144 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) 145 arg13, err = ec.unmarshalNString2string(ctx, tmp) 146 if err != nil { 147 return nil, err 148 } 149 } 150 args["package"] = arg13 151 var arg14 string 152 if tmp, ok := rawArgs["switch"]; ok { 153 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("switch")) 154 arg14, err = ec.unmarshalNString2string(ctx, tmp) 155 if err != nil { 156 return nil, err 157 } 158 } 159 args["switch"] = arg14 160 var arg15 string 161 if tmp, ok := rawArgs["const"]; ok { 162 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("const")) 163 arg15, err = ec.unmarshalNString2string(ctx, tmp) 164 if err != nil { 165 return nil, err 166 } 167 } 168 args["const"] = arg15 169 var arg16 string 170 if tmp, ok := rawArgs["fallthrough"]; ok { 171 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fallthrough")) 172 arg16, err = ec.unmarshalNString2string(ctx, tmp) 173 if err != nil { 174 return nil, err 175 } 176 } 177 args["fallthrough"] = arg16 178 var arg17 string 179 if tmp, ok := rawArgs["if"]; ok { 180 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("if")) 181 arg17, err = ec.unmarshalNString2string(ctx, tmp) 182 if err != nil { 183 return nil, err 184 } 185 } 186 args["if"] = arg17 187 var arg18 string 188 if tmp, ok := rawArgs["range"]; ok { 189 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("range")) 190 arg18, err = ec.unmarshalNString2string(ctx, tmp) 191 if err != nil { 192 return nil, err 193 } 194 } 195 args["range"] = arg18 196 var arg19 string 197 if tmp, ok := rawArgs["type"]; ok { 198 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) 199 arg19, err = ec.unmarshalNString2string(ctx, tmp) 200 if err != nil { 201 return nil, err 202 } 203 } 204 args["type"] = arg19 205 var arg20 string 206 if tmp, ok := rawArgs["continue"]; ok { 207 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("continue")) 208 arg20, err = ec.unmarshalNString2string(ctx, tmp) 209 if err != nil { 210 return nil, err 211 } 212 } 213 args["continue"] = arg20 214 var arg21 string 215 if tmp, ok := rawArgs["for"]; ok { 216 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("for")) 217 arg21, err = ec.unmarshalNString2string(ctx, tmp) 218 if err != nil { 219 return nil, err 220 } 221 } 222 args["for"] = arg21 223 var arg22 string 224 if tmp, ok := rawArgs["import"]; ok { 225 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("import")) 226 arg22, err = ec.unmarshalNString2string(ctx, tmp) 227 if err != nil { 228 return nil, err 229 } 230 } 231 args["import"] = arg22 232 var arg23 string 233 if tmp, ok := rawArgs["return"]; ok { 234 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("return")) 235 arg23, err = ec.unmarshalNString2string(ctx, tmp) 236 if err != nil { 237 return nil, err 238 } 239 } 240 args["return"] = arg23 241 var arg24 string 242 if tmp, ok := rawArgs["var"]; ok { 243 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("var")) 244 arg24, err = ec.unmarshalNString2string(ctx, tmp) 245 if err != nil { 246 return nil, err 247 } 248 } 249 args["var"] = arg24 250 var arg25 string 251 if tmp, ok := rawArgs["_"]; ok { 252 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_")) 253 arg25, err = ec.unmarshalNString2string(ctx, tmp) 254 if err != nil { 255 return nil, err 256 } 257 } 258 args["_"] = arg25 259 return args, nil 260 } 261 262 func (ec *executionContext) field_ValidType_validInputKeywords_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { 263 var err error 264 args := map[string]interface{}{} 265 var arg0 *ValidInput 266 if tmp, ok := rawArgs["input"]; ok { 267 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) 268 arg0, err = ec.unmarshalOValidInput2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐValidInput(ctx, tmp) 269 if err != nil { 270 return nil, err 271 } 272 } 273 args["input"] = arg0 274 return args, nil 275 } 276 277 // endregion ***************************** args.gotpl ***************************** 278 279 // region ************************** directives.gotpl ************************** 280 281 // endregion ************************** directives.gotpl ************************** 282 283 // region **************************** field.gotpl ***************************** 284 285 func (ec *executionContext) _Content_Post_foo(ctx context.Context, field graphql.CollectedField, obj *ContentPost) (ret graphql.Marshaler) { 286 fc, err := ec.fieldContext_Content_Post_foo(ctx, field) 287 if err != nil { 288 return graphql.Null 289 } 290 ctx = graphql.WithFieldContext(ctx, fc) 291 defer func() { 292 if r := recover(); r != nil { 293 ec.Error(ctx, ec.Recover(ctx, r)) 294 ret = graphql.Null 295 } 296 }() 297 resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 298 ctx = rctx // use context from middleware stack in children 299 return obj.Foo, nil 300 }) 301 302 if resTmp == nil { 303 return graphql.Null 304 } 305 res := resTmp.(*string) 306 fc.Result = res 307 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 308 } 309 310 func (ec *executionContext) fieldContext_Content_Post_foo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 311 fc = &graphql.FieldContext{ 312 Object: "Content_Post", 313 Field: field, 314 IsMethod: false, 315 IsResolver: false, 316 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 317 return nil, errors.New("field of type String does not have child fields") 318 }, 319 } 320 return fc, nil 321 } 322 323 func (ec *executionContext) _Content_User_foo(ctx context.Context, field graphql.CollectedField, obj *ContentUser) (ret graphql.Marshaler) { 324 fc, err := ec.fieldContext_Content_User_foo(ctx, field) 325 if err != nil { 326 return graphql.Null 327 } 328 ctx = graphql.WithFieldContext(ctx, fc) 329 defer func() { 330 if r := recover(); r != nil { 331 ec.Error(ctx, ec.Recover(ctx, r)) 332 ret = graphql.Null 333 } 334 }() 335 resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 336 ctx = rctx // use context from middleware stack in children 337 return obj.Foo, nil 338 }) 339 340 if resTmp == nil { 341 return graphql.Null 342 } 343 res := resTmp.(*string) 344 fc.Result = res 345 return ec.marshalOString2ᚖstring(ctx, field.Selections, res) 346 } 347 348 func (ec *executionContext) fieldContext_Content_User_foo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 349 fc = &graphql.FieldContext{ 350 Object: "Content_User", 351 Field: field, 352 IsMethod: false, 353 IsResolver: false, 354 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 355 return nil, errors.New("field of type String does not have child fields") 356 }, 357 } 358 return fc, nil 359 } 360 361 func (ec *executionContext) _ValidType_differentCase(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) { 362 fc, err := ec.fieldContext_ValidType_differentCase(ctx, field) 363 if err != nil { 364 return graphql.Null 365 } 366 ctx = graphql.WithFieldContext(ctx, fc) 367 defer func() { 368 if r := recover(); r != nil { 369 ec.Error(ctx, ec.Recover(ctx, r)) 370 ret = graphql.Null 371 } 372 }() 373 resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 374 ctx = rctx // use context from middleware stack in children 375 return obj.DifferentCase, nil 376 }) 377 378 if resTmp == nil { 379 if !graphql.HasFieldError(ctx, fc) { 380 ec.Errorf(ctx, "must not be null") 381 } 382 return graphql.Null 383 } 384 res := resTmp.(string) 385 fc.Result = res 386 return ec.marshalNString2string(ctx, field.Selections, res) 387 } 388 389 func (ec *executionContext) fieldContext_ValidType_differentCase(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 390 fc = &graphql.FieldContext{ 391 Object: "ValidType", 392 Field: field, 393 IsMethod: false, 394 IsResolver: false, 395 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 396 return nil, errors.New("field of type String does not have child fields") 397 }, 398 } 399 return fc, nil 400 } 401 402 func (ec *executionContext) _ValidType_different_case(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) { 403 fc, err := ec.fieldContext_ValidType_different_case(ctx, field) 404 if err != nil { 405 return graphql.Null 406 } 407 ctx = graphql.WithFieldContext(ctx, fc) 408 defer func() { 409 if r := recover(); r != nil { 410 ec.Error(ctx, ec.Recover(ctx, r)) 411 ret = graphql.Null 412 } 413 }() 414 resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 415 ctx = rctx // use context from middleware stack in children 416 return obj.DifferentCaseOld, nil 417 }) 418 419 if resTmp == nil { 420 if !graphql.HasFieldError(ctx, fc) { 421 ec.Errorf(ctx, "must not be null") 422 } 423 return graphql.Null 424 } 425 res := resTmp.(string) 426 fc.Result = res 427 return ec.marshalNString2string(ctx, field.Selections, res) 428 } 429 430 func (ec *executionContext) fieldContext_ValidType_different_case(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 431 fc = &graphql.FieldContext{ 432 Object: "ValidType", 433 Field: field, 434 IsMethod: false, 435 IsResolver: false, 436 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 437 return nil, errors.New("field of type String does not have child fields") 438 }, 439 } 440 return fc, nil 441 } 442 443 func (ec *executionContext) _ValidType_validInputKeywords(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) { 444 fc, err := ec.fieldContext_ValidType_validInputKeywords(ctx, field) 445 if err != nil { 446 return graphql.Null 447 } 448 ctx = graphql.WithFieldContext(ctx, fc) 449 defer func() { 450 if r := recover(); r != nil { 451 ec.Error(ctx, ec.Recover(ctx, r)) 452 ret = graphql.Null 453 } 454 }() 455 resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 456 ctx = rctx // use context from middleware stack in children 457 return obj.ValidInputKeywords, nil 458 }) 459 460 if resTmp == nil { 461 if !graphql.HasFieldError(ctx, fc) { 462 ec.Errorf(ctx, "must not be null") 463 } 464 return graphql.Null 465 } 466 res := resTmp.(bool) 467 fc.Result = res 468 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 469 } 470 471 func (ec *executionContext) fieldContext_ValidType_validInputKeywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 472 fc = &graphql.FieldContext{ 473 Object: "ValidType", 474 Field: field, 475 IsMethod: false, 476 IsResolver: false, 477 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 478 return nil, errors.New("field of type Boolean does not have child fields") 479 }, 480 } 481 defer func() { 482 if r := recover(); r != nil { 483 err = ec.Recover(ctx, r) 484 ec.Error(ctx, err) 485 } 486 }() 487 ctx = graphql.WithFieldContext(ctx, fc) 488 if fc.Args, err = ec.field_ValidType_validInputKeywords_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { 489 ec.Error(ctx, err) 490 return fc, err 491 } 492 return fc, nil 493 } 494 495 func (ec *executionContext) _ValidType_validArgs(ctx context.Context, field graphql.CollectedField, obj *ValidType) (ret graphql.Marshaler) { 496 fc, err := ec.fieldContext_ValidType_validArgs(ctx, field) 497 if err != nil { 498 return graphql.Null 499 } 500 ctx = graphql.WithFieldContext(ctx, fc) 501 defer func() { 502 if r := recover(); r != nil { 503 ec.Error(ctx, ec.Recover(ctx, r)) 504 ret = graphql.Null 505 } 506 }() 507 resTmp := ec._fieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { 508 ctx = rctx // use context from middleware stack in children 509 return obj.ValidArgs, nil 510 }) 511 512 if resTmp == nil { 513 if !graphql.HasFieldError(ctx, fc) { 514 ec.Errorf(ctx, "must not be null") 515 } 516 return graphql.Null 517 } 518 res := resTmp.(bool) 519 fc.Result = res 520 return ec.marshalNBoolean2bool(ctx, field.Selections, res) 521 } 522 523 func (ec *executionContext) fieldContext_ValidType_validArgs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { 524 fc = &graphql.FieldContext{ 525 Object: "ValidType", 526 Field: field, 527 IsMethod: false, 528 IsResolver: false, 529 Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { 530 return nil, errors.New("field of type Boolean does not have child fields") 531 }, 532 } 533 defer func() { 534 if r := recover(); r != nil { 535 err = ec.Recover(ctx, r) 536 ec.Error(ctx, err) 537 } 538 }() 539 ctx = graphql.WithFieldContext(ctx, fc) 540 if fc.Args, err = ec.field_ValidType_validArgs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { 541 ec.Error(ctx, err) 542 return fc, err 543 } 544 return fc, nil 545 } 546 547 // endregion **************************** field.gotpl ***************************** 548 549 // region **************************** input.gotpl ***************************** 550 551 func (ec *executionContext) unmarshalInputValidInput(ctx context.Context, obj interface{}) (ValidInput, error) { 552 var it ValidInput 553 asMap := map[string]interface{}{} 554 for k, v := range obj.(map[string]interface{}) { 555 asMap[k] = v 556 } 557 558 fieldsInOrder := [...]string{"break", "default", "func", "interface", "select", "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", "continue", "for", "import", "return", "var", "_"} 559 for _, k := range fieldsInOrder { 560 v, ok := asMap[k] 561 if !ok { 562 continue 563 } 564 switch k { 565 case "break": 566 var err error 567 568 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("break")) 569 data, err := ec.unmarshalNString2string(ctx, v) 570 if err != nil { 571 return it, err 572 } 573 it.Break = data 574 case "default": 575 var err error 576 577 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("default")) 578 data, err := ec.unmarshalNString2string(ctx, v) 579 if err != nil { 580 return it, err 581 } 582 it.Default = data 583 case "func": 584 var err error 585 586 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("func")) 587 data, err := ec.unmarshalNString2string(ctx, v) 588 if err != nil { 589 return it, err 590 } 591 it.Func = data 592 case "interface": 593 var err error 594 595 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("interface")) 596 data, err := ec.unmarshalNString2string(ctx, v) 597 if err != nil { 598 return it, err 599 } 600 it.Interface = data 601 case "select": 602 var err error 603 604 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("select")) 605 data, err := ec.unmarshalNString2string(ctx, v) 606 if err != nil { 607 return it, err 608 } 609 it.Select = data 610 case "case": 611 var err error 612 613 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("case")) 614 data, err := ec.unmarshalNString2string(ctx, v) 615 if err != nil { 616 return it, err 617 } 618 it.Case = data 619 case "defer": 620 var err error 621 622 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("defer")) 623 data, err := ec.unmarshalNString2string(ctx, v) 624 if err != nil { 625 return it, err 626 } 627 it.Defer = data 628 case "go": 629 var err error 630 631 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("go")) 632 data, err := ec.unmarshalNString2string(ctx, v) 633 if err != nil { 634 return it, err 635 } 636 it.Go = data 637 case "map": 638 var err error 639 640 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map")) 641 data, err := ec.unmarshalNString2string(ctx, v) 642 if err != nil { 643 return it, err 644 } 645 it.Map = data 646 case "struct": 647 var err error 648 649 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("struct")) 650 data, err := ec.unmarshalNString2string(ctx, v) 651 if err != nil { 652 return it, err 653 } 654 it.Struct = data 655 case "chan": 656 var err error 657 658 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("chan")) 659 data, err := ec.unmarshalNString2string(ctx, v) 660 if err != nil { 661 return it, err 662 } 663 it.Chan = data 664 case "else": 665 var err error 666 667 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("else")) 668 data, err := ec.unmarshalNString2string(ctx, v) 669 if err != nil { 670 return it, err 671 } 672 it.Else = data 673 case "goto": 674 var err error 675 676 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("goto")) 677 data, err := ec.unmarshalNString2string(ctx, v) 678 if err != nil { 679 return it, err 680 } 681 it.Goto = data 682 case "package": 683 var err error 684 685 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("package")) 686 data, err := ec.unmarshalNString2string(ctx, v) 687 if err != nil { 688 return it, err 689 } 690 it.Package = data 691 case "switch": 692 var err error 693 694 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("switch")) 695 data, err := ec.unmarshalNString2string(ctx, v) 696 if err != nil { 697 return it, err 698 } 699 it.Switch = data 700 case "const": 701 var err error 702 703 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("const")) 704 data, err := ec.unmarshalNString2string(ctx, v) 705 if err != nil { 706 return it, err 707 } 708 it.Const = data 709 case "fallthrough": 710 var err error 711 712 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fallthrough")) 713 data, err := ec.unmarshalNString2string(ctx, v) 714 if err != nil { 715 return it, err 716 } 717 it.Fallthrough = data 718 case "if": 719 var err error 720 721 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("if")) 722 data, err := ec.unmarshalNString2string(ctx, v) 723 if err != nil { 724 return it, err 725 } 726 it.If = data 727 case "range": 728 var err error 729 730 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("range")) 731 data, err := ec.unmarshalNString2string(ctx, v) 732 if err != nil { 733 return it, err 734 } 735 it.Range = data 736 case "type": 737 var err error 738 739 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) 740 data, err := ec.unmarshalNString2string(ctx, v) 741 if err != nil { 742 return it, err 743 } 744 it.Type = data 745 case "continue": 746 var err error 747 748 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("continue")) 749 data, err := ec.unmarshalNString2string(ctx, v) 750 if err != nil { 751 return it, err 752 } 753 it.Continue = data 754 case "for": 755 var err error 756 757 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("for")) 758 data, err := ec.unmarshalNString2string(ctx, v) 759 if err != nil { 760 return it, err 761 } 762 it.For = data 763 case "import": 764 var err error 765 766 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("import")) 767 data, err := ec.unmarshalNString2string(ctx, v) 768 if err != nil { 769 return it, err 770 } 771 it.Import = data 772 case "return": 773 var err error 774 775 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("return")) 776 data, err := ec.unmarshalNString2string(ctx, v) 777 if err != nil { 778 return it, err 779 } 780 it.Return = data 781 case "var": 782 var err error 783 784 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("var")) 785 data, err := ec.unmarshalNString2string(ctx, v) 786 if err != nil { 787 return it, err 788 } 789 it.Var = data 790 case "_": 791 var err error 792 793 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("_")) 794 data, err := ec.unmarshalNString2string(ctx, v) 795 if err != nil { 796 return it, err 797 } 798 it.Underscore = data 799 } 800 } 801 802 return it, nil 803 } 804 805 // endregion **************************** input.gotpl ***************************** 806 807 // region ************************** interface.gotpl *************************** 808 809 func (ec *executionContext) _Content_Child(ctx context.Context, sel ast.SelectionSet, obj ContentChild) graphql.Marshaler { 810 switch obj := (obj).(type) { 811 case nil: 812 return graphql.Null 813 case ContentUser: 814 return ec._Content_User(ctx, sel, &obj) 815 case *ContentUser: 816 if obj == nil { 817 return graphql.Null 818 } 819 return ec._Content_User(ctx, sel, obj) 820 case ContentPost: 821 return ec._Content_Post(ctx, sel, &obj) 822 case *ContentPost: 823 if obj == nil { 824 return graphql.Null 825 } 826 return ec._Content_Post(ctx, sel, obj) 827 default: 828 panic(fmt.Errorf("unexpected type %T", obj)) 829 } 830 } 831 832 // endregion ************************** interface.gotpl *************************** 833 834 // region **************************** object.gotpl **************************** 835 836 var content_PostImplementors = []string{"Content_Post", "Content_Child"} 837 838 func (ec *executionContext) _Content_Post(ctx context.Context, sel ast.SelectionSet, obj *ContentPost) graphql.Marshaler { 839 fields := graphql.CollectFields(ec.OperationContext, sel, content_PostImplementors) 840 841 out := graphql.NewFieldSet(fields) 842 deferred := make(map[string]*graphql.FieldSet) 843 for i, field := range fields { 844 switch field.Name { 845 case "__typename": 846 out.Values[i] = graphql.MarshalString("Content_Post") 847 case "foo": 848 out.Values[i] = ec._Content_Post_foo(ctx, field, obj) 849 default: 850 panic("unknown field " + strconv.Quote(field.Name)) 851 } 852 } 853 out.Dispatch(ctx) 854 if out.Invalids > 0 { 855 return graphql.Null 856 } 857 858 atomic.AddInt32(&ec.deferred, int32(len(deferred))) 859 860 for label, dfs := range deferred { 861 ec.processDeferredGroup(graphql.DeferredGroup{ 862 Label: label, 863 Path: graphql.GetPath(ctx), 864 FieldSet: dfs, 865 Context: ctx, 866 }) 867 } 868 869 return out 870 } 871 872 var content_UserImplementors = []string{"Content_User", "Content_Child"} 873 874 func (ec *executionContext) _Content_User(ctx context.Context, sel ast.SelectionSet, obj *ContentUser) graphql.Marshaler { 875 fields := graphql.CollectFields(ec.OperationContext, sel, content_UserImplementors) 876 877 out := graphql.NewFieldSet(fields) 878 deferred := make(map[string]*graphql.FieldSet) 879 for i, field := range fields { 880 switch field.Name { 881 case "__typename": 882 out.Values[i] = graphql.MarshalString("Content_User") 883 case "foo": 884 out.Values[i] = ec._Content_User_foo(ctx, field, obj) 885 default: 886 panic("unknown field " + strconv.Quote(field.Name)) 887 } 888 } 889 out.Dispatch(ctx) 890 if out.Invalids > 0 { 891 return graphql.Null 892 } 893 894 atomic.AddInt32(&ec.deferred, int32(len(deferred))) 895 896 for label, dfs := range deferred { 897 ec.processDeferredGroup(graphql.DeferredGroup{ 898 Label: label, 899 Path: graphql.GetPath(ctx), 900 FieldSet: dfs, 901 Context: ctx, 902 }) 903 } 904 905 return out 906 } 907 908 var validTypeImplementors = []string{"ValidType"} 909 910 func (ec *executionContext) _ValidType(ctx context.Context, sel ast.SelectionSet, obj *ValidType) graphql.Marshaler { 911 fields := graphql.CollectFields(ec.OperationContext, sel, validTypeImplementors) 912 913 out := graphql.NewFieldSet(fields) 914 deferred := make(map[string]*graphql.FieldSet) 915 for i, field := range fields { 916 switch field.Name { 917 case "__typename": 918 out.Values[i] = graphql.MarshalString("ValidType") 919 case "differentCase": 920 out.Values[i] = ec._ValidType_differentCase(ctx, field, obj) 921 if out.Values[i] == graphql.Null { 922 out.Invalids++ 923 } 924 case "different_case": 925 out.Values[i] = ec._ValidType_different_case(ctx, field, obj) 926 if out.Values[i] == graphql.Null { 927 out.Invalids++ 928 } 929 case "validInputKeywords": 930 out.Values[i] = ec._ValidType_validInputKeywords(ctx, field, obj) 931 if out.Values[i] == graphql.Null { 932 out.Invalids++ 933 } 934 case "validArgs": 935 out.Values[i] = ec._ValidType_validArgs(ctx, field, obj) 936 if out.Values[i] == graphql.Null { 937 out.Invalids++ 938 } 939 default: 940 panic("unknown field " + strconv.Quote(field.Name)) 941 } 942 } 943 out.Dispatch(ctx) 944 if out.Invalids > 0 { 945 return graphql.Null 946 } 947 948 atomic.AddInt32(&ec.deferred, int32(len(deferred))) 949 950 for label, dfs := range deferred { 951 ec.processDeferredGroup(graphql.DeferredGroup{ 952 Label: label, 953 Path: graphql.GetPath(ctx), 954 FieldSet: dfs, 955 Context: ctx, 956 }) 957 } 958 959 return out 960 } 961 962 // endregion **************************** object.gotpl **************************** 963 964 // region ***************************** type.gotpl ***************************** 965 966 func (ec *executionContext) unmarshalOValidInput2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐValidInput(ctx context.Context, v interface{}) (*ValidInput, error) { 967 if v == nil { 968 return nil, nil 969 } 970 res, err := ec.unmarshalInputValidInput(ctx, v) 971 return &res, graphql.ErrorOnPath(ctx, err) 972 } 973 974 func (ec *executionContext) marshalOValidType2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐValidType(ctx context.Context, sel ast.SelectionSet, v *ValidType) graphql.Marshaler { 975 if v == nil { 976 return graphql.Null 977 } 978 return ec._ValidType(ctx, sel, v) 979 } 980 981 // endregion ***************************** type.gotpl *****************************