[−][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 operation_name(&self) -> Option<&str>
[src]
Returns the operation_name
associated with this request.
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: 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]
impl<S: Debug> Debug for GraphQLRequest<S> where
S: ScalarValue,
[src]
S: ScalarValue,
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>,
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> 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<S> StructuralPartialEq for GraphQLRequest<S> where
S: ScalarValue,
[src]
S: ScalarValue,
Auto Trait Implementations
impl<S> RefUnwindSafe for GraphQLRequest<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for GraphQLRequest<S> where
S: Send,
S: Send,
impl<S> Sync for GraphQLRequest<S> where
S: Sync,
S: Sync,
impl<S> Unpin for GraphQLRequest<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for GraphQLRequest<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,