Skip to content

Commit d193cdc

Browse files
tyranronjgrund
andauthored
Upgrade axum crate from 0.7 to 0.8 version (#1306, #1303, #1305)
Signed-off-by: Joe Grund <[email protected]> Co-authored-by: Joe Grund <[email protected]>
1 parent fb74576 commit d193cdc

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

juniper_axum/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All user visible changes to `juniper_axum` crate will be documented in this file
1111
### BC Breaks
1212

1313
- Bumped up [MSRV] to 1.75. ([#1272])
14+
- Upgraded to 0.8 version of [`axum` crate]. ([#1303], [#1306])
1415

1516
### Added
1617

@@ -19,6 +20,8 @@ All user visible changes to `juniper_axum` crate will be documented in this file
1920
[#1272]: /../../pull/1272
2021
[#1282]: /../../issues/1282
2122
[#1283]: /../../pull/1283
23+
[#1303]: /../../pull/1303
24+
[#1306]: /../../pull/1306
2225

2326

2427

juniper_axum/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rustdoc-args = ["--cfg", "docsrs"]
2525
subscriptions = ["axum/ws", "juniper_graphql_ws/graphql-ws", "dep:futures"]
2626

2727
[dependencies]
28-
axum = { version = "0.7", features = ["json", "query"], default-features = false }
28+
axum = { version = "0.8", features = ["json", "query"], default-features = false }
2929
futures = { version = "0.3.22", optional = true }
3030
juniper = { version = "0.16", path = "../juniper", default-features = false }
3131
juniper_graphql_ws = { version = "0.4.0", path = "../juniper_graphql_ws", features = ["graphql-transport-ws"] }
@@ -38,7 +38,7 @@ bytes = "1.2"
3838

3939
[dev-dependencies]
4040
anyhow = "1.0"
41-
axum = { version = "0.7", features = ["http1", "macros", "tokio"] }
41+
axum = { version = "0.8.1", features = ["http1", "macros", "tokio"] }
4242
futures = "0.3.22"
4343
juniper = { version = "0.16", path = "../juniper", features = ["expose-test-schema"] }
4444
tokio = { version = "1.20", features = ["macros", "net", "rt-multi-thread", "time"] }

juniper_axum/src/extract.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use std::fmt;
44

55
use axum::{
6-
async_trait,
76
body::Body,
87
extract::{FromRequest, FromRequestParts, Query},
98
http::{header, HeaderValue, Method, Request, StatusCode},
@@ -70,7 +69,6 @@ pub struct JuniperRequest<S = DefaultScalarValue>(pub GraphQLBatchRequest<S>)
7069
where
7170
S: ScalarValue;
7271

73-
#[async_trait]
7472
impl<S, State> FromRequest<State> for JuniperRequest<S>
7573
where
7674
S: ScalarValue,

juniper_axum/src/subscriptions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ where
488488
Ok(match output {
489489
graphql_transport_ws::Output::Message(msg) => {
490490
serde_json::to_string(&msg)
491-
.map(ws::Message::Text)
491+
.map(ws::Message::text)
492492
.unwrap_or_else(|e| {
493493
ws::Message::Close(Some(ws::CloseFrame {
494494
code: 1011, // CloseCode::Error
@@ -618,7 +618,7 @@ where
618618
let output = s_rx
619619
.map(|msg| {
620620
Ok(serde_json::to_string(&msg)
621-
.map(ws::Message::Text)
621+
.map(ws::Message::text)
622622
.unwrap_or_else(|e| {
623623
ws::Message::Close(Some(ws::CloseFrame {
624624
code: 1011, // CloseCode::Error

juniper_axum/tests/ws_test_suite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl TestApp {
8888
None => Err(anyhow!("No message received")),
8989
Some(Err(e)) => Err(anyhow!("WebSocket error: {e}")),
9090
Some(Ok(Message::Text(json))) => {
91-
let actual: serde_json::Value = serde_json::from_str(&*json)
91+
let actual: serde_json::Value = serde_json::from_str(&json)
9292
.map_err(|e| anyhow!("Cannot deserialize received message: {e}"))?;
9393
if actual != expected {
9494
return Err(anyhow!(

0 commit comments

Comments
 (0)