File tree Expand file tree Collapse file tree
test/groovy/graphql/parser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ operationDefinition:
1616selectionSet |
1717operationType NAME ? variableDefinitions? directives? selectionSet;
1818
19- operationType : ' query ' | ' mutation ' ;
19+ operationType : NAME ;
2020
2121variableDefinitions : ' (' variableDefinition+ ' )' ;
2222
Original file line number Diff line number Diff line change @@ -373,4 +373,17 @@ class ParserTest extends Specification {
373373
374374 }
375375
376+ def " `'query'` can be used as field name" () {
377+ given :
378+ def input = " { query }"
379+
380+ when :
381+ Document document = new Parser (). parseDocument(input)
382+
383+ then :
384+ document. definitions. size() == 1
385+ document. definitions[0 ] instanceof OperationDefinition
386+ document. definitions[0 ]. operation == OperationDefinition.Operation . QUERY
387+ assertField(document. definitions[0 ] as OperationDefinition , " query" )
388+ }
376389}
You can’t perform that action at this time.
0 commit comments