pub struct HandlerRegistry { /* private fields */ }Expand description
Registry for managing GraphQL handlers
Implementations§
Source§impl HandlerRegistry
impl HandlerRegistry
Sourcepub fn with_upstream(upstream_url: Option<String>) -> Self
pub fn with_upstream(upstream_url: Option<String>) -> Self
Create a handler registry with upstream URL
Sourcepub fn register<H: GraphQLHandler + 'static>(&mut self, handler: H)
pub fn register<H: GraphQLHandler + 'static>(&mut self, handler: H)
Register a handler
Sourcepub fn get_handlers(
&self,
operation_name: Option<&str>,
operation_type: &OperationType,
) -> Vec<Arc<dyn GraphQLHandler>>
pub fn get_handlers( &self, operation_name: Option<&str>, operation_type: &OperationType, ) -> Vec<Arc<dyn GraphQLHandler>>
Get handlers for a specific operation
Sourcepub async fn execute_operation(
&self,
ctx: &GraphQLContext,
) -> HandlerResult<Option<Response>>
pub async fn execute_operation( &self, ctx: &GraphQLContext, ) -> HandlerResult<Option<Response>>
Execute handlers for an operation
Sourcepub async fn after_operation(
&self,
ctx: &GraphQLContext,
response: Response,
) -> HandlerResult<Response>
pub async fn after_operation( &self, ctx: &GraphQLContext, response: Response, ) -> HandlerResult<Response>
Execute after_operation hooks
Sourcepub async fn passthrough(&self, request: &Request) -> HandlerResult<Response>
pub async fn passthrough(&self, request: &Request) -> HandlerResult<Response>
Passthrough request to upstream server
Sourcepub fn upstream_url(&self) -> Option<&str>
pub fn upstream_url(&self) -> Option<&str>
Get upstream URL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HandlerRegistry
impl !RefUnwindSafe for HandlerRegistry
impl Send for HandlerRegistry
impl Sync for HandlerRegistry
impl Unpin for HandlerRegistry
impl !UnwindSafe for HandlerRegistry
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request