pub struct GraphQLValidationResponse {
pub errors: Vec<GraphQLValidationError>,
pub error_count: usize,
}Expand description
Collection of GraphQL validation errors.
Fields§
§errors: Vec<GraphQLValidationError>List of validation errors
error_count: usizeTotal error count
Implementations§
Source§impl GraphQLValidationResponse
impl GraphQLValidationResponse
Sourcepub fn add_field_error(
&mut self,
field_error: ValidationFieldError,
context: Option<Value>,
)
pub fn add_field_error( &mut self, field_error: ValidationFieldError, context: Option<Value>, )
Add a validation field error to the response.
Sourcepub fn add_errors(&mut self, errors: Vec<ValidationFieldError>)
pub fn add_errors(&mut self, errors: Vec<ValidationFieldError>)
Add multiple validation errors at once.
Sourcepub fn from_error(error: &FraiseQLError) -> Option<Self>
pub fn from_error(error: &FraiseQLError) -> Option<Self>
Convert from FraiseQLError to validation response.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if response has any errors.
Sourcepub fn to_graphql_errors(&self) -> Value
pub fn to_graphql_errors(&self) -> Value
Serialize to JSON suitable for GraphQL response.
Trait Implementations§
Source§impl Clone for GraphQLValidationResponse
impl Clone for GraphQLValidationResponse
Source§fn clone(&self) -> GraphQLValidationResponse
fn clone(&self) -> GraphQLValidationResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphQLValidationResponse
impl Debug for GraphQLValidationResponse
Source§impl Default for GraphQLValidationResponse
impl Default for GraphQLValidationResponse
Source§impl<'de> Deserialize<'de> for GraphQLValidationResponse
impl<'de> Deserialize<'de> for GraphQLValidationResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GraphQLValidationResponse
impl RefUnwindSafe for GraphQLValidationResponse
impl Send for GraphQLValidationResponse
impl Sync for GraphQLValidationResponse
impl Unpin for GraphQLValidationResponse
impl UnsafeUnpin for GraphQLValidationResponse
impl UnwindSafe for GraphQLValidationResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more