Skip to main content

GraphqlResolverBridge

Trait GraphqlResolverBridge 

Source
pub trait GraphqlResolverBridge: Send + Sync {
    // Required method
    fn resolve_field<'a>(
        &'a self,
        field: &'a str,
        args: &'a Value,
        ctx: &'a Context,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'a>>;
}
Expand description

Bridge that maps a GraphQL field resolution to a themql-core Resolver call. Implementations are domain-specific.

This trait is dyn-compatible so root objects can hold Arc<dyn GraphqlResolverBridge>.

Required Methods§

Source

fn resolve_field<'a>( &'a self, field: &'a str, args: &'a Value, ctx: &'a Context, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'a>>

Resolve a GraphQL field by name with the given JSON arguments and execution context.

§Errors

Returns [Error] if the field cannot be resolved.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§