Commit bd86537
authored
fix: accept empty lists for non-null list items (#1600)
## Summary
- Accept empty list defaults for GraphQL list types with non-null items
in operation-level validation.
- Preserve validation of invalid non-empty list elements.
- Add regression coverage for `[]` defaults and invalid enum-list
defaults.
## Links
- **Linear**:
https://linear.app/wundergraph/issue/ENG-9882/string-cannot-represent-value
- **Cosmo issue**: wundergraph/cosmo#3095
## Verification
- `go test ./pkg/astvalidation/reference/testsgo -run
"^TestValuesOfCorrectTypeRule$" -count=1`
- `go test ./...` from `v2`
- Cosmo staged regression and race test passed against this fixed local
module revision.1 parent bbb3db1 commit bd86537
2 files changed
Lines changed: 13 additions & 4 deletions
File tree
- v2/pkg/astvalidation
- reference/testsgo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
1013 | | - | |
| 1013 | + | |
| 1014 | + | |
1014 | 1015 | | |
1015 | 1016 | | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1016 | 1020 | | |
1017 | 1021 | | |
1018 | 1022 | | |
| |||
1059 | 1063 | | |
1060 | 1064 | | |
1061 | 1065 | | |
1062 | | - | |
| 1066 | + | |
| 1067 | + | |
1063 | 1068 | | |
1064 | 1069 | | |
1065 | 1070 | | |
| |||
1076 | 1081 | | |
1077 | 1082 | | |
1078 | 1083 | | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1079 | 1088 | | |
1080 | 1089 | | |
1081 | 1090 | | |
| |||
0 commit comments