-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate enum values in input variables (#4753)
- Loading branch information
Showing
6 changed files
with
118 additions
and
6 deletions.
There are no files selected for viewing
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,5 @@ | ||
### Validate enum values in input variables ([Issue #4633](https://github.com/apollographql/router/issues/4633)) | ||
|
||
The Router will now validate enum values provided in JSON variables. | ||
|
||
By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4753 |
15 changes: 15 additions & 0 deletions
15
...upergraph/snapshots/apollo_router__services__supergraph__tests__invalid_input_enum-2.snap
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,15 @@ | ||
--- | ||
source: apollo-router/src/services/supergraph/tests.rs | ||
expression: response | ||
--- | ||
{ | ||
"errors": [ | ||
{ | ||
"message": "invalid type for variable: 'input'", | ||
"extensions": { | ||
"name": "input", | ||
"code": "VALIDATION_INVALID_TYPE_VARIABLE" | ||
} | ||
} | ||
] | ||
} |
20 changes: 20 additions & 0 deletions
20
.../supergraph/snapshots/apollo_router__services__supergraph__tests__invalid_input_enum.snap
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 @@ | ||
--- | ||
source: apollo-router/src/services/supergraph/tests.rs | ||
expression: response | ||
--- | ||
{ | ||
"errors": [ | ||
{ | ||
"message": "Value \"C does not exist in \"InputEnum\" enum.", | ||
"locations": [ | ||
{ | ||
"line": 1, | ||
"column": 21 | ||
} | ||
], | ||
"extensions": { | ||
"code": "GRAPHQL_VALIDATION_FAILED" | ||
} | ||
} | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
...upergraph/snapshots/apollo_router__services__supergraph__tests__query_reconstruction.snap
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
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
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