Skip to content

Commit

Permalink
[GraphQL/Limits] BUGFIX: directives test error type
Browse files Browse the repository at this point in the history
## Description

Passing an unsupported directive should be a user input error, not an
internal error.

## Test plan

CI
  • Loading branch information
amnn committed Jul 16, 2024
1 parent a67e7c2 commit a07d81c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/sui-graphql-e2e-tests/tests/limits/directives.exp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Response: {
}
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
"code": "BAD_USER_INPUT"
}
}
]
Expand All @@ -35,7 +35,7 @@ Response: {
}
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
"code": "BAD_USER_INPUT"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ fn check_directives(directives: &[Positioned<Directive>]) -> ServerResult<()> {
for directive in directives {
if !allowed_directives().contains(&directive.node.name.node.as_str()) {
return Err(graphql_error_at_pos(
code::INTERNAL_SERVER_ERROR,
code::BAD_USER_INPUT,
format!(
"Directive `@{}` is not supported. Supported directives are {}",
directive.node.name.node,
Expand Down

0 comments on commit a07d81c

Please sign in to comment.