Skip to content

Commit e823452

Browse files
committed
Release juniper_rocket 0.8.2 backporting upgrade to rocket 0.5.0-rc.2
1 parent 1cb305c commit e823452

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

juniper_rocket/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
- Compatibility with the latest `juniper`.
44

5+
# [[0.8.2] 2022-05-25](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-v0.8.2)
6+
7+
- `rocket` version is now `0.5.0-rc.2`.
8+
59
# [[0.8.1] 2022-03-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-v0.8.1)
610

711
- Ability to set custom request body size limit ([#1044](https://github.com/graphql-rust/juniper/pull/1044)).

juniper_rocket/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "juniper_rocket"
3-
version = "0.8.1"
3+
version = "0.8.2"
44
edition = "2018"
55
authors = [
66
"Magnus Hallin <[email protected]>",
@@ -14,7 +14,7 @@ repository = "https://github.com/graphql-rust/juniper"
1414
[dependencies]
1515
futures = "0.3.1"
1616
juniper = { version = "0.15.7", path = "../juniper", default-features = false }
17-
rocket = { version = "0.5.0-rc.1", default-features = false }
17+
rocket = { version = "=0.5.0-rc.2", default-features = false }
1818
serde_json = "1.0.2"
1919

2020
[dev-dependencies]

juniper_rocket/examples/rocket_server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use juniper::{
22
tests::fixtures::starwars::schema::{Database, Query},
33
EmptyMutation, EmptySubscription, RootNode,
44
};
5-
use rocket::{response::content, Rocket, State};
5+
use rocket::{response::content, State};
66

77
type Schema = RootNode<'static, Query, EmptyMutation<Database>, EmptySubscription<Database>>;
88

99
#[rocket::get("/")]
10-
fn graphiql() -> content::Html<String> {
10+
fn graphiql() -> content::RawHtml<String> {
1111
juniper_rocket::graphiql_source("/graphql", None)
1212
}
1313

@@ -31,7 +31,7 @@ fn post_graphql_handler(
3131

3232
#[rocket::main]
3333
async fn main() {
34-
Rocket::build()
34+
let _ = rocket::build()
3535
.manage(Database::new())
3636
.manage(Schema::new(
3737
Query,

juniper_rocket/src/lib.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Check the LICENSE file for details.
3636
3737
*/
3838

39-
#![doc(html_root_url = "https://docs.rs/juniper_rocket/0.7.1")]
39+
#![doc(html_root_url = "https://docs.rs/juniper_rocket/0.8.2")]
4040

4141
use std::{borrow::Cow, io::Cursor};
4242

@@ -72,8 +72,8 @@ pub struct GraphQLResponse(pub Status, pub String);
7272
pub fn graphiql_source(
7373
graphql_endpoint_url: &str,
7474
subscriptions_endpoint_url: Option<&str>,
75-
) -> content::Html<String> {
76-
content::Html(juniper::http::graphiql::graphiql_source(
75+
) -> content::RawHtml<String> {
76+
content::RawHtml(juniper::http::graphiql::graphiql_source(
7777
graphql_endpoint_url,
7878
subscriptions_endpoint_url,
7979
))
@@ -83,8 +83,8 @@ pub fn graphiql_source(
8383
pub fn playground_source(
8484
graphql_endpoint_url: &str,
8585
subscriptions_endpoint_url: Option<&str>,
86-
) -> content::Html<String> {
87-
content::Html(juniper::http::playground::playground_source(
86+
) -> content::RawHtml<String> {
87+
content::RawHtml(juniper::http::playground::playground_source(
8888
graphql_endpoint_url,
8989
subscriptions_endpoint_url,
9090
))
@@ -337,7 +337,10 @@ where
337337
};
338338

339339
Box::pin(async move {
340-
let limit = req.limits().get("graphql").unwrap_or(BODY_LIMIT.bytes());
340+
let limit = req
341+
.limits()
342+
.get("graphql")
343+
.unwrap_or_else(|| BODY_LIMIT.bytes());
341344
let mut reader = data.open(limit);
342345
let mut body = String::new();
343346
if let Err(e) = reader.read_to_string(&mut body).await {

0 commit comments

Comments
 (0)