Upgrade rocket
crate to 0.5.0-rc.2 version
This commit is contained in:
parent
6b3898b077
commit
1f0f683d0b
4 changed files with 10 additions and 8 deletions
|
@ -11,6 +11,7 @@ All user visible changes to `juniper_rocket` crate will be documented in this fi
|
|||
### BC Breaks
|
||||
|
||||
- Switched to 0.16 version of [`juniper` crate].
|
||||
- Switched to 0.5.0-rc.2 version of [`rocket` crate].
|
||||
|
||||
### Added
|
||||
|
||||
|
@ -30,4 +31,5 @@ See [old CHANGELOG](/../../blob/juniper_rocket-v0.8.1/juniper_rocket/CHANGELOG.m
|
|||
|
||||
|
||||
[`juniper` crate]: https://docs.rs/juniper
|
||||
[`rocket` crate]: https://docs.rs/rocket
|
||||
[Semantic Versioning 2.0.0]: https://semver.org
|
||||
|
|
|
@ -19,7 +19,7 @@ exclude = ["/examples/", "/tests/", "/release.toml"]
|
|||
[dependencies]
|
||||
futures = "0.3.1"
|
||||
juniper = { version = "0.16.0-dev", 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]
|
||||
|
|
|
@ -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<Database>, EmptySubscription<Database>>;
|
||||
|
||||
#[rocket::get("/")]
|
||||
fn graphiql() -> content::Html<String> {
|
||||
fn graphiql() -> content::RawHtml<String> {
|
||||
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,
|
||||
|
|
|
@ -46,8 +46,8 @@ pub struct GraphQLResponse(pub Status, pub String);
|
|||
pub fn graphiql_source(
|
||||
graphql_endpoint_url: &str,
|
||||
subscriptions_endpoint_url: Option<&str>,
|
||||
) -> content::Html<String> {
|
||||
content::Html(juniper::http::graphiql::graphiql_source(
|
||||
) -> content::RawHtml<String> {
|
||||
content::RawHtml(juniper::http::graphiql::graphiql_source(
|
||||
graphql_endpoint_url,
|
||||
subscriptions_endpoint_url,
|
||||
))
|
||||
|
@ -57,8 +57,8 @@ pub fn graphiql_source(
|
|||
pub fn playground_source(
|
||||
graphql_endpoint_url: &str,
|
||||
subscriptions_endpoint_url: Option<&str>,
|
||||
) -> content::Html<String> {
|
||||
content::Html(juniper::http::playground::playground_source(
|
||||
) -> content::RawHtml<String> {
|
||||
content::RawHtml(juniper::http::playground::playground_source(
|
||||
graphql_endpoint_url,
|
||||
subscriptions_endpoint_url,
|
||||
))
|
||||
|
|
Loading…
Reference in a new issue