We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1380354 commit 35c6bc2Copy full SHA for 35c6bc2
lib/graphql/language/parser.rb
@@ -566,6 +566,12 @@ def parse_name
566
when :NULL
567
advance_token
568
"null"
569
+ when :ON
570
+ advance_token
571
+ "on"
572
+ when :DIRECTIVE
573
574
+ "directive"
575
else
576
expect_token(:NAME)
577
end
spec/graphql/language/parser_spec.rb
@@ -28,6 +28,10 @@
28
assert GraphQL.parse("{ field(null: false) ... null } fragment null on Query { null }")
29
30
31
+ it "allows fields and arguments named on and directive" do
32
+ assert GraphQL.parse("{ on(on: false) directive(directive: false)}")
33
+ end
34
+
35
it "raises an error when unicode is used as names" do
36
err = assert_raises(GraphQL::ParseError) {
37
GraphQL.parse('query 😘 { a b }')
0 commit comments