[−][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.
Implementations
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_sync<'a, QueryT, MutationT, SubscriptionT>(
&'a self,
root_node: &'a RootNode<'_, QueryT, MutationT, SubscriptionT, S>,
context: &QueryT::Context
) -> GraphQLResponse<'a, S> where
S: ScalarValue,
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S, Context = QueryT::Context>,
SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
[src]
&'a self,
root_node: &'a RootNode<'_, QueryT, MutationT, SubscriptionT, S>,
context: &QueryT::Context
) -> GraphQLResponse<'a, S> where
S: ScalarValue,
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S, Context = QueryT::Context>,
SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
Execute a GraphQL request synchronously using the specified schema and context
This is a simple wrapper around the execute_sync
function exposed at the
top level of this crate.
pub async fn execute<'a, QueryT, MutationT, SubscriptionT>(
&'a self,
root_node: &'a RootNode<'a, QueryT, MutationT, SubscriptionT, S>,
context: &'a QueryT::Context
) -> GraphQLResponse<'a, S> where
QueryT: GraphQLTypeAsync<S>,
QueryT::TypeInfo: Sync,
QueryT::Context: Sync,
MutationT: GraphQLTypeAsync<S, Context = QueryT::Context>,
MutationT::TypeInfo: Sync,
SubscriptionT: GraphQLType<S, Context = QueryT::Context> + Sync,
SubscriptionT::TypeInfo: Sync,
S: ScalarValue + Send + Sync,
[src]
&'a self,
root_node: &'a RootNode<'a, QueryT, MutationT, SubscriptionT, S>,
context: &'a QueryT::Context
) -> GraphQLResponse<'a, S> where
QueryT: GraphQLTypeAsync<S>,
QueryT::TypeInfo: Sync,
QueryT::Context: Sync,
MutationT: GraphQLTypeAsync<S, Context = QueryT::Context>,
MutationT::TypeInfo: Sync,
SubscriptionT: GraphQLType<S, Context = QueryT::Context> + Sync,
SubscriptionT::TypeInfo: Sync,
S: ScalarValue + Send + Sync,
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]
pub 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,
[src]
S: RefUnwindSafe,
impl<S> Send for GraphQLRequest<S> where
S: Send,
[src]
S: Send,
impl<S> Sync for GraphQLRequest<S> where
S: Sync,
[src]
S: Sync,
impl<S> Unpin for GraphQLRequest<S> where
S: Unpin,
[src]
S: Unpin,
impl<S> UnwindSafe for GraphQLRequest<S> where
S: UnwindSafe,
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,