-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Clear-up disambiguity when using TypeExtension's and query shorthand #539
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
Comments
@budde377 sorry for delay. GraphQL grammar is greedy that means if it will always optional tokens even if they are trailing. As an example take number First character ( Same rule works in your example and it should be always interpretated as a document contaning single interface extension.
AFAIK GraphQL spec never mention that grammar is gready so it would be great if you add something about it into |
Explicitly state that the GraphQL grammar is greedy to clear up possible disambiguity. Closes graphql#539
Explicitly state that the GraphQL grammar is greedy to clear up possible disambiguity. Closes graphql#539
Explicitly state that the GraphQL grammar is greedy to clear up possible disambiguity. Closes graphql#539
Closing this since progress is tracked as #564 |
When implementing a parser from the spec. I had a hard time deciding on the right case when certain
TypeExtension
s are used with the query operation shorthand. Namely theEnumTypeExtension
,InputObjectTypeExtension
,InterfaceTypeExtension
, andObjectTypeExtension
.The issue arises with programs like the following:
this can according to the specification be interpreted as either
InterfaceTypeExtension
with thebar: String
field definition (and a directive),InterfaceTypeExtension
and a shorthand query with the fieldString
aliased asbar
.Notice that the program
is unequivocally a document containing a single
InterfaceTypeExtension
.I would like to get this ambiguity cleared up and would be happy to submit a PR with the right solution.
The text was updated successfully, but these errors were encountered: