diff --git a/examples b/examples index 6a638085..ef09f81f 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 6a63808523f7e4995f9111a3497f06921cd3b11b +Subproject commit ef09f81f6f348eb2ba4d24ec1dc4ed84b2ed684f diff --git a/integrations/axum/Cargo.toml b/integrations/axum/Cargo.toml index 292634cf..7c1180ee 100644 --- a/integrations/axum/Cargo.toml +++ b/integrations/axum/Cargo.toml @@ -15,7 +15,7 @@ categories = ["network-programming", "asynchronous"] async-graphql = { path = "../..", version = "3.0.37" } async-trait = "0.1.51" -axum = { version = "0.4", features = ["ws", "headers"] } +axum = { version = "0.5.1", features = ["ws", "headers"] } bytes = "1.0.1" http-body = "0.4.2" serde_json = "1.0.66" diff --git a/integrations/axum/src/extract.rs b/integrations/axum/src/extract.rs index 264d48d8..df298cfa 100644 --- a/integrations/axum/src/extract.rs +++ b/integrations/axum/src/extract.rs @@ -106,7 +106,7 @@ where } else { let content_type = req .headers() - .and_then(|headers| headers.get(http::header::CONTENT_TYPE)) + .get(http::header::CONTENT_TYPE) .and_then(|value| value.to_str().ok()) .map(ToString::to_string); let body_stream = BodyStream::from_request(req) diff --git a/integrations/axum/src/subscription.rs b/integrations/axum/src/subscription.rs index 11c3fe4b..9333bb7e 100644 --- a/integrations/axum/src/subscription.rs +++ b/integrations/axum/src/subscription.rs @@ -29,7 +29,7 @@ impl FromRequest for GraphQLProtocol { async fn from_request(req: &mut RequestParts) -> Result { req.headers() - .and_then(|headers| headers.get(http::header::SEC_WEBSOCKET_PROTOCOL)) + .get(http::header::SEC_WEBSOCKET_PROTOCOL) .and_then(|value| value.to_str().ok()) .and_then(|protocols| { protocols diff --git a/src/http/mod.rs b/src/http/mod.rs index c97e02bf..2fddf6e9 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -91,8 +91,8 @@ pub async fn receive_batch_json(body: impl AsyncRead) -> Result(&data) - .map_err(|e| ParseRequestError::InvalidRequest(Box::new(e)))?) + serde_json::from_slice::(&data) + .map_err(|e| ParseRequestError::InvalidRequest(Box::new(e))) } /// Receive a GraphQL request from a body as CBOR. diff --git a/src/look_ahead.rs b/src/look_ahead.rs index 90844c54..e8629707 100644 --- a/src/look_ahead.rs +++ b/src/look_ahead.rs @@ -38,7 +38,6 @@ impl<'a> Lookahead<'a> { self.fragments, &field.selection_set.node, name, - self.context, ) } @@ -108,7 +107,6 @@ fn filter<'a>( fragments: &'a HashMap>, selection_set: &'a SelectionSet, name: &str, - context: &'a Context<'a>, ) { for item in &selection_set.items { match &item.node { @@ -122,7 +120,6 @@ fn filter<'a>( fragments, &fragment.node.selection_set.node, name, - context, ), Selection::FragmentSpread(spread) => { if let Some(fragment) = fragments.get(&spread.node.fragment_name.node) { @@ -131,7 +128,6 @@ fn filter<'a>( fragments, &fragment.node.selection_set.node, name, - context, ) } }