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