You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been digging into past versions and it seems that there used to be trait called InputValueValidator that allowed to return an Error with extensions after this PR #564
This solved this request #385, which is exactly what I'm trying to achieve.
Without Error extensions, it's difficult for frontend clients to know what exactly is wrong, but the current trait of CustomValidator only allows to return a String in the check method.
Could the old behaviour be brought back? I don't see any removal notes from the CHANGELOG either
The text was updated successfully, but these errors were encountered:
I've tested the new version and it's great but I still can't use custom Graphql errors.
For example:
#[derive(Debug,Error)]pubenumGraphqlError{#[error("InternalServerError")]InternalServerError(String),#[error("Could not find resource")]NotFound,#[error("Unauthenticated")]Unauthenticated,#[error("Invalid user input")]BadUserInput(HashMap<String,String>),}implErrorExtensionsforGraphqlError{fnextend(&self) -> FieldError{
...}}
I can't do this:
let fields = HashMap::new();let error:InputValueError = GraphqlError::BadUserInput(fields).extend().into()
because async_graphql::Error doesn't implement std::fmt::Display
Description of the feature
I've been digging into past versions and it seems that there used to be trait called
InputValueValidator
that allowed to return an Error with extensions after this PR #564This solved this request #385, which is exactly what I'm trying to achieve.
Without Error extensions, it's difficult for frontend clients to know what exactly is wrong, but the current trait of
CustomValidator
only allows to return a String in thecheck
method.Could the old behaviour be brought back? I don't see any removal notes from the CHANGELOG either
The text was updated successfully, but these errors were encountered: