Trait graphql_ws_client::graphql::GraphqlClient
source · [−]pub trait GraphqlClient {
type Response: DeserializeOwned + Send;
type DecodeError: Error + Send + 'static;
fn error_response(
errors: Vec<Value>
) -> Result<Self::Response, Self::DecodeError>;
}
Expand description
A trait for GraphQL clients.
Associated Types
type Response: DeserializeOwned + Send
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.
type DecodeError: Error + Send + 'static
type DecodeError: Error + Send + 'static
The error that will be returned from failed attempts to decode a Response
.
Required methods
fn error_response(
errors: Vec<Value>
) -> Result<Self::Response, Self::DecodeError>
fn error_response(
errors: Vec<Value>
) -> Result<Self::Response, Self::DecodeError>
Decodes some error JSON into a Response