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 extract "query", "operationName", and "variables" manually.
Methods
impl GraphQLRequest[src]
impl GraphQLRequestpub fn new(
query: String,
operation_name: Option<String>,
variables: Option<InputValue>
) -> GraphQLRequest[src]
pub fn new(
query: String,
operation_name: Option<String>,
variables: Option<InputValue>
) -> GraphQLRequestConstruct a new GraphQL request from parts
pub 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>, [src]
pub 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>, 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.
Trait Implementations
impl Clone for GraphQLRequest[src]
impl Clone for GraphQLRequestfn clone(&self) -> GraphQLRequest[src]
fn clone(&self) -> GraphQLRequestReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl PartialEq for GraphQLRequest[src]
impl PartialEq for GraphQLRequestfn eq(&self, other: &GraphQLRequest) -> bool[src]
fn eq(&self, other: &GraphQLRequest) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &GraphQLRequest) -> bool[src]
fn ne(&self, other: &GraphQLRequest) -> boolThis method tests for !=.
impl Debug for GraphQLRequest[src]
impl Debug for GraphQLRequestAuto Trait Implementations
impl Send for GraphQLRequest
impl Send for GraphQLRequestimpl Sync for GraphQLRequest
impl Sync for GraphQLRequest