[][src]Struct juniper::http::GraphQLRequest

pub struct GraphQLRequest<S = DefaultScalarValue> where
    S: ScalarValue
{ /* 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.

Implementations

impl<S> GraphQLRequest<S> where
    S: ScalarValue
[src]

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]

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]

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]

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]

impl<S: Debug> Debug for GraphQLRequest<S> where
    S: ScalarValue
[src]

impl<'de, S> Deserialize<'de> for GraphQLRequest<S> where
    S: ScalarValue,
    InputValue<S>: Deserialize<'de> + Serialize
[src]

impl<S: PartialEq> PartialEq<GraphQLRequest<S>> for GraphQLRequest<S> where
    S: ScalarValue
[src]

impl<S> Serialize for GraphQLRequest<S> where
    S: ScalarValue,
    S: Serialize
[src]

impl<S> StructuralPartialEq for GraphQLRequest<S> where
    S: ScalarValue
[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for GraphQLRequest<S> where
    S: RefUnwindSafe
[src]

impl<S> Send for GraphQLRequest<S> where
    S: Send
[src]

impl<S> Sync for GraphQLRequest<S> where
    S: Sync
[src]

impl<S> Unpin for GraphQLRequest<S> where
    S: Unpin
[src]

impl<S> UnwindSafe for GraphQLRequest<S> where
    S: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,