Skip to main content

GraphQl

Trait GraphQl 

Source
pub trait GraphQl {
    // Required method
    async fn query(&self, doc: &str, vars: Value) -> Result<Value>;
}
Expand description

A GraphQL endpoint that can answer a document. One method, so a test double is a few lines rather than a mock framework.

Required Methods§

Source

async fn query(&self, doc: &str, vars: Value) -> Result<Value>

Execute doc with vars and return the data object.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§