Skip to content

Commit 03e0bee

Browse files
tyranronjgrund
andcommitted
Backport upgrading 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 3d609ab commit 03e0bee

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

juniper_axum/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ All user visible changes to `juniper_axum` crate will be documented in this file
88

99
## master
1010

11+
### BC Breaks
12+
13+
- Upgraded to 0.8 version of [`axum` crate]. ([#1303], [#1306])
14+
1115
### Added
1216

1317
- Building on `wasm32-unknown-unknown` and `wasm32-wasi` targets. ([#1283], [#1282])
1418

1519
[#1282]: /../../issues/1282
1620
[#1283]: /../../pull/1283
21+
[#1303]: /../../pull/1303
22+
[#1306]: /../../pull/1306
1723

1824

1925

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.0", 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.0", 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

0 commit comments

Comments
 (0)