Closed Randonee closed 6 years ago
Using this as input:
query AQuery { title id course_id content { id } unlock_at submissions { id } }
The OperationDefinitionNode in the returned AST will be:
{ directives:[] kind: "OperationDefinition" loc:{start: 5, end: 5, source: "Untitled", startToken: null, endToken: null} name:{ kind: "NamedType" loc: {start: 6, end: 12, source: "Untitled", startToken: null, endToken: null} value: "AQuery" } ... }
It should be:
{ directives:[] kind: "OperationDefinition" loc:{start: 5, end: 5, source: "Untitled", startToken: null, endToken: null} name:{ kind: "Name" value: "AQuery" } ... }
I'm using this as reference: https://github.com/graphql/graphql-js/blob/master/src/language/ast.js
ArgumentNode has the same issue
Fixed by translating parser from graphql-js.
You can verify quickly in the web demo: http://jcward.com/gql2hx/ (note proper kind:"Name")
kind:"Name"
Using this as input:
The OperationDefinitionNode in the returned AST will be:
It should be:
I'm using this as reference: https://github.com/graphql/graphql-js/blob/master/src/language/ast.js