pub trait GraphqlOperation: Serialize {
    type Response;
    type Error: Error;

    // Required method
    fn decode(&self, data: Value) -> Result<Self::Response, Self::Error>;
}
Expand description

An abstraction over GraphQL operations.

Required Associated Types§

source

type Response

The actual response & error type of this operation.

source

type Error: Error

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

Required Methods§

source

fn decode(&self, data: Value) -> Result<Self::Response, Self::Error>

Decodes a GenericResponse into the actual response that will be returned to users for this operation.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<ResponseData, Variables> GraphqlOperation for StreamingOperation<ResponseData, Variables>
where ResponseData: DeserializeOwned, Variables: Serialize,

Available on crate feature client-cynic only.
§

type Response = GraphQlResponse<ResponseData>

§

type Error = Error

source§

fn decode(&self, response: Value) -> Result<Self::Response, Self::Error>

Implementors§

source§

impl<Q: GraphQLQuery> GraphqlOperation for graphql_ws_client::graphql::StreamingOperation<Q>