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 GraphQLRequest
pub 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>
) -> GraphQLRequest
Construct 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 GraphQLRequest
fn clone(&self) -> GraphQLRequest
[src]
fn clone(&self) -> GraphQLRequest
Returns 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 GraphQLRequest
fn eq(&self, other: &GraphQLRequest) -> bool
[src]
fn eq(&self, other: &GraphQLRequest) -> bool
This 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) -> bool
This method tests for !=
.
impl Debug for GraphQLRequest
[src]
impl Debug for GraphQLRequest
Auto Trait Implementations
impl Send for GraphQLRequest
impl Send for GraphQLRequest
impl Sync for GraphQLRequest
impl Sync for GraphQLRequest