diff --git a/juniper_rocket/CHANGELOG.md b/juniper_rocket/CHANGELOG.md index 064bca28..49b3bf27 100644 --- a/juniper_rocket/CHANGELOG.md +++ b/juniper_rocket/CHANGELOG.md @@ -2,6 +2,10 @@ - Compatibility with the latest `juniper`. +# [[0.8.2] 2022-05-25](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-v0.8.2) + +- `rocket` version is now `0.5.0-rc.2`. + # [[0.8.1] 2022-03-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-v0.8.1) - Ability to set custom request body size limit ([#1044](https://github.com/graphql-rust/juniper/pull/1044)). diff --git a/juniper_rocket/Cargo.toml b/juniper_rocket/Cargo.toml index d330b51d..fe36d6e2 100644 --- a/juniper_rocket/Cargo.toml +++ b/juniper_rocket/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "juniper_rocket" -version = "0.8.1" +version = "0.8.2" edition = "2018" authors = [ "Magnus Hallin ", @@ -14,7 +14,7 @@ repository = "https://github.com/graphql-rust/juniper" [dependencies] futures = "0.3.1" juniper = { version = "0.15.7", path = "../juniper", default-features = false } -rocket = { version = "0.5.0-rc.1", default-features = false } +rocket = { version = "=0.5.0-rc.2", default-features = false } serde_json = "1.0.2" [dev-dependencies] diff --git a/juniper_rocket/examples/rocket_server.rs b/juniper_rocket/examples/rocket_server.rs index 76a6b296..16ae6d12 100644 --- a/juniper_rocket/examples/rocket_server.rs +++ b/juniper_rocket/examples/rocket_server.rs @@ -2,12 +2,12 @@ use juniper::{ tests::fixtures::starwars::schema::{Database, Query}, EmptyMutation, EmptySubscription, RootNode, }; -use rocket::{response::content, Rocket, State}; +use rocket::{response::content, State}; type Schema = RootNode<'static, Query, EmptyMutation, EmptySubscription>; #[rocket::get("/")] -fn graphiql() -> content::Html { +fn graphiql() -> content::RawHtml { juniper_rocket::graphiql_source("/graphql", None) } @@ -31,7 +31,7 @@ fn post_graphql_handler( #[rocket::main] async fn main() { - Rocket::build() + let _ = rocket::build() .manage(Database::new()) .manage(Schema::new( Query, diff --git a/juniper_rocket/src/lib.rs b/juniper_rocket/src/lib.rs index 71b52ebe..827c43f6 100644 --- a/juniper_rocket/src/lib.rs +++ b/juniper_rocket/src/lib.rs @@ -36,7 +36,7 @@ Check the LICENSE file for details. */ -#![doc(html_root_url = "https://docs.rs/juniper_rocket/0.7.1")] +#![doc(html_root_url = "https://docs.rs/juniper_rocket/0.8.2")] use std::{borrow::Cow, io::Cursor}; @@ -72,8 +72,8 @@ pub struct GraphQLResponse(pub Status, pub String); pub fn graphiql_source( graphql_endpoint_url: &str, subscriptions_endpoint_url: Option<&str>, -) -> content::Html { - content::Html(juniper::http::graphiql::graphiql_source( +) -> content::RawHtml { + content::RawHtml(juniper::http::graphiql::graphiql_source( graphql_endpoint_url, subscriptions_endpoint_url, )) @@ -83,8 +83,8 @@ pub fn graphiql_source( pub fn playground_source( graphql_endpoint_url: &str, subscriptions_endpoint_url: Option<&str>, -) -> content::Html { - content::Html(juniper::http::playground::playground_source( +) -> content::RawHtml { + content::RawHtml(juniper::http::playground::playground_source( graphql_endpoint_url, subscriptions_endpoint_url, )) @@ -337,7 +337,10 @@ where }; Box::pin(async move { - let limit = req.limits().get("graphql").unwrap_or(BODY_LIMIT.bytes()); + let limit = req + .limits() + .get("graphql") + .unwrap_or_else(|| BODY_LIMIT.bytes()); let mut reader = data.open(limit); let mut body = String::new(); if let Err(e) = reader.read_to_string(&mut body).await {