Skip to content

Commit

Permalink
Fix subscription
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Grund <jgrund@whamcloud.io>
  • Loading branch information
jgrund committed Jan 1, 2025
1 parent 13a8071 commit 838cbe3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions juniper_axum/src/subscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ where
Ok(match output {
graphql_transport_ws::Output::Message(msg) => {
serde_json::to_string(&msg)
.map(ws::Message::Text)
.map(ws::Message::text)
.unwrap_or_else(|e| {
ws::Message::Close(Some(ws::CloseFrame {
code: 1011, // CloseCode::Error
Expand Down Expand Up @@ -618,7 +618,7 @@ where
let output = s_rx
.map(|msg| {
Ok(serde_json::to_string(&msg)
.map(ws::Message::Text)
.map(ws::Message::text)
.unwrap_or_else(|e| {
ws::Message::Close(Some(ws::CloseFrame {
code: 1011, // CloseCode::Error
Expand Down
2 changes: 1 addition & 1 deletion juniper_axum/tests/ws_test_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl TestApp {
None => Err(anyhow!("No message received")),
Some(Err(e)) => Err(anyhow!("WebSocket error: {e}")),
Some(Ok(Message::Text(json))) => {
let actual: serde_json::Value = serde_json::from_str(&*json)
let actual: serde_json::Value = serde_json::from_str(&json)
.map_err(|e| anyhow!("Cannot deserialize received message: {e}"))?;
if actual != expected {
return Err(anyhow!(
Expand Down

0 comments on commit 838cbe3

Please # to comment.