Trait artemis::GraphQLQuery[][src]

pub trait GraphQLQuery: Send + Sync + 'static {
    type Variables: Serialize + Send + Sync + Clone + 'static;
    type ResponseData: Serialize + DeserializeOwned + Send + Sync + Clone + 'static + QueryInfo<Self::Variables>;
    fn build_query(
        variables: Self::Variables
    ) -> (QueryBody<Self::Variables>, OperationMeta); fn selection(variables: &Self::Variables) -> Vec<FieldSelector> { ... } }

A convenience trait that can be used to build a GraphQL request body. This will be implemented for you by codegen. It is implemented on the struct you place the derive on.

Associated Types

type Variables: Serialize + Send + Sync + Clone + 'static[src]

The shape of the variables expected by the query. This should be a generated struct most of the time.

type ResponseData: Serialize + DeserializeOwned + Send + Sync + Clone + 'static + QueryInfo<Self::Variables>[src]

The top-level shape of the response data (the data field in the GraphQL response). In practice this should be generated, since it is hard to write by hand without error.

Loading content...

Required methods

fn build_query(
    variables: Self::Variables
) -> (QueryBody<Self::Variables>, OperationMeta)
[src]

Produce a GraphQL query struct that can be JSON serialized and sent to a GraphQL API.

Loading content...

Provided methods

fn selection(variables: &Self::Variables) -> Vec<FieldSelector>[src]

Loading content...

Implementors

Loading content...