File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 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
1414
1515Here's a list of changes that the parser performs, in order to make the GraphQL AST compatible with ESTree:
1616
17+ ---
18+
1719** Problem** : GraphQL uses ` kind ` field to define the kind of the AST node, while ESTree uses ` type ` .
1820
1921** Solution** : The parser adds ` type ` field on each node, and just copies the value from ` kind ` field.
2022
23+ ---
24+
2125** Problem** : Some GraphQL AST nodes are using ` type ` field (which conflicts with the ESTree kind).
2226
2327** Solution** : AST nodes that has ` type ` field are being transformed, and the ` type ` field changes to ` gqlType ` .
2428
29+ ---
30+
2531** Problem** : GraphQL AST structure allows circular JSON links (while ESTree might fail on ` Maximum call stack exceeded ` ).
2632
2733** Solution** : The parser removes circular JSONs (specifically around GraphQL ` Location ` and the ` Lexer ` )
2834
35+ ---
36+
2937** Problem** : GraphQL uses ` location ` field to store the AST locations, while ESTree also uses it in a different structure.
3038
3139** 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