[−][src]Struct juniper::http::GraphQLRequest
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<S> GraphQLRequest<S> where
S: ScalarValue,
[src]
S: ScalarValue,
pub fn new(
query: String,
operation_name: Option<String>,
variables: Option<InputValue<S>>
) -> Self
[src]
query: String,
operation_name: Option<String>,
variables: Option<InputValue<S>>
) -> Self
Construct a new GraphQL request from parts
pub fn execute<'a, CtxT, QueryT, MutationT>(
&'a self,
root_node: &'a RootNode<QueryT, MutationT, S>,
context: &CtxT
) -> GraphQLResponse<'a, S> where
S: ScalarValue,
QueryT: GraphQLType<S, Context = CtxT>,
MutationT: GraphQLType<S, Context = CtxT>,
&'b S: ScalarRefValue<'b>,
[src]
&'a self,
root_node: &'a RootNode<QueryT, MutationT, S>,
context: &CtxT
) -> GraphQLResponse<'a, S> where
S: ScalarValue,
QueryT: GraphQLType<S, Context = CtxT>,
MutationT: GraphQLType<S, Context = CtxT>,
&'b S: ScalarRefValue<'b>,
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<S: PartialEq> PartialEq<GraphQLRequest<S>> for GraphQLRequest<S> where
S: ScalarValue,
[src]
S: ScalarValue,
fn eq(&self, other: &GraphQLRequest<S>) -> bool
[src]
fn ne(&self, other: &GraphQLRequest<S>) -> bool
[src]
impl<S: Clone> Clone for GraphQLRequest<S> where
S: ScalarValue,
[src]
S: ScalarValue,
fn clone(&self) -> GraphQLRequest<S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for GraphQLRequest<S> where
S: ScalarValue,
[src]
S: ScalarValue,
impl<S> Serialize for GraphQLRequest<S> where
S: ScalarValue,
S: Serialize,
[src]
S: ScalarValue,
S: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, S> Deserialize<'de> for GraphQLRequest<S> where
S: ScalarValue,
InputValue<S>: Deserialize<'de> + Serialize,
[src]
S: ScalarValue,
InputValue<S>: Deserialize<'de> + Serialize,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<S> Send for GraphQLRequest<S> where
S: Send,
S: Send,
impl<S> Sync for GraphQLRequest<S> where
S: Sync,
S: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,