pub struct GraphQLBatchRequest(pub BatchRequest);
Expand description
A batch request which can be extracted from a request’s body.
Examples
ⓘ
#[rocket::post("/graphql", data = "<request>", format = "application/json", rank = 1)]
async fn graphql_request(schema: State<'_, ExampleSchema>, request: BatchRequest) -> Response {
request.execute(&schema).await
}
Tuple Fields§
§0: BatchRequest
Implementations§
source§impl GraphQLBatchRequest
impl GraphQLBatchRequest
sourcepub async fn execute<E>(self, executor: &E) -> GraphQLResponsewhere
E: Executor,
pub async fn execute<E>(self, executor: &E) -> GraphQLResponsewhere
E: Executor,
Shortcut method to execute the request on the executor.
Trait Implementations§
source§impl Debug for GraphQLBatchRequest
impl Debug for GraphQLBatchRequest
source§impl<'r> FromData<'r> for GraphQLBatchRequest
impl<'r> FromData<'r> for GraphQLBatchRequest
§type Error = ParseRequestError
type Error = ParseRequestError
The associated error to be returned when the guard fails.
source§fn from_data<'life0, 'async_trait>(
req: &'r Request<'life0>,
data: Data<'r>
) -> Pin<Box<dyn Future<Output = Outcome<'r, Self>> + 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>> + 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 moreAuto Trait Implementations§
impl !RefUnwindSafe for GraphQLBatchRequest
impl Send for GraphQLBatchRequest
impl Sync for GraphQLBatchRequest
impl Unpin for GraphQLBatchRequest
impl !UnwindSafe for GraphQLBatchRequest
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn 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.