Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions juniper_hyper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ where
.await
.map_err(GraphQLRequestError::BodyHyper)?;

let input = String::from_utf8(chunk.to_bytes().iter().cloned().collect())
.map_err(GraphQLRequestError::BodyUtf8)?;
let input =
String::from_utf8(chunk.to_bytes().into()).map_err(GraphQLRequestError::BodyUtf8)?;

serde_json::from_str::<GraphQLBatchRequest<S>>(&input)
.map_err(GraphQLRequestError::BodyJSONError)
Expand All @@ -135,8 +135,8 @@ where
.await
.map_err(GraphQLRequestError::BodyHyper)?;

let query = String::from_utf8(chunk.to_bytes().iter().cloned().collect())
.map_err(GraphQLRequestError::BodyUtf8)?;
let query =
String::from_utf8(chunk.to_bytes().into()).map_err(GraphQLRequestError::BodyUtf8)?;

Ok(GraphQLBatchRequest::Single(GraphQLRequest::new(
query, None, None,
Expand Down
8 changes: 6 additions & 2 deletions juniper_warp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ All user visible changes to `juniper_warp` crate will be documented in this file

### BC Breaks

- Bumped up [MSRV] to 1.85. ([#1272], [todo])
- Bumped up [MSRV] to 1.85. ([#1272], [1b1fc618])
- Switched to [0.4 version][warp-0.4] of [`warp` crate]. ([#1343])

[#1272]: /../../pull/1272
[todo]: /../../commit/todo
[#1343]: /../../pull/1343
[1b1fc618]: /../../commit/1b1fc61879ffdd640d741e187dc20678bf7ab295
[warp-0.4]: https://github.com/seanmonstar/warp/blob/v0.4.0/CHANGELOG.md#v040-august-5-2025



Expand Down Expand Up @@ -58,6 +61,7 @@ See [old CHANGELOG](/../../blob/juniper_warp-v0.7.0/juniper_warp/CHANGELOG.md).


[`juniper` crate]: https://docs.rs/juniper
[`warp` crate]: https://docs.rs/warp
[graphql-transport-ws]: https://github.com/enisdenjo/graphql-ws/blob/v5.14.0/PROTOCOL.md
[graphql-ws]: https://github.com/apollographql/subscriptions-transport-ws/blob/v0.11.0/PROTOCOL.md
[MSRV]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
Expand Down
12 changes: 9 additions & 3 deletions juniper_warp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,28 @@ juniper_graphql_ws = { version = "0.4.0", path = "../juniper_graphql_ws", featur
log = { version = "0.4", optional = true }
serde_json = "1.0.18"
tokio = { version = "1.0", features = ["rt"] }
warp = { version = "0.3.2", default-features = false }
warp = "0.4"

# Fixes for `minimal-versions` check.
# TODO: Try remove on upgrade of `warp` crate.
headers = "0.3.8"
http-body-util = "0.1.2"

[dev-dependencies]
async-stream = "0.3"
env_logger = "0.11"
futures = "0.3.22"
http-body-util = "0.1"
itertools = "0.14"
juniper = { version = "0.16", path = "../juniper", features = ["expose-test-schema"] }
log = "0.4"
percent-encoding = "2.1"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
url = "2.0"
warp = { version = "0.4", features = ["test"] }

# Fixes for `minimal-versions` check.
# TODO: Try remove on upgrade of `warp` crate.
hyper-util = "0.1.12"


[lints.clippy]
allow_attributes = "warn"
Expand Down
4 changes: 3 additions & 1 deletion juniper_warp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

// TODO: Try remove on upgrade of `warp` crate.
mod for_minimal_versions_check_only {
use headers as _;
use http_body_util as _;
#[cfg(test)]
use hyper_util as _;
}

mod response;
Expand Down
11 changes: 3 additions & 8 deletions juniper_warp/tests/http_test_suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![expect(unused_crate_dependencies, reason = "integration tests")]

use futures::TryStreamExt as _;
use http_body_util::BodyExt as _;
use itertools::Itertools as _;
use juniper::{
EmptyMutation, EmptySubscription, RootNode,
Expand Down Expand Up @@ -122,13 +122,8 @@ async fn into_test_response(resp: reply::Response) -> TestResponse {
})
.unwrap_or_default();

let body = String::from_utf8(
body.map_ok(|bytes| bytes.to_vec())
.try_concat()
.await
.unwrap(),
)
.unwrap_or_else(|e| panic!("not UTF-8 body: {e}"));
let body = String::from_utf8(body.collect().await.unwrap().to_bytes().into())
.unwrap_or_else(|e| panic!("not UTF-8 body: {e}"));

TestResponse {
status_code,
Expand Down
Loading