Errors
The base type of the errors a mutation returns as data, and the exception that validation converts into one.
ErrorType
Base class for GraphQL errors.
id
python
id: str = ErrorId.ERROR.valueInputValidationError
python
InputValidationError(validation: ValidationProtocol[Any], exception: Exception) -> NoneException raised when input validation fails.
This exception wraps the original validation error and provides a method to convert it to a GraphQL-compatible error type.
Attributes:
| Name | Type | Description |
|---|---|---|
validation | The validation protocol instance that failed | |
exception | The original exception that was raised during validation |
Initialize with the validation instance and original exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validation | ValidationProtocol[Any] | The validation protocol instance that failed | required |
exception | Exception | The original exception that was raised | required |
detail
python
detail: str = detailexception
python
exception = exceptiongraphql_type
python
graphql_type() -> ValidationErrorTypeConvert the validation error to a GraphQL-compatible error type.
Returns:
| Type | Description |
|---|---|
ValidationErrorType | A GraphQL-compatible error type that can be returned in a response |
validation
python
validation = validation