Trait GraphqlClient

Source
pub trait GraphqlClient {
    type Response: DeserializeOwned + Send;
    type DecodeError: Error + Send + 'static;

    // Required method
    fn error_response(
        errors: Vec<Value>,
    ) -> Result<Self::Response, Self::DecodeError>;
}
Expand description

A trait for GraphQL clients.

Required Associated Types§

Source

type Response: DeserializeOwned + Send

The generic response type for this GraphqlClient implementation

Our client will decode this, then pass it to a GraphqlOperation for decoding to the specific response type of the GraphqlOperation.

Source

type DecodeError: Error + Send + 'static

The error that will be returned from failed attempts to decode a Response.

Required Methods§

Source

fn error_response( errors: Vec<Value>, ) -> Result<Self::Response, Self::DecodeError>

Decodes some error JSON into a Response

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§