[][src]Trait async_graphql::extensions::Extension

pub trait Extension: Sync + Send + 'static {
    pub fn name(&self) -> Option<&'static str> { ... }
#[must_use] pub fn prepare_request<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        ctx: &'life1 ExtensionContext<'life2>,
        request: Request
    ) -> Pin<Box<dyn Future<Output = ServerResult<Request>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... }
pub fn parse_start(
        &mut self,
        ctx: &ExtensionContext<'_>,
        query_source: &str,
        variables: &Variables
    ) { ... }
pub fn parse_end(
        &mut self,
        ctx: &ExtensionContext<'_>,
        document: &ExecutableDocument
    ) { ... }
pub fn validation_start(&mut self, ctx: &ExtensionContext<'_>) { ... }
pub fn validation_end(
        &mut self,
        ctx: &ExtensionContext<'_>,
        result: &ValidationResult
    ) { ... }
pub fn execution_start(&mut self, ctx: &ExtensionContext<'_>) { ... }
pub fn execution_end(&mut self, ctx: &ExtensionContext<'_>) { ... }
pub fn resolve_start(
        &mut self,
        ctx: &ExtensionContext<'_>,
        info: &ResolveInfo<'_>
    ) { ... }
pub fn resolve_end(
        &mut self,
        ctx: &ExtensionContext<'_>,
        info: &ResolveInfo<'_>
    ) { ... }
pub fn error(&mut self, ctx: &ExtensionContext<'_>, err: &ServerError) { ... }
pub fn result(&mut self, ctx: &ExtensionContext<'_>) -> Option<Value> { ... } }

Represents a GraphQL extension

Provided methods

pub fn name(&self) -> Option<&'static str>[src]

If this extension needs to output data to query results, you need to specify a name.

#[must_use]pub fn prepare_request<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    ctx: &'life1 ExtensionContext<'life2>,
    request: Request
) -> Pin<Box<dyn Future<Output = ServerResult<Request>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Called at the prepare request

pub fn parse_start(
    &mut self,
    ctx: &ExtensionContext<'_>,
    query_source: &str,
    variables: &Variables
)
[src]

Called at the begin of the parse.

pub fn parse_end(
    &mut self,
    ctx: &ExtensionContext<'_>,
    document: &ExecutableDocument
)
[src]

Called at the end of the parse.

pub fn validation_start(&mut self, ctx: &ExtensionContext<'_>)[src]

Called at the begin of the validation.

pub fn validation_end(
    &mut self,
    ctx: &ExtensionContext<'_>,
    result: &ValidationResult
)
[src]

Called at the end of the validation.

pub fn execution_start(&mut self, ctx: &ExtensionContext<'_>)[src]

Called at the begin of the execution.

pub fn execution_end(&mut self, ctx: &ExtensionContext<'_>)[src]

Called at the end of the execution.

pub fn resolve_start(
    &mut self,
    ctx: &ExtensionContext<'_>,
    info: &ResolveInfo<'_>
)
[src]

Called at the begin of the resolve field.

pub fn resolve_end(
    &mut self,
    ctx: &ExtensionContext<'_>,
    info: &ResolveInfo<'_>
)
[src]

Called at the end of the resolve field.

pub fn error(&mut self, ctx: &ExtensionContext<'_>, err: &ServerError)[src]

Called when an error occurs.

pub fn result(&mut self, ctx: &ExtensionContext<'_>) -> Option<Value>[src]

Get the results

Loading content...

Implementors

Loading content...