pub struct Operation<QueryFragment, Variables = ()> {
pub query: String,
pub variables: Variables,
/* private fields */
}
Expand description
An Operation that can be sent to a remote GraphQL server.
This contains a GraphQL query string and variable HashMap. It can be
serialized into JSON with serde::Serialize
and sent to a remote server.
Fields§
§query: String
The graphql query string that will be sent to the server
variables: Variables
The variables that will be sent to the server as part of this operation
Implementations§
source§impl<'de, Fragment, Variables> Operation<Fragment, Variables>where
Fragment: QueryFragment<'de>,
Variables: QueryVariables,
impl<'de, Fragment, Variables> Operation<Fragment, Variables>where
Fragment: QueryFragment<'de>,
Variables: QueryVariables,
sourcepub fn query(variables: Variables) -> Selfwhere
Fragment::SchemaType: QueryRoot,
pub fn query(variables: Variables) -> Selfwhere
Fragment::SchemaType: QueryRoot,
Constructs a new Operation for a query
sourcepub fn mutation(variables: Variables) -> Selfwhere
Fragment::SchemaType: MutationRoot,
pub fn mutation(variables: Variables) -> Selfwhere
Fragment::SchemaType: MutationRoot,
Constructs a new Operation for a mutation