-
Notifications
You must be signed in to change notification settings - Fork 124
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
Empty argument lists () should be disallowed #292
Comments
Thank you for noticing this issue! Can you please submit a PR to correct it? |
yuchenshi
added a commit
to yuchenshi/gqlparser
that referenced
this issue
Apr 5, 2024
@StevenACoffman Sure, #293 |
StevenACoffman
pushed a commit
that referenced
this issue
Apr 5, 2024
andaaron
added a commit
to rchincha/zot
that referenced
this issue
Jun 4, 2024
See vektah/gqlparser#292 and vektah/gqlparser#293 Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
andaaron
added a commit
to rchincha/zot
that referenced
this issue
Jun 4, 2024
Fix also some tests See vektah/gqlparser#292 and vektah/gqlparser#293 Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
andaaron
added a commit
to project-zot/zot
that referenced
this issue
Jun 4, 2024
* chore: fix dependabot alerts #2435 #2436 #2437 #2438 #2439 #2440 #2441 #2442 #2443 #2444 #2445 Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com> * fix(zli): _schema query in zli code should not use empty parens Fix also some tests See vektah/gqlparser#292 and vektah/gqlparser#293 Signed-off-by: Andrei Aaron <aaaron@luxoft.com> --------- Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com> Signed-off-by: Andrei Aaron <aaaron@luxoft.com> Co-authored-by: Andrei Aaron <aaaron@luxoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
This document validates in gqlparser.
What did you expect?
There should be a validation error in Line 1 and Line 2 each because in GraphQL, Arguments must contain at least one Argument. In GraphQL spec, the notation
[list]
means one or more -- see spec definitionNote that the entire "Arguments" portion is optional in both contexts, therefore
query GetSomething { ... }
is allowed and so isuser { ... }
, but if the braces()
are present they must contain something.graphql-js reports errors on both cases correctly.
Minimal graphql.schema and models to reproduce
Although I haven't tested this, I suspect
name(): String
will also parse in gqlparser but it should have errored according to the spec. There may be other cases with similar issues but I haven't done a full audit of the spec nor gqlparser.versions
go list -m github.com/vektah/gqlparser/v2
?go version
?The text was updated successfully, but these errors were encountered: