1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 | var NodeKeys = {
|
13 | Argument: ['value'],
|
14 | Condition: ['condition', 'selections'],
|
15 | Defer: ['selections', 'if'],
|
16 | Directive: ['args'],
|
17 | Fragment: ['argumentDefinitions', 'directives', 'selections'],
|
18 | FragmentSpread: ['args', 'directives'],
|
19 | InlineFragment: ['directives', 'selections'],
|
20 | LinkedField: ['args', 'directives', 'selections'],
|
21 | Literal: [],
|
22 | LocalArgumentDefinition: [],
|
23 | MatchField: ['args', 'directives', 'selections'],
|
24 | MatchBranch: ['selections'],
|
25 | Request: ['fragment', 'root'],
|
26 | Root: ['argumentDefinitions', 'directives', 'selections'],
|
27 | RootArgumentDefinition: [],
|
28 | ScalarField: ['args', 'directives'],
|
29 | SplitOperation: ['selections'],
|
30 | Stream: ['selections', 'if', 'initialCount'],
|
31 | Variable: []
|
32 | };
|
33 |
|
34 | function visitIR(root, visitor) {
|
35 | return require("graphql").visit(root, visitor, NodeKeys);
|
36 | }
|
37 |
|
38 | module.exports = {
|
39 | visit: visitIR
|
40 | }; |
\ | No newline at end of file |