Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse errors in SDL field definitions when using keywords as field names #1523

Closed
jimkyndemeyer opened this issue May 6, 2019 · 1 comment · Fixed by #1599
Closed

Parse errors in SDL field definitions when using keywords as field names #1523

jimkyndemeyer opened this issue May 6, 2019 · 1 comment · Fixed by #1599

Comments

@jimkyndemeyer
Copy link
Contributor

Describe the bug
Given the following SDL:

type Foo {
  true: String
  false: String
  on: String
  null: String
}

The parser throws a parse error even though these names are allowed as field names in the GraphQL grammar: https://graphql.github.io/graphql-spec/June2018/#FieldDefinition

I see there's already an attempt at handling this for other keywords in

name: NAME | FRAGMENT | QUERY | MUTATION | SUBSCRIPTION | SCHEMA | SCALAR | TYPE | INTERFACE | IMPLEMENTS | ENUM | UNION | INPUT | EXTEND | DIRECTIVE;

To Reproduce
New up the GraphQL Parser and parse the example above:

import graphql.parser.Parser;
new Parser().parseDocument(exampleSDLAsString);

Observe that the parser throws errors even though the above is valid according to the grammar.

Related issue: JetBrains/js-graphql-intellij-plugin#239

@andimarek
Copy link
Member

andimarek commented Jul 15, 2019

thanks for reporting: it should be fixed with #1599

jimkyndemeyer added a commit to JetBrains/js-graphql-intellij-plugin that referenced this issue Mar 13, 2020
- Upgraded graphql-java to 14.0 (graphql-java/graphql-java#1523)
- Refactored breaking changes from graphql-java 12.0 to 14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants