Struct async_graphql_rocket::GraphQLRequest [−][src]
pub struct GraphQLRequest(pub Request);
Expand description
A GraphQL request which can be extracted from the request’s body.
Examples
ⓘ
#[rocket::post("/graphql", data = "<request>", format = "application/json", rank = 2)]
async fn graphql_request(schema: State<'_, ExampleSchema>, request: Request) -> Result<Response, Status> {
request.execute(&schema).await
}
Tuple Fields
0: Request
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.
type Error = ParseRequestError
type Error = ParseRequestError
The associated error to be returned when the guard fails.
Asynchronously validates, parses, and converts an instance of Self
from the incoming request body data. Read more
Auto Trait Implementations
impl !RefUnwindSafe for GraphQLRequest
impl Send for GraphQLRequest
impl Sync for GraphQLRequest
impl Unpin for GraphQLRequest
impl !UnwindSafe for GraphQLRequest
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