apollo-rs icon indicating copy to clipboard operation
apollo-rs copied to clipboard

No parsing syntax error for variables in constant values

Open gmac opened this issue 1 year ago • 1 comments

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 avatar Jul 14 '23 13:07 gmac