...
1
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
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
58
59
60
61
62
63
64
65
66
67
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
88
View as plain text