-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add regression test for fragment spreads with undefined global variab…
…les as arguments Summary: Don't think we have a similar test for this where we are passing an undefined global variable as an argument to a fragment spread, so added one while working on T160746170 Add regression test for fragment spreads with undefined global variables as arguments Reviewed By: alunyov Differential Revision: D50573429 fbshipit-source-id: b16bb3e2fecb32f1c642f912808e1b81a991bfe5
- Loading branch information
1 parent
8011e22
commit f90edc4
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...lidate_global_variables/fixtures/fragment-spread-with-undefined-argument.invalid.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
==================================== INPUT ==================================== | ||
#expected-to-throw | ||
query QueryWithUndefinedArgument { | ||
node { | ||
...UserFragment @arguments(age: $age) | ||
} | ||
} | ||
|
||
fragment UserFragment on User | ||
@argumentDefinitions(age: {type: "Int", defaultValue: null}) { | ||
name | ||
} | ||
==================================== ERROR ==================================== | ||
✖︎ Expected variable `$age` to be defined on the operation | ||
|
||
fragment-spread-with-undefined-argument.invalid.graphql:4:37 | ||
3 │ node { | ||
4 │ ...UserFragment @arguments(age: $age) | ||
│ ^^^^ | ||
5 │ } |
11 changes: 11 additions & 0 deletions
11
...alidate_global_variables/fixtures/fragment-spread-with-undefined-argument.invalid.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#expected-to-throw | ||
query QueryWithUndefinedArgument { | ||
node { | ||
...UserFragment @arguments(age: $age) | ||
} | ||
} | ||
|
||
fragment UserFragment on User | ||
@argumentDefinitions(age: {type: "Int", defaultValue: null}) { | ||
name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters