Commit 5b41269
authored
fix(validator): allow nullable variables for nonnull args with default (#396)
The validation was failing for arguments that are defined as required, but have
a default value, preventing a non-required argument to override their value,
while it should work as expected.
Given the tests are imported from JS, I'm not sure how to add a new one there.
Here's an example schema and query to reproduce this:
```
type Query {
user(username: String! = "foo"): User
}
type User {
username: String!
}
```
```
query Foo($username: String) {
user(username: $username) {
username
}
}
```1 parent fecb70c commit 5b41269
File tree
3 files changed
+11
-3
lines changed- ast
- validator
- core
- rules
3 files changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
0 commit comments