Struct juniper_rocket::GraphQLRequest
source · [−]pub struct GraphQLRequest<S = DefaultScalarValue>(_)
where
S: ScalarValue;
Expand description
Simple wrapper around an incoming GraphQL request
See the http
module for more information. This type can be constructed
automatically from both GET and POST routes by implementing the FromForm
and FromData
traits.
Implementations
sourceimpl<S> GraphQLRequest<S> where
S: ScalarValue,
impl<S> GraphQLRequest<S> where
S: ScalarValue,
sourcepub fn execute_sync<CtxT, QueryT, MutationT, SubscriptionT>(
&self,
root_node: &RootNode<'_, QueryT, MutationT, SubscriptionT, S>,
context: &CtxT
) -> GraphQLResponse where
QueryT: GraphQLType<S, Context = CtxT>,
MutationT: GraphQLType<S, Context = CtxT>,
SubscriptionT: GraphQLType<S, Context = CtxT>,
pub fn execute_sync<CtxT, QueryT, MutationT, SubscriptionT>(
&self,
root_node: &RootNode<'_, QueryT, MutationT, SubscriptionT, S>,
context: &CtxT
) -> GraphQLResponse where
QueryT: GraphQLType<S, Context = CtxT>,
MutationT: GraphQLType<S, Context = CtxT>,
SubscriptionT: GraphQLType<S, Context = CtxT>,
Synchronously execute an incoming GraphQL query.
sourcepub async fn execute<CtxT, QueryT, MutationT, SubscriptionT>(
&self,
root_node: &RootNode<'_, QueryT, MutationT, SubscriptionT, S>,
context: &CtxT
) -> GraphQLResponse where
QueryT: GraphQLTypeAsync<S, Context = CtxT>,
QueryT::TypeInfo: Sync,
MutationT: GraphQLTypeAsync<S, Context = CtxT>,
MutationT::TypeInfo: Sync,
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT>,
SubscriptionT::TypeInfo: Sync,
CtxT: Sync,
S: Send + Sync,
pub async fn execute<CtxT, QueryT, MutationT, SubscriptionT>(
&self,
root_node: &RootNode<'_, QueryT, MutationT, SubscriptionT, S>,
context: &CtxT
) -> GraphQLResponse where
QueryT: GraphQLTypeAsync<S, Context = CtxT>,
QueryT::TypeInfo: Sync,
MutationT: GraphQLTypeAsync<S, Context = CtxT>,
MutationT::TypeInfo: Sync,
SubscriptionT: GraphQLSubscriptionType<S, Context = CtxT>,
SubscriptionT::TypeInfo: Sync,
CtxT: Sync,
S: Send + Sync,
Asynchronously execute an incoming GraphQL query.
Trait Implementations
sourceimpl<S: Debug> Debug for GraphQLRequest<S> where
S: ScalarValue,
impl<S: Debug> Debug for GraphQLRequest<S> where
S: ScalarValue,
sourceimpl<'r, S> FromData<'r> for GraphQLRequest<S> where
S: ScalarValue,
impl<'r, S> FromData<'r> for GraphQLRequest<S> where
S: ScalarValue,
sourcefn from_data<'life0, 'async_trait>(
req: &'r Request<'life0>,
data: Data<'r>
) -> Pin<Box<dyn Future<Output = Outcome<'r, Self, Self::Error>> + Send + 'async_trait>> where
'r: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn from_data<'life0, 'async_trait>(
req: &'r Request<'life0>,
data: Data<'r>
) -> Pin<Box<dyn Future<Output = Outcome<'r, Self, Self::Error>> + Send + 'async_trait>> where
'r: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Asynchronously validates, parses, and converts an instance of Self
from the incoming request body data. Read more
sourceimpl<'f, S> FromForm<'f> for GraphQLRequest<S> where
S: ScalarValue + Send,
impl<'f, S> FromForm<'f> for GraphQLRequest<S> where
S: ScalarValue + Send,
type Context = GraphQLContext<'f, S>
type Context = GraphQLContext<'f, S>
The form guard’s parsing context.
sourcefn push_value(ctx: &mut Self::Context, field: ValueField<'f>)
fn push_value(ctx: &mut Self::Context, field: ValueField<'f>)
Processes the value field field
.
sourcefn push_data<'life0, 'life1, 'async_trait>(
ctx: &'life0 mut Self::Context,
field: DataField<'f, 'life1>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'f: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn push_data<'life0, 'life1, 'async_trait>(
ctx: &'life0 mut Self::Context,
field: DataField<'f, 'life1>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'f: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Processes the data field field
.
sourcefn push_error(_ctxt: &mut Self::Context, _error: Error<'r>)
fn push_error(_ctxt: &mut Self::Context, _error: Error<'r>)
Processes the external form or field error _error
. Read more
sourceimpl<S: PartialEq> PartialEq<GraphQLRequest<S>> for GraphQLRequest<S> where
S: ScalarValue,
impl<S: PartialEq> PartialEq<GraphQLRequest<S>> for GraphQLRequest<S> where
S: ScalarValue,
sourcefn eq(&self, other: &GraphQLRequest<S>) -> bool
fn eq(&self, other: &GraphQLRequest<S>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GraphQLRequest<S>) -> bool
fn ne(&self, other: &GraphQLRequest<S>) -> bool
This method tests for !=
.
impl<S> StructuralPartialEq for GraphQLRequest<S> where
S: ScalarValue,
Auto Trait Implementations
impl<S> RefUnwindSafe for GraphQLRequest<S> where
S: RefUnwindSafe,
impl<S> Send for GraphQLRequest<S> where
S: Send,
impl<S> Sync for GraphQLRequest<S> where
S: Sync,
impl<S> Unpin for GraphQLRequest<S> where
S: Unpin,
impl<S> UnwindSafe for GraphQLRequest<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more