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