File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,26 @@ The GraphQL AST structure is very similar to ESTree structure, but there are a f
14
14
15
15
Here's a list of changes that the parser performs, in order to make the GraphQL AST compatible with ESTree:
16
16
17
+ ---
18
+
17
19
** Problem** : GraphQL uses ` kind ` field to define the kind of the AST node, while ESTree uses ` type ` .
18
20
19
21
** Solution** : The parser adds ` type ` field on each node, and just copies the value from ` kind ` field.
20
22
23
+ ---
24
+
21
25
** Problem** : Some GraphQL AST nodes are using ` type ` field (which conflicts with the ESTree kind).
22
26
23
27
** Solution** : AST nodes that has ` type ` field are being transformed, and the ` type ` field changes to ` gqlType ` .
24
28
29
+ ---
30
+
25
31
** Problem** : GraphQL AST structure allows circular JSON links (while ESTree might fail on ` Maximum call stack exceeded ` ).
26
32
27
33
** Solution** : The parser removes circular JSONs (specifically around GraphQL ` Location ` and the ` Lexer ` )
28
34
35
+ ---
36
+
29
37
** Problem** : GraphQL uses ` location ` field to store the AST locations, while ESTree also uses it in a different structure.
30
38
31
39
** Solution** : The parser creates a new ` location ` field that is compatible with ESTree, and renames the GraphQL ` location ` to ` gqlLocation ` .
You can’t perform that action at this time.
0 commit comments