github.com/geneva/gqlgen@v0.17.7-0.20230801155730-7b9317164836/codegen/testserver/followschema/mutation_with_custom_scalar.generated.go (about) 1 // Code generated by github.com/geneva/gqlgen, DO NOT EDIT. 2 3 package followschema 4 5 import ( 6 "context" 7 8 "github.com/geneva/gqlgen/graphql" 9 "github.com/vektah/gqlparser/v2/ast" 10 ) 11 12 // region ************************** generated!.gotpl ************************** 13 14 // endregion ************************** generated!.gotpl ************************** 15 16 // region ***************************** args.gotpl ***************************** 17 18 // endregion ***************************** args.gotpl ***************************** 19 20 // region ************************** directives.gotpl ************************** 21 22 // endregion ************************** directives.gotpl ************************** 23 24 // region **************************** field.gotpl ***************************** 25 26 // endregion **************************** field.gotpl ***************************** 27 28 // region **************************** input.gotpl ***************************** 29 30 func (ec *executionContext) unmarshalInputNestedInput(ctx context.Context, obj interface{}) (NestedInput, error) { 31 var it NestedInput 32 asMap := map[string]interface{}{} 33 for k, v := range obj.(map[string]interface{}) { 34 asMap[k] = v 35 } 36 37 fieldsInOrder := [...]string{"field"} 38 for _, k := range fieldsInOrder { 39 v, ok := asMap[k] 40 if !ok { 41 continue 42 } 43 switch k { 44 case "field": 45 var err error 46 47 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) 48 data, err := ec.unmarshalNEmail2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEmail(ctx, v) 49 if err != nil { 50 return it, err 51 } 52 it.Field = data 53 } 54 } 55 56 return it, nil 57 } 58 59 func (ec *executionContext) unmarshalInputSpecialInput(ctx context.Context, obj interface{}) (SpecialInput, error) { 60 var it SpecialInput 61 asMap := map[string]interface{}{} 62 for k, v := range obj.(map[string]interface{}) { 63 asMap[k] = v 64 } 65 66 fieldsInOrder := [...]string{"nesting"} 67 for _, k := range fieldsInOrder { 68 v, ok := asMap[k] 69 if !ok { 70 continue 71 } 72 switch k { 73 case "nesting": 74 var err error 75 76 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nesting")) 77 data, err := ec.unmarshalNNestedInput2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐNestedInput(ctx, v) 78 if err != nil { 79 return it, err 80 } 81 it.Nesting = data 82 } 83 } 84 85 return it, nil 86 } 87 88 // endregion **************************** input.gotpl ***************************** 89 90 // region ************************** interface.gotpl *************************** 91 92 // endregion ************************** interface.gotpl *************************** 93 94 // region **************************** object.gotpl **************************** 95 96 // endregion **************************** object.gotpl **************************** 97 98 // region ***************************** type.gotpl ***************************** 99 100 func (ec *executionContext) unmarshalNEmail2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEmail(ctx context.Context, v interface{}) (Email, error) { 101 var res Email 102 err := res.UnmarshalGQL(v) 103 return res, graphql.ErrorOnPath(ctx, err) 104 } 105 106 func (ec *executionContext) marshalNEmail2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEmail(ctx context.Context, sel ast.SelectionSet, v Email) graphql.Marshaler { 107 return v 108 } 109 110 func (ec *executionContext) unmarshalNNestedInput2ᚖgithubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐNestedInput(ctx context.Context, v interface{}) (*NestedInput, error) { 111 res, err := ec.unmarshalInputNestedInput(ctx, v) 112 return &res, graphql.ErrorOnPath(ctx, err) 113 } 114 115 func (ec *executionContext) unmarshalNSpecialInput2githubᚗcomᚋgenevaᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐSpecialInput(ctx context.Context, v interface{}) (SpecialInput, error) { 116 res, err := ec.unmarshalInputSpecialInput(ctx, v) 117 return res, graphql.ErrorOnPath(ctx, err) 118 } 119 120 // endregion ***************************** type.gotpl *****************************