pub trait Extension: Sync + Send + 'static {
    // Provided methods
    fn request<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExtensionContext<'life2>,
        next: NextRequest<'life3>
    ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn subscribe<'s>(
        &self,
        ctx: &ExtensionContext<'_>,
        stream: BoxStream<'s, Response>,
        next: NextSubscribe<'_>
    ) -> BoxStream<'s, Response> { ... }
    fn prepare_request<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExtensionContext<'life2>,
        request: Request,
        next: NextPrepareRequest<'life3>
    ) -> Pin<Box<dyn Future<Output = ServerResult<Request>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn parse_query<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExtensionContext<'life2>,
        query: &'life3 str,
        variables: &'life4 Variables,
        next: NextParseQuery<'life5>
    ) -> Pin<Box<dyn Future<Output = ServerResult<ExecutableDocument>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait { ... }
    fn validation<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExtensionContext<'life2>,
        next: NextValidation<'life3>
    ) -> Pin<Box<dyn Future<Output = Result<ValidationResult, Vec<ServerError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn execute<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExtensionContext<'life2>,
        operation_name: Option<&'life3 str>,
        next: NextExecute<'life4>
    ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait { ... }
    fn resolve<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        ctx: &'life1 ExtensionContext<'life2>,
        info: ResolveInfo<'life3>,
        next: NextResolve<'life4>
    ) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait { ... }
}
Expand description

Represents a GraphQL extension

Provided Methods§

source

fn request<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 ExtensionContext<'life2>, next: NextRequest<'life3> ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Called at start query/mutation request.

source

fn subscribe<'s>( &self, ctx: &ExtensionContext<'_>, stream: BoxStream<'s, Response>, next: NextSubscribe<'_> ) -> BoxStream<'s, Response>

Called at subscribe request.

source

fn prepare_request<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 ExtensionContext<'life2>, request: Request, next: NextPrepareRequest<'life3> ) -> Pin<Box<dyn Future<Output = ServerResult<Request>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Called at prepare request.

source

fn parse_query<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, ctx: &'life1 ExtensionContext<'life2>, query: &'life3 str, variables: &'life4 Variables, next: NextParseQuery<'life5> ) -> Pin<Box<dyn Future<Output = ServerResult<ExecutableDocument>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Called at parse query.

source

fn validation<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 ExtensionContext<'life2>, next: NextValidation<'life3> ) -> Pin<Box<dyn Future<Output = Result<ValidationResult, Vec<ServerError>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Called at validation query.

source

fn execute<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, ctx: &'life1 ExtensionContext<'life2>, operation_name: Option<&'life3 str>, next: NextExecute<'life4> ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Called at execute query.

source

fn resolve<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, ctx: &'life1 ExtensionContext<'life2>, info: ResolveInfo<'life3>, next: NextResolve<'life4> ) -> Pin<Box<dyn Future<Output = ServerResult<Option<Value>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Called at resolve field.

Implementors§