Skip to content

Commit 3132cd0

Browse files
committed
Upgrade to axum v0.8
1 parent 33282a1 commit 3132cd0

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

integrations/axum/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ version = "7.0.13"
1414
[dependencies]
1515
async-graphql.workspace = true
1616

17-
async-trait.workspace = true
1817
bytes.workspace = true
1918
futures-util.workspace = true
2019
serde_json.workspace = true
@@ -27,7 +26,7 @@ tokio-stream = "0.1.15"
2726
tower-service = "0.3"
2827

2928
[target.'cfg(target_arch = "wasm32")'.dependencies]
30-
axum = { version = "0.7.5", default-features = false }
29+
axum = { version = "0.8.1", default-features = false }
3130

3231
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
33-
axum = { version = "0.7.5", features = ["ws"] }
32+
axum = { version = "0.8.1", features = ["ws"] }

integrations/axum/src/extract.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ pub mod rejection {
5757
}
5858
}
5959

60-
#[async_trait::async_trait]
6160
impl<S, R> FromRequest<S> for GraphQLRequest<R>
6261
where
6362
S: Send + Sync,
@@ -90,7 +89,6 @@ impl<R> GraphQLBatchRequest<R> {
9089
}
9190
}
9291

93-
#[async_trait::async_trait]
9492
impl<S, R> FromRequest<S> for GraphQLBatchRequest<R>
9593
where
9694
S: Send + Sync,

integrations/axum/src/subscription.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{borrow::Cow, convert::Infallible, future::Future, str::FromStr, time::Duration};
1+
use std::{convert::Infallible, future::Future, str::FromStr, time::Duration};
22

33
use async_graphql::{
44
futures_util::task::{Context, Poll},
@@ -32,7 +32,6 @@ use tower_service::Service;
3232
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
3333
pub struct GraphQLProtocol(WebSocketProtocols);
3434

35-
#[async_trait::async_trait]
3635
impl<S> FromRequestParts<S> for GraphQLProtocol
3736
where
3837
S: Send + Sync,
@@ -284,10 +283,10 @@ where
284283
.on_ping(self.on_ping.clone())
285284
.keepalive_timeout(self.keepalive_timeout)
286285
.map(|msg| match msg {
287-
WsMessage::Text(text) => Message::Text(text),
286+
WsMessage::Text(text) => Message::Text(text.into()),
288287
WsMessage::Close(code, status) => Message::Close(Some(CloseFrame {
289288
code,
290-
reason: Cow::from(status),
289+
reason: status.into(),
291290
})),
292291
});
293292

0 commit comments

Comments
 (0)