Struct juniper::http::GraphQLRequest
[−]
[src]
pub struct GraphQLRequest { /* fields omitted */ }
The expected structure of the decoded JSON document for either POST or GET requests.
For POST, you can use Serde to deserialize the incoming JSON data directly into this struct - it derives Deserialize for exactly this reason.
For GET, you will need to parse the query string and exctract "query", "operationName", and "variables" manually.
Methods
impl GraphQLRequest
[src]
fn new(
query: String,
operation_name: Option<String>,
variables: Option<InputValue>
) -> GraphQLRequest
query: String,
operation_name: Option<String>,
variables: Option<InputValue>
) -> GraphQLRequest
Construct a new GraphQL request from parts
fn execute<'a, CtxT, QueryT, MutationT>(
&'a self,
root_node: &RootNode<QueryT, MutationT>,
context: &CtxT
) -> GraphQLResponse<'a> where
QueryT: GraphQLType<Context = CtxT>,
MutationT: GraphQLType<Context = CtxT>,
&'a self,
root_node: &RootNode<QueryT, MutationT>,
context: &CtxT
) -> GraphQLResponse<'a> where
QueryT: GraphQLType<Context = CtxT>,
MutationT: GraphQLType<Context = CtxT>,
Execute a GraphQL request using the specified schema and context
This is a simple wrapper around the execute
function exposed at the
top level of this crate.