github.com/99designs/gqlgen@v0.17.45/codegen/testserver/followschema/enum.generated.go (about) 1 // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. 2 3 package followschema 4 5 import ( 6 "context" 7 8 "github.com/99designs/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) unmarshalInputInputWithEnumValue(ctx context.Context, obj interface{}) (InputWithEnumValue, error) { 31 var it InputWithEnumValue 32 asMap := map[string]interface{}{} 33 for k, v := range obj.(map[string]interface{}) { 34 asMap[k] = v 35 } 36 37 fieldsInOrder := [...]string{"enum"} 38 for _, k := range fieldsInOrder { 39 v, ok := asMap[k] 40 if !ok { 41 continue 42 } 43 switch k { 44 case "enum": 45 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("enum")) 46 data, err := ec.unmarshalNEnumTest2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx, v) 47 if err != nil { 48 return it, err 49 } 50 it.Enum = data 51 } 52 } 53 54 return it, nil 55 } 56 57 // endregion **************************** input.gotpl ***************************** 58 59 // region ************************** interface.gotpl *************************** 60 61 // endregion ************************** interface.gotpl *************************** 62 63 // region **************************** object.gotpl **************************** 64 65 // endregion **************************** object.gotpl **************************** 66 67 // region ***************************** type.gotpl ***************************** 68 69 func (ec *executionContext) unmarshalNEnumTest2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx context.Context, v interface{}) (EnumTest, error) { 70 var res EnumTest 71 err := res.UnmarshalGQL(v) 72 return res, graphql.ErrorOnPath(ctx, err) 73 } 74 75 func (ec *executionContext) marshalNEnumTest2githubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐEnumTest(ctx context.Context, sel ast.SelectionSet, v EnumTest) graphql.Marshaler { 76 return v 77 } 78 79 func (ec *executionContext) unmarshalOInputWithEnumValue2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋcodegenᚋtestserverᚋfollowschemaᚐInputWithEnumValue(ctx context.Context, v interface{}) (*InputWithEnumValue, error) { 80 if v == nil { 81 return nil, nil 82 } 83 res, err := ec.unmarshalInputInputWithEnumValue(ctx, v) 84 return &res, graphql.ErrorOnPath(ctx, err) 85 } 86 87 // endregion ***************************** type.gotpl *****************************