Skip to main content

GQLError

Type Alias GQLError 

Source
pub type GQLError = Error;
Expand description

A wrapper around async_graphql::Error. If any of your schemas need to explicitly create an error that only exists in them (and you’re not using something like error_chain), you should use this.

§Example

use diana::errors::{GQLResult, GQLError};

async fn api_version() -> GQLResult<String> {
    let err = GQLError::new("Test error!");
    // Your code here
    Err(err)
}

Aliased Type§

pub struct GQLError {
    pub message: String,
    pub extensions: Option<ErrorExtensionValues>,
}

Fields§

§message: String

The error message.

§extensions: Option<ErrorExtensionValues>

Extensions to the error.