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

No parsing syntax error for variables in constant values #595

Closed
gmac opened this issue Jul 14, 2023 · 2 comments
Closed

No parsing syntax error for variables in constant values #595

gmac opened this issue Jul 14, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@gmac
Copy link

gmac commented Jul 14, 2023

Description

The following should produce a syntax error, as variables cannot be used in constant value positions:

query($id1: ID, $id2: ID = $id1) {
  __typename
}

Apollo Compiler parses the above. By comparison, the graphql-js reference implementation produces the following parse error:

Syntax Error: Unexpected variable "$id1" in constant value.

Steps to reproduce

Try parsing the above query.

Expected result

Expected syntax error.

Actual result

Apollo compiler successfully parses

@gmac gmac added bug Something isn't working triage labels Jul 14, 2023
@lrlna
Copy link
Member

lrlna commented Jul 14, 2023

ah yep, that's a bug! thanks for reporting. I'll look into it next week.

this is a irl use case of issue reported in #538

@lrlna lrlna removed the triage label Jul 14, 2023
@lrlna lrlna self-assigned this Jul 14, 2023
@SimonSapin
Copy link
Contributor

I believe this was fixed in #777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants