Struct async_graphql_rocket::GraphQLQuery [−][src]
pub struct GraphQLQuery { /* fields omitted */ }
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
pub 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
Performs the conversion.
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
Mutably borrows from an owned value. Read more
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more