Struct async_graphql_rocket::GraphQLQuery
source · [−]pub struct GraphQLQuery { /* private fields */ }
Expand description
A GraphQL request which can be extracted from a query string.
Examples
ⓘ
#[rocket::get("/graphql?<query..>")]
async fn graphql_query(schema: State<'_, ExampleSchema>, query: Query) -> Result<Response, Status> {
query.execute(&schema).await
}
Implementations
sourceimpl GraphQLQuery
impl GraphQLQuery
sourcepub async fn execute<Query, Mutation, Subscription>(
self,
schema: &Schema<Query, Mutation, Subscription>
) -> GraphQLResponse where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
pub async fn execute<Query, Mutation, Subscription>(
self,
schema: &Schema<Query, Mutation, Subscription>
) -> GraphQLResponse where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
Shortcut method to execute the request on the schema.
Trait Implementations
sourceimpl Debug for GraphQLQuery
impl Debug for GraphQLQuery
sourceimpl From<GraphQLQuery> for GraphQLRequest
impl From<GraphQLQuery> for GraphQLRequest
sourcefn from(query: GraphQLQuery) -> Self
fn from(query: GraphQLQuery) -> Self
Converts to this type from the input type.
sourceimpl<'r> FromForm<'r> for GraphQLQuery
impl<'r> FromForm<'r> for GraphQLQuery
type Context = FromFormGeneratedContext<'r>
type Context = FromFormGeneratedContext<'r>
The form guard’s parsing context.
sourcefn init(__opts: Options) -> Self::Context
fn init(__opts: Options) -> Self::Context
Initializes and returns the parsing context for Self
.
sourcefn push_value(__c: &mut Self::Context, __f: ValueField<'r>)
fn push_value(__c: &mut Self::Context, __f: ValueField<'r>)
Processes the value field field
.
sourcefn push_data<'life0, 'life1, 'async_trait>(
__c: &'life0 mut FromFormGeneratedContext<'r>,
__f: DataField<'r, 'life1>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'r: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn push_data<'life0, 'life1, 'async_trait>(
__c: &'life0 mut FromFormGeneratedContext<'r>,
__f: DataField<'r, 'life1>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'r: 'async_trait,
'life0: 'async_trait,
'life1: '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
Auto Trait Implementations
impl RefUnwindSafe for GraphQLQuery
impl Send for GraphQLQuery
impl Sync for GraphQLQuery
impl Unpin for GraphQLQuery
impl UnwindSafe for GraphQLQuery
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