Skip to main content

QueryExecutor

Trait QueryExecutor 

Source
pub trait QueryExecutor: Send + Sync {
    // Required method
    fn execute_query(
        &self,
        query: &str,
        variables: Option<&Value>,
    ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>;
}
Expand description

A trait for executing GraphQL queries. This abstraction allows testing without needing a real database.

Required Methods§

Source

fn execute_query( &self, query: &str, variables: Option<&Value>, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + '_>>

Execute a GraphQL query and return the result.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§