This commit is contained in:
Sunli 2022-09-25 13:41:36 +08:00
parent b0f9ebb170
commit c7d233a44a
1 changed files with 7 additions and 6 deletions

View File

@ -107,12 +107,13 @@ where
async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> { async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
if let (&Method::GET, uri) = (req.method(), req.uri()) { if let (&Method::GET, uri) = (req.method(), req.uri()) {
let res = async_graphql::http::parse_query_string(uri.query().unwrap_or_default()).map_err(|err| { let res = async_graphql::http::parse_query_string(uri.query().unwrap_or_default())
ParseRequestError::Io(std::io::Error::new( .map_err(|err| {
ErrorKind::Other, ParseRequestError::Io(std::io::Error::new(
format!("failed to parse graphql request from uri query: {}", err), ErrorKind::Other,
)) format!("failed to parse graphql request from uri query: {}", err),
}); ))
});
Ok(Self(async_graphql::BatchRequest::Single(res?), PhantomData)) Ok(Self(async_graphql::BatchRequest::Single(res?), PhantomData))
} else { } else {
let content_type = req let content_type = req