-
Notifications
You must be signed in to change notification settings - Fork 167
/
Copy pathast.ast
204 lines (161 loc) · 3.42 KB
/
ast.ast
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# Copyright (c) Facebook, Inc. and its affiliates.
# Mini-language for AST definition.
# All AST nodes extend AstNode.
# All AST nodes are visitible.
# All AST fields have a getter and a setter and are a constructor argument.
# We have concrete types (code T) and unions (code U).
# S for singular field, P for plural, ? for nullable.
# O for option in a union.
# Scalar type ontology: string, boolean
# Definitions other than OperationDefinition and FragmentDefinition
# are experimental additions for schema parsing. (We don't support
# nested unions in the AST mini-language, so I've flattened and elided
# TypeSystemDefinition and TypeDefinition.)
U Definition
O OperationDefinition
O FragmentDefinition
O SchemaDefinition
O ScalarTypeDefinition
O ObjectTypeDefinition
O InterfaceTypeDefinition
O UnionTypeDefinition
O EnumTypeDefinition
O InputObjectTypeDefinition
O TypeExtensionDefinition
O DirectiveDefinition
T Document
P Definition definitions
T OperationDefinition
S OperationKind operation
S? Name name
P? VariableDefinition variableDefinitions
P? Directive directives
S SelectionSet selectionSet
T VariableDefinition
S Variable variable
S Type type
S? Value defaultValue
P? Directive directives
T SelectionSet
P Selection selections
U Selection
O Field
O FragmentSpread
O InlineFragment
T Field
S? Name alias
S Name name
P? Argument arguments
P? Directive directives
S? SelectionSet selectionSet
T Argument
S Name name
S Value value
T FragmentSpread
S Name name
P? Directive directives
T InlineFragment
S? NamedType typeCondition
P? Directive directives
S SelectionSet selectionSet
T FragmentDefinition
S Name name
S NamedType typeCondition
P? Directive directives
S SelectionSet selectionSet
U Value
O Variable
O IntValue
O FloatValue
O StringValue
O BooleanValue
O NullValue
O EnumValue
O ListValue
O ObjectValue
T Variable
S Name name
T IntValue
S string value
T FloatValue
S string value
T StringValue
S string value
T BooleanValue
S boolean value
T NullValue
T EnumValue
S string value
T ListValue
P Value values
T ObjectValue
P ObjectField fields
T ObjectField
S Name name
S Value value
T Directive
S Name name
P? Argument arguments
U Type
O NamedType
O ListType
O NonNullType
T NamedType
S Name name
T ListType
S Type type
T NonNullType
# JS version prohibits nesting nonnull in nonnull, we can't because we
# can't support multiple unions. Fix?
S Type type
T Name
S string value
T SchemaDefinition
P? Directive directives
P OperationTypeDefinition operationTypes
T OperationTypeDefinition
S OperationKind operation
S NamedType type
T ScalarTypeDefinition
S Name name
P? Directive directives
T ObjectTypeDefinition
S Name name
P? NamedType interfaces
P? Directive directives
P FieldDefinition fields
T FieldDefinition
S Name name
P? InputValueDefinition arguments
S Type type
P? Directive directives
T InputValueDefinition
S Name name
S Type type
S? Value defaultValue
P? Directive directives
T InterfaceTypeDefinition
S Name name
P? Directive directives
P FieldDefinition fields
T UnionTypeDefinition
S Name name
P? Directive directives
P NamedType types
T EnumTypeDefinition
S Name name
P? Directive directives
P EnumValueDefinition values
T EnumValueDefinition
S Name name
P? Directive directives
T InputObjectTypeDefinition
S Name name
P? Directive directives
P InputValueDefinition fields
T TypeExtensionDefinition
S ObjectTypeDefinition definition
T DirectiveDefinition
S Name name
P? InputValueDefinition arguments
P Name locations