forked from wundergraph/graphql-go-tools
/
node_scalar.go
105 lines (83 loc) · 1.88 KB
/
node_scalar.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package resolve
type Scalar struct {
Path []string
Nullable bool
Export *FieldExport `json:"export,omitempty"`
}
func (_ *Scalar) NodeKind() NodeKind {
return NodeKindScalar
}
func (s *Scalar) NodePath() []string {
return s.Path
}
type String struct {
Path []string
Nullable bool
Export *FieldExport `json:"export,omitempty"`
UnescapeResponseJson bool `json:"unescape_response_json,omitempty"`
IsTypeName bool `json:"is_type_name,omitempty"`
}
func (_ *String) NodeKind() NodeKind {
return NodeKindString
}
func (s *String) NodePath() []string {
return s.Path
}
type Boolean struct {
Path []string
Nullable bool
Export *FieldExport `json:"export,omitempty"`
}
func (_ *Boolean) NodeKind() NodeKind {
return NodeKindBoolean
}
func (b *Boolean) NodePath() []string {
return b.Path
}
type Float struct {
Path []string
Nullable bool
Export *FieldExport `json:"export,omitempty"`
}
func (_ *Float) NodeKind() NodeKind {
return NodeKindFloat
}
func (f *Float) NodePath() []string {
return f.Path
}
type Integer struct {
Path []string
Nullable bool
Export *FieldExport `json:"export,omitempty"`
}
func (_ *Integer) NodeKind() NodeKind {
return NodeKindInteger
}
func (i *Integer) NodePath() []string {
return i.Path
}
type BigInt struct {
Path []string
Nullable bool
Export *FieldExport `json:"export,omitempty"`
}
func (_ *BigInt) NodeKind() NodeKind {
return NodeKindBigInt
}
func (b *BigInt) NodePath() []string {
return b.Path
}
type Null struct {
}
func (_ *Null) NodeKind() NodeKind {
return NodeKindNull
}
func (_ *Null) NodePath() []string {
return nil
}
// FieldExport takes the value of the field during evaluation (rendering of the field)
// and stores it in the variables using the Path as JSON pointer.
type FieldExport struct {
Path []string
AsString bool
}