Trait async_graphql::extensions::Extension
source · 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§
sourcefn 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 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.
sourcefn subscribe<'s>(
&self,
ctx: &ExtensionContext<'_>,
stream: BoxStream<'s, Response>,
next: NextSubscribe<'_>
) -> BoxStream<'s, Response>
fn subscribe<'s>( &self, ctx: &ExtensionContext<'_>, stream: BoxStream<'s, Response>, next: NextSubscribe<'_> ) -> BoxStream<'s, Response>
Called at subscribe request.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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,
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.