1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Digia\GraphQL\Language\Visitor; |
4
|
|
|
|
5
|
|
|
use Digia\GraphQL\Language\Node\ArgumentNode; |
6
|
|
|
use Digia\GraphQL\Language\Node\BooleanValueNode; |
7
|
|
|
use Digia\GraphQL\Language\Node\DirectiveDefinitionNode; |
8
|
|
|
use Digia\GraphQL\Language\Node\DirectiveNode; |
9
|
|
|
use Digia\GraphQL\Language\Node\DocumentNode; |
10
|
|
|
use Digia\GraphQL\Language\Node\EnumTypeDefinitionNode; |
11
|
|
|
use Digia\GraphQL\Language\Node\EnumTypeExtensionNode; |
12
|
|
|
use Digia\GraphQL\Language\Node\EnumValueDefinitionNode; |
13
|
|
|
use Digia\GraphQL\Language\Node\EnumValueNode; |
14
|
|
|
use Digia\GraphQL\Language\Node\FieldDefinitionNode; |
15
|
|
|
use Digia\GraphQL\Language\Node\FieldNode; |
16
|
|
|
use Digia\GraphQL\Language\Node\FloatValueNode; |
17
|
|
|
use Digia\GraphQL\Language\Node\FragmentDefinitionNode; |
18
|
|
|
use Digia\GraphQL\Language\Node\FragmentSpreadNode; |
19
|
|
|
use Digia\GraphQL\Language\Node\InlineFragmentNode; |
20
|
|
|
use Digia\GraphQL\Language\Node\InputObjectTypeDefinitionNode; |
21
|
|
|
use Digia\GraphQL\Language\Node\InputObjectTypeExtensionNode; |
22
|
|
|
use Digia\GraphQL\Language\Node\InputValueDefinitionNode; |
23
|
|
|
use Digia\GraphQL\Language\Node\IntValueNode; |
24
|
|
|
use Digia\GraphQL\Language\Node\ListTypeNode; |
25
|
|
|
use Digia\GraphQL\Language\Node\ListValueNode; |
26
|
|
|
use Digia\GraphQL\Language\Node\NamedTypeNode; |
27
|
|
|
use Digia\GraphQL\Language\Node\NameNode; |
28
|
|
|
use Digia\GraphQL\Language\Node\NodeInterface; |
29
|
|
|
use Digia\GraphQL\Language\Node\NonNullTypeNode; |
30
|
|
|
use Digia\GraphQL\Language\Node\NullValueNode; |
31
|
|
|
use Digia\GraphQL\Language\Node\ObjectFieldNode; |
32
|
|
|
use Digia\GraphQL\Language\Node\ObjectTypeDefinitionNode; |
33
|
|
|
use Digia\GraphQL\Language\Node\ObjectTypeExtensionNode; |
34
|
|
|
use Digia\GraphQL\Language\Node\ObjectValueNode; |
35
|
|
|
use Digia\GraphQL\Language\Node\OperationTypeDefinitionNode; |
36
|
|
|
use Digia\GraphQL\Language\Node\ScalarTypeDefinitionNode; |
37
|
|
|
use Digia\GraphQL\Language\Node\ScalarTypeExtensionNode; |
38
|
|
|
use Digia\GraphQL\Language\Node\SchemaDefinitionNode; |
39
|
|
|
use Digia\GraphQL\Language\Node\SelectionSetNode; |
40
|
|
|
use Digia\GraphQL\Language\Node\StringValueNode; |
41
|
|
|
use Digia\GraphQL\Language\Node\UnionTypeDefinitionNode; |
42
|
|
|
use Digia\GraphQL\Language\Node\UnionTypeExtensionNode; |
43
|
|
|
use Digia\GraphQL\Language\Node\VariableDefinitionNode; |
44
|
|
|
use Digia\GraphQL\Language\Node\VariableNode; |
45
|
|
|
|
46
|
|
|
class SpecificKindVisitor implements VisitorInterface |
47
|
|
|
{ |
48
|
|
|
/** |
49
|
|
|
* @inheritdoc |
50
|
|
|
*/ |
51
|
|
|
public function enterNode(NodeInterface $node): ?NodeInterface |
52
|
|
|
{ |
53
|
|
|
$enterMethod = 'enter' . $node->getKind(); |
54
|
|
|
return $this->{$enterMethod}($node); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @inheritdoc |
59
|
|
|
*/ |
60
|
|
|
public function leaveNode(NodeInterface $node): ?NodeInterface |
61
|
|
|
{ |
62
|
|
|
$leaveMethod = 'leave' . $node->getKind(); |
63
|
|
|
return $this->{$leaveMethod}($node); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @param ArgumentNode $node |
68
|
|
|
* @return ArgumentNode|null |
69
|
|
|
*/ |
70
|
|
|
protected function enterArgument(ArgumentNode $node): ?ArgumentNode |
71
|
|
|
{ |
72
|
|
|
return $node; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @param ArgumentNode $node |
77
|
|
|
* @return ArgumentNode|null |
78
|
|
|
*/ |
79
|
|
|
protected function leaveArgument(ArgumentNode $node): ?ArgumentNode |
80
|
|
|
{ |
81
|
|
|
return $node; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param BooleanValueNode $node |
86
|
|
|
* @return BooleanValueNode|null |
87
|
|
|
*/ |
88
|
|
|
protected function enterBooleanValue(BooleanValueNode $node): ?BooleanValueNode |
89
|
|
|
{ |
90
|
|
|
return $node; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @param BooleanValueNode $node |
95
|
|
|
* @return BooleanValueNode|null |
96
|
|
|
*/ |
97
|
|
|
protected function leaveBooleanValue(BooleanValueNode $node): ?BooleanValueNode |
98
|
|
|
{ |
99
|
|
|
return $node; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param DirectiveDefinitionNode $node |
104
|
|
|
* @return DirectiveDefinitionNode|null |
105
|
|
|
*/ |
106
|
|
|
protected function enterDirectiveDefinition(DirectiveDefinitionNode $node): ?DirectiveDefinitionNode |
107
|
|
|
{ |
108
|
|
|
return $node; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @param DirectiveDefinitionNode $node |
113
|
|
|
* @return DirectiveDefinitionNode|null |
114
|
|
|
*/ |
115
|
|
|
protected function leaveDirectiveDefinition(DirectiveDefinitionNode $node): ?DirectiveDefinitionNode |
116
|
|
|
{ |
117
|
|
|
return $node; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @param DirectiveNode $node |
122
|
|
|
* @return DirectiveNode|null |
123
|
|
|
*/ |
124
|
|
|
protected function enterDirective(DirectiveNode $node): ?DirectiveNode |
125
|
|
|
{ |
126
|
|
|
return $node; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @param DirectiveNode $node |
131
|
|
|
* @return DirectiveNode|null |
132
|
|
|
*/ |
133
|
|
|
protected function leaveDirective(DirectiveNode $node): ?DirectiveNode |
134
|
|
|
{ |
135
|
|
|
return $node; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @param DocumentNode $node |
140
|
|
|
* @return DocumentNode|null |
141
|
|
|
*/ |
142
|
|
|
protected function enterDocument(DocumentNode $node): ?DocumentNode |
143
|
|
|
{ |
144
|
|
|
return $node; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @param DocumentNode $node |
149
|
|
|
* @return DocumentNode|null |
150
|
|
|
*/ |
151
|
|
|
protected function leaveDocument(DocumentNode $node): ?DocumentNode |
152
|
|
|
{ |
153
|
|
|
return $node; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @param EnumTypeDefinitionNode $node |
158
|
|
|
* @return EnumTypeDefinitionNode|null |
159
|
|
|
*/ |
160
|
|
|
protected function enterEnumTypeDefinition(EnumTypeDefinitionNode $node): ?EnumTypeDefinitionNode |
161
|
|
|
{ |
162
|
|
|
return $node; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @param EnumTypeDefinitionNode $node |
167
|
|
|
* @return EnumTypeDefinitionNode|null |
168
|
|
|
*/ |
169
|
|
|
protected function leaveEnumTypeDefinition(EnumTypeDefinitionNode $node): ?EnumTypeDefinitionNode |
170
|
|
|
{ |
171
|
|
|
return $node; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @param EnumTypeExtensionNode $node |
176
|
|
|
* @return EnumTypeExtensionNode|null |
177
|
|
|
*/ |
178
|
|
|
protected function enterEnumTypeExtension(EnumTypeExtensionNode $node): ?EnumTypeExtensionNode |
179
|
|
|
{ |
180
|
|
|
return $node; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @param EnumTypeExtensionNode $node |
185
|
|
|
* @return EnumTypeExtensionNode|null |
186
|
|
|
*/ |
187
|
|
|
protected function leaveEnumTypeExtension(EnumTypeExtensionNode $node): ?EnumTypeExtensionNode |
188
|
|
|
{ |
189
|
|
|
return $node; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @param EnumValueDefinitionNode $node |
194
|
|
|
* @return EnumValueDefinitionNode|null |
195
|
|
|
*/ |
196
|
|
|
protected function enterEnumValueDefinition(EnumValueDefinitionNode $node): ?EnumValueDefinitionNode |
197
|
|
|
{ |
198
|
|
|
return $node; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* @param EnumValueDefinitionNode $node |
203
|
|
|
* @return EnumValueDefinitionNode|null |
204
|
|
|
*/ |
205
|
|
|
protected function leaveEnumValueDefinition(EnumValueDefinitionNode $node): ?EnumValueDefinitionNode |
206
|
|
|
{ |
207
|
|
|
return $node; |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* @param EnumValueNode $node |
212
|
|
|
* @return EnumValueNode|null |
213
|
|
|
*/ |
214
|
|
|
protected function enterEnumValue(EnumValueNode $node): ?EnumValueNode |
215
|
|
|
{ |
216
|
|
|
return $node; |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* @param EnumValueNode $node |
221
|
|
|
* @return EnumValueNode|null |
222
|
|
|
*/ |
223
|
|
|
protected function leaveEnumValue(EnumValueNode $node): ?EnumValueNode |
224
|
|
|
{ |
225
|
|
|
return $node; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* @param FieldDefinitionNode $node |
230
|
|
|
* @return FieldDefinitionNode|null |
231
|
|
|
*/ |
232
|
|
|
protected function enterFieldDefinition(FieldDefinitionNode $node): ?FieldDefinitionNode |
233
|
|
|
{ |
234
|
|
|
return $node; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* @param FieldDefinitionNode $node |
239
|
|
|
* @return FieldDefinitionNode|null |
240
|
|
|
*/ |
241
|
|
|
protected function leaveFieldDefinition(FieldDefinitionNode $node): ?FieldDefinitionNode |
242
|
|
|
{ |
243
|
|
|
return $node; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @param FieldNode $node |
248
|
|
|
* @return FieldNode|null |
249
|
|
|
*/ |
250
|
|
|
protected function enterField(FieldNode $node): ?FieldNode |
251
|
|
|
{ |
252
|
|
|
return $node; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* @param FieldNode $node |
257
|
|
|
* @return FieldNode|null |
258
|
|
|
*/ |
259
|
|
|
protected function leaveField(FieldNode $node): ?FieldNode |
260
|
|
|
{ |
261
|
|
|
return $node; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @param FloatValueNode $node |
266
|
|
|
* @return FloatValueNode|null |
267
|
|
|
*/ |
268
|
|
|
protected function enterFloatValue(FloatValueNode $node): ?FloatValueNode |
269
|
|
|
{ |
270
|
|
|
return $node; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* @param FloatValueNode $node |
275
|
|
|
* @return FloatValueNode|null |
276
|
|
|
*/ |
277
|
|
|
protected function leaveFloatValue(FloatValueNode $node): ?FloatValueNode |
278
|
|
|
{ |
279
|
|
|
return $node; |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
/** |
283
|
|
|
* @param FragmentDefinitionNode $node |
284
|
|
|
* @return FragmentDefinitionNode|null |
285
|
|
|
*/ |
286
|
|
|
protected function enterFragmentDefinition(FragmentDefinitionNode $node): ?FragmentDefinitionNode |
287
|
|
|
{ |
288
|
|
|
return $node; |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
/** |
292
|
|
|
* @param FragmentDefinitionNode $node |
293
|
|
|
* @return FragmentDefinitionNode|null |
294
|
|
|
*/ |
295
|
|
|
protected function leaveFragmentDefinition(FragmentDefinitionNode $node): ?FragmentDefinitionNode |
296
|
|
|
{ |
297
|
|
|
return $node; |
298
|
|
|
} |
299
|
|
|
|
300
|
|
|
/** |
301
|
|
|
* @param FragmentSpreadNode $node |
302
|
|
|
* @return FragmentSpreadNode|null |
303
|
|
|
*/ |
304
|
|
|
protected function enterFragmentSpread(FragmentSpreadNode $node): ?FragmentSpreadNode |
305
|
|
|
{ |
306
|
|
|
return $node; |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* @param FragmentSpreadNode $node |
311
|
|
|
* @return FragmentSpreadNode|null |
312
|
|
|
*/ |
313
|
|
|
protected function leaveFragmentSpread(FragmentSpreadNode $node): ?FragmentSpreadNode |
314
|
|
|
{ |
315
|
|
|
return $node; |
316
|
|
|
} |
317
|
|
|
|
318
|
|
|
/** |
319
|
|
|
* @param InlineFragmentNode $node |
320
|
|
|
* @return InlineFragmentNode|null |
321
|
|
|
*/ |
322
|
|
|
protected function enterInlineFragment(InlineFragmentNode $node): ?InlineFragmentNode |
323
|
|
|
{ |
324
|
|
|
return $node; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* @param InlineFragmentNode $node |
329
|
|
|
* @return InlineFragmentNode|null |
330
|
|
|
*/ |
331
|
|
|
protected function leaveInlineFragment(InlineFragmentNode $node): ?InlineFragmentNode |
332
|
|
|
{ |
333
|
|
|
return $node; |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* @param InputObjectTypeDefinitionNode $node |
338
|
|
|
* @return InputObjectTypeDefinitionNode|null |
339
|
|
|
*/ |
340
|
|
|
protected function enterInputObjectTypeDefinition(InputObjectTypeDefinitionNode $node |
341
|
|
|
): ?InputObjectTypeDefinitionNode { |
342
|
|
|
return $node; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* @param InputObjectTypeDefinitionNode $node |
347
|
|
|
* @return InputObjectTypeDefinitionNode|null |
348
|
|
|
*/ |
349
|
|
|
protected function leaveInputObjectTypeDefinition(InputObjectTypeDefinitionNode $node |
350
|
|
|
): ?InputObjectTypeDefinitionNode { |
351
|
|
|
return $node; |
352
|
|
|
} |
353
|
|
|
|
354
|
|
|
/** |
355
|
|
|
* @param InputObjectTypeExtensionNode $node |
356
|
|
|
* @return InputObjectTypeExtensionNode|null |
357
|
|
|
*/ |
358
|
|
|
protected function enterInputObjectTypeExtension(InputObjectTypeExtensionNode $node): ?InputObjectTypeExtensionNode |
359
|
|
|
{ |
360
|
|
|
return $node; |
361
|
|
|
} |
362
|
|
|
|
363
|
|
|
/** |
364
|
|
|
* @param InputObjectTypeExtensionNode $node |
365
|
|
|
* @return InputObjectTypeExtensionNode|null |
366
|
|
|
*/ |
367
|
|
|
protected function leaveInputObjectTypeExtension(InputObjectTypeExtensionNode $node): ?InputObjectTypeExtensionNode |
368
|
|
|
{ |
369
|
|
|
return $node; |
370
|
|
|
} |
371
|
|
|
|
372
|
|
|
/** |
373
|
|
|
* @param InputValueDefinitionNode $node |
374
|
|
|
* @return InputValueDefinitionNode|null |
375
|
|
|
*/ |
376
|
|
|
protected function enterInputValueDefinition(InputValueDefinitionNode $node): ?InputValueDefinitionNode |
377
|
|
|
{ |
378
|
|
|
return $node; |
379
|
|
|
} |
380
|
|
|
|
381
|
|
|
/** |
382
|
|
|
* @param InputValueDefinitionNode $node |
383
|
|
|
* @return InputValueDefinitionNode|null |
384
|
|
|
*/ |
385
|
|
|
protected function leaveInputValueDefinition(InputValueDefinitionNode $node): ?InputValueDefinitionNode |
386
|
|
|
{ |
387
|
|
|
return $node; |
388
|
|
|
} |
389
|
|
|
|
390
|
|
|
/** |
391
|
|
|
* @param IntValueNode $node |
392
|
|
|
* @return IntValueNode|null |
393
|
|
|
*/ |
394
|
|
|
protected function enterIntValue(IntValueNode $node): ?IntValueNode |
395
|
|
|
{ |
396
|
|
|
return $node; |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
/** |
400
|
|
|
* @param IntValueNode $node |
401
|
|
|
* @return IntValueNode|null |
402
|
|
|
*/ |
403
|
|
|
protected function leaveIntValue(IntValueNode $node): ?IntValueNode |
404
|
|
|
{ |
405
|
|
|
return $node; |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
/** |
409
|
|
|
* @param ListTypeNode $node |
410
|
|
|
* @return ListTypeNode|null |
411
|
|
|
*/ |
412
|
|
|
protected function enterListType(ListTypeNode $node): ?ListTypeNode |
413
|
|
|
{ |
414
|
|
|
return $node; |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
/** |
418
|
|
|
* @param ListTypeNode $node |
419
|
|
|
* @return ListTypeNode|null |
420
|
|
|
*/ |
421
|
|
|
protected function leaveListType(ListTypeNode $node): ?ListTypeNode |
422
|
|
|
{ |
423
|
|
|
return $node; |
424
|
|
|
} |
425
|
|
|
|
426
|
|
|
/** |
427
|
|
|
* @param ListValueNode $node |
428
|
|
|
* @return ListValueNode|null |
429
|
|
|
*/ |
430
|
|
|
protected function enterListValue(ListValueNode $node): ?ListValueNode |
431
|
|
|
{ |
432
|
|
|
return $node; |
433
|
|
|
} |
434
|
|
|
|
435
|
|
|
/** |
436
|
|
|
* @param ListValueNode $node |
437
|
|
|
* @return ListValueNode|null |
438
|
|
|
*/ |
439
|
|
|
protected function leaveListValue(ListValueNode $node): ?ListValueNode |
440
|
|
|
{ |
441
|
|
|
return $node; |
442
|
|
|
} |
443
|
|
|
|
444
|
|
|
/** |
445
|
|
|
* @param NamedTypeNode $node |
446
|
|
|
* @return NamedTypeNode|null |
447
|
|
|
*/ |
448
|
|
|
protected function enterNamedType(NamedTypeNode $node): ?NamedTypeNode |
449
|
|
|
{ |
450
|
|
|
return $node; |
451
|
|
|
} |
452
|
|
|
|
453
|
|
|
/** |
454
|
|
|
* @param NamedTypeNode $node |
455
|
|
|
* @return NamedTypeNode|null |
456
|
|
|
*/ |
457
|
|
|
protected function leaveNamedType(NamedTypeNode $node): ?NamedTypeNode |
458
|
|
|
{ |
459
|
|
|
return $node; |
460
|
|
|
} |
461
|
|
|
|
462
|
|
|
/** |
463
|
|
|
* @param NameNode $node |
464
|
|
|
* @return NameNode|null |
465
|
|
|
*/ |
466
|
|
|
protected function enterName(NameNode $node): ?NameNode |
467
|
|
|
{ |
468
|
|
|
return $node; |
469
|
|
|
} |
470
|
|
|
|
471
|
|
|
/** |
472
|
|
|
* @param NameNode $node |
473
|
|
|
* @return NameNode|null |
474
|
|
|
*/ |
475
|
|
|
protected function leaveName(NameNode $node): ?NameNode |
476
|
|
|
{ |
477
|
|
|
return $node; |
478
|
|
|
} |
479
|
|
|
|
480
|
|
|
/** |
481
|
|
|
* @param NonNullTypeNode $node |
482
|
|
|
* @return NonNullTypeNode|null |
483
|
|
|
*/ |
484
|
|
|
protected function enterNonNullType(NonNullTypeNode $node): ?NonNullTypeNode |
485
|
|
|
{ |
486
|
|
|
return $node; |
487
|
|
|
} |
488
|
|
|
|
489
|
|
|
/** |
490
|
|
|
* @param NonNullTypeNode $node |
491
|
|
|
* @return NonNullTypeNode|null |
492
|
|
|
*/ |
493
|
|
|
protected function leaveNonNullType(NonNullTypeNode $node): ?NonNullTypeNode |
494
|
|
|
{ |
495
|
|
|
return $node; |
496
|
|
|
} |
497
|
|
|
|
498
|
|
|
/** |
499
|
|
|
* @param NullValueNode $node |
500
|
|
|
* @return NullValueNode|null |
501
|
|
|
*/ |
502
|
|
|
protected function enterNullValue(NullValueNode $node): ?NullValueNode |
503
|
|
|
{ |
504
|
|
|
return $node; |
505
|
|
|
} |
506
|
|
|
|
507
|
|
|
/** |
508
|
|
|
* @param NullValueNode $node |
509
|
|
|
* @return NullValueNode|null |
510
|
|
|
*/ |
511
|
|
|
protected function leaveNullValue(NullValueNode $node): ?NullValueNode |
512
|
|
|
{ |
513
|
|
|
return $node; |
514
|
|
|
} |
515
|
|
|
|
516
|
|
|
/** |
517
|
|
|
* @param ObjectFieldNode $node |
518
|
|
|
* @return ObjectFieldNode|null |
519
|
|
|
*/ |
520
|
|
|
protected function enterObjectField(ObjectFieldNode $node): ?ObjectFieldNode |
521
|
|
|
{ |
522
|
|
|
return $node; |
523
|
|
|
} |
524
|
|
|
|
525
|
|
|
/** |
526
|
|
|
* @param ObjectFieldNode $node |
527
|
|
|
* @return ObjectFieldNode|null |
528
|
|
|
*/ |
529
|
|
|
protected function leaveObjectField(ObjectFieldNode $node): ?ObjectFieldNode |
530
|
|
|
{ |
531
|
|
|
return $node; |
532
|
|
|
} |
533
|
|
|
|
534
|
|
|
/** |
535
|
|
|
* @param ObjectTypeDefinitionNode $node |
536
|
|
|
* @return ObjectTypeDefinitionNode|null |
537
|
|
|
*/ |
538
|
|
|
protected function enterObjectTypeDefinition(ObjectTypeDefinitionNode $node): ?ObjectTypeDefinitionNode |
539
|
|
|
{ |
540
|
|
|
return $node; |
541
|
|
|
} |
542
|
|
|
|
543
|
|
|
/** |
544
|
|
|
* @param ObjectTypeDefinitionNode $node |
545
|
|
|
* @return ObjectTypeDefinitionNode|null |
546
|
|
|
*/ |
547
|
|
|
protected function leaveObjectTypeDefinition(ObjectTypeDefinitionNode $node): ?ObjectTypeDefinitionNode |
548
|
|
|
{ |
549
|
|
|
return $node; |
550
|
|
|
} |
551
|
|
|
|
552
|
|
|
/** |
553
|
|
|
* @param ObjectTypeExtensionNode $node |
554
|
|
|
* @return ObjectTypeExtensionNode|null |
555
|
|
|
*/ |
556
|
|
|
protected function enterObjectTypeExtension(ObjectTypeExtensionNode $node): ?ObjectTypeExtensionNode |
557
|
|
|
{ |
558
|
|
|
return $node; |
559
|
|
|
} |
560
|
|
|
|
561
|
|
|
/** |
562
|
|
|
* @param ObjectTypeExtensionNode $node |
563
|
|
|
* @return ObjectTypeExtensionNode|null |
564
|
|
|
*/ |
565
|
|
|
protected function leaveObjectTypeExtension(ObjectTypeExtensionNode $node): ?ObjectTypeExtensionNode |
566
|
|
|
{ |
567
|
|
|
return $node; |
568
|
|
|
} |
569
|
|
|
|
570
|
|
|
/** |
571
|
|
|
* @param ObjectValueNode $node |
572
|
|
|
* @return ObjectValueNode|null |
573
|
|
|
*/ |
574
|
|
|
protected function enterObjectValue(ObjectValueNode $node): ?ObjectValueNode |
575
|
|
|
{ |
576
|
|
|
return $node; |
577
|
|
|
} |
578
|
|
|
|
579
|
|
|
/** |
580
|
|
|
* @param ObjectValueNode $node |
581
|
|
|
* @return ObjectValueNode|null |
582
|
|
|
*/ |
583
|
|
|
protected function leaveObjectValue(ObjectValueNode $node): ?ObjectValueNode |
584
|
|
|
{ |
585
|
|
|
return $node; |
586
|
|
|
} |
587
|
|
|
|
588
|
|
|
/** |
589
|
|
|
* @param OperationTypeDefinitionNode $node |
590
|
|
|
* @return OperationTypeDefinitionNode|null |
591
|
|
|
*/ |
592
|
|
|
protected function enterOperationTypeDefinition(OperationTypeDefinitionNode $node): ?OperationTypeDefinitionNode |
593
|
|
|
{ |
594
|
|
|
return $node; |
595
|
|
|
} |
596
|
|
|
|
597
|
|
|
/** |
598
|
|
|
* @param OperationTypeDefinitionNode $node |
599
|
|
|
* @return OperationTypeDefinitionNode|null |
600
|
|
|
*/ |
601
|
|
|
protected function leaveOperationTypeDefinition(OperationTypeDefinitionNode $node): ?OperationTypeDefinitionNode |
602
|
|
|
{ |
603
|
|
|
return $node; |
604
|
|
|
} |
605
|
|
|
|
606
|
|
|
/** |
607
|
|
|
* @param ScalarTypeDefinitionNode $node |
608
|
|
|
* @return ScalarTypeDefinitionNode|null |
609
|
|
|
*/ |
610
|
|
|
protected function enterScalarTypeDefinition(ScalarTypeDefinitionNode $node): ?ScalarTypeDefinitionNode |
611
|
|
|
{ |
612
|
|
|
return $node; |
613
|
|
|
} |
614
|
|
|
|
615
|
|
|
/** |
616
|
|
|
* @param ScalarTypeDefinitionNode $node |
617
|
|
|
* @return ScalarTypeDefinitionNode|null |
618
|
|
|
*/ |
619
|
|
|
protected function leaveScalarTypeDefinition(ScalarTypeDefinitionNode $node): ?ScalarTypeDefinitionNode |
620
|
|
|
{ |
621
|
|
|
return $node; |
622
|
|
|
} |
623
|
|
|
|
624
|
|
|
/** |
625
|
|
|
* @param ScalarTypeExtensionNode $node |
626
|
|
|
* @return ScalarTypeExtensionNode|null |
627
|
|
|
*/ |
628
|
|
|
protected function enterScalarTypeExtension(ScalarTypeExtensionNode $node): ?ScalarTypeExtensionNode |
629
|
|
|
{ |
630
|
|
|
return $node; |
631
|
|
|
} |
632
|
|
|
|
633
|
|
|
/** |
634
|
|
|
* @param ScalarTypeExtensionNode $node |
635
|
|
|
* @return ScalarTypeExtensionNode|null |
636
|
|
|
*/ |
637
|
|
|
protected function leaveScalarTypeExtension(ScalarTypeExtensionNode $node): ?ScalarTypeExtensionNode |
638
|
|
|
{ |
639
|
|
|
return $node; |
640
|
|
|
} |
641
|
|
|
|
642
|
|
|
/** |
643
|
|
|
* @param SchemaDefinitionNode $node |
644
|
|
|
* @return SchemaDefinitionNode|null |
645
|
|
|
*/ |
646
|
|
|
protected function enterSchemaDefinition(SchemaDefinitionNode $node): ?SchemaDefinitionNode |
647
|
|
|
{ |
648
|
|
|
return $node; |
649
|
|
|
} |
650
|
|
|
|
651
|
|
|
/** |
652
|
|
|
* @param SchemaDefinitionNode $node |
653
|
|
|
* @return SchemaDefinitionNode|null |
654
|
|
|
*/ |
655
|
|
|
protected function leaveSchemaDefinition(SchemaDefinitionNode $node): ?SchemaDefinitionNode |
656
|
|
|
{ |
657
|
|
|
return $node; |
658
|
|
|
} |
659
|
|
|
|
660
|
|
|
/** |
661
|
|
|
* @param SelectionSetNode $node |
662
|
|
|
* @return SelectionSetNode|null |
663
|
|
|
*/ |
664
|
|
|
protected function enterSelectionSet(SelectionSetNode $node): ?SelectionSetNode |
665
|
|
|
{ |
666
|
|
|
return $node; |
667
|
|
|
} |
668
|
|
|
|
669
|
|
|
/** |
670
|
|
|
* @param SelectionSetNode $node |
671
|
|
|
* @return SelectionSetNode|null |
672
|
|
|
*/ |
673
|
|
|
protected function leaveSelectionSet(SelectionSetNode $node): ?SelectionSetNode |
674
|
|
|
{ |
675
|
|
|
return $node; |
676
|
|
|
} |
677
|
|
|
|
678
|
|
|
/** |
679
|
|
|
* @param StringValueNode $node |
680
|
|
|
* @return StringValueNode|null |
681
|
|
|
*/ |
682
|
|
|
protected function enterStringValue(StringValueNode $node): ?StringValueNode |
683
|
|
|
{ |
684
|
|
|
return $node; |
685
|
|
|
} |
686
|
|
|
|
687
|
|
|
/** |
688
|
|
|
* @param StringValueNode $node |
689
|
|
|
* @return StringValueNode|null |
690
|
|
|
*/ |
691
|
|
|
protected function leaveStringValue(StringValueNode $node): ?StringValueNode |
692
|
|
|
{ |
693
|
|
|
return $node; |
694
|
|
|
} |
695
|
|
|
|
696
|
|
|
/** |
697
|
|
|
* @param UnionTypeDefinitionNode $node |
698
|
|
|
* @return UnionTypeDefinitionNode|null |
699
|
|
|
*/ |
700
|
|
|
protected function enterUnionTypeDefinition(UnionTypeDefinitionNode $node): ?UnionTypeDefinitionNode |
701
|
|
|
{ |
702
|
|
|
return $node; |
703
|
|
|
} |
704
|
|
|
|
705
|
|
|
/** |
706
|
|
|
* @param UnionTypeDefinitionNode $node |
707
|
|
|
* @return UnionTypeDefinitionNode|null |
708
|
|
|
*/ |
709
|
|
|
protected function leaveUnionTypeDefinition(UnionTypeDefinitionNode $node): ?UnionTypeDefinitionNode |
710
|
|
|
{ |
711
|
|
|
return $node; |
712
|
|
|
} |
713
|
|
|
|
714
|
|
|
/** |
715
|
|
|
* @param UnionTypeExtensionNode $node |
716
|
|
|
* @return UnionTypeExtensionNode|null |
717
|
|
|
*/ |
718
|
|
|
protected function enterUnionTypeExtension(UnionTypeExtensionNode $node): ?UnionTypeExtensionNode |
719
|
|
|
{ |
720
|
|
|
return $node; |
721
|
|
|
} |
722
|
|
|
|
723
|
|
|
/** |
724
|
|
|
* @param UnionTypeExtensionNode $node |
725
|
|
|
* @return UnionTypeExtensionNode|null |
726
|
|
|
*/ |
727
|
|
|
protected function leaveUnionTypeExtension(UnionTypeExtensionNode $node): ?UnionTypeExtensionNode |
728
|
|
|
{ |
729
|
|
|
return $node; |
730
|
|
|
} |
731
|
|
|
|
732
|
|
|
/** |
733
|
|
|
* @param VariableDefinitionNode $node |
734
|
|
|
* @return VariableDefinitionNode|null |
735
|
|
|
*/ |
736
|
|
|
protected function enterVariableDefinition(VariableDefinitionNode $node): ?VariableDefinitionNode |
737
|
|
|
{ |
738
|
|
|
return $node; |
739
|
|
|
} |
740
|
|
|
|
741
|
|
|
/** |
742
|
|
|
* @param VariableDefinitionNode $node |
743
|
|
|
* @return VariableDefinitionNode|null |
744
|
|
|
*/ |
745
|
|
|
protected function leaveVariableDefinition(VariableDefinitionNode $node): ?VariableDefinitionNode |
746
|
|
|
{ |
747
|
|
|
return $node; |
748
|
|
|
} |
749
|
|
|
|
750
|
|
|
/** |
751
|
|
|
* @param VariableNode $node |
752
|
|
|
* @return VariableNode|null |
753
|
|
|
*/ |
754
|
|
|
protected function enterVariable(VariableNode $node): ?VariableNode |
755
|
|
|
{ |
756
|
|
|
return $node; |
757
|
|
|
} |
758
|
|
|
|
759
|
|
|
/** |
760
|
|
|
* @param VariableNode $node |
761
|
|
|
* @return VariableNode|null |
762
|
|
|
*/ |
763
|
|
|
protected function leaveVariable(VariableNode $node): ?VariableNode |
764
|
|
|
{ |
765
|
|
|
return $node; |
766
|
|
|
} |
767
|
|
|
} |
768
|
|
|
|