Support latest Rocket master (#919)

This commit is contained in:
Christian Legnitto 2021-04-18 12:57:59 -10:00 committed by GitHub
parent 5ae930bfc7
commit 0e41a51789
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@ use juniper::{
tests::fixtures::starwars::schema::{Database, Query}, tests::fixtures::starwars::schema::{Database, Query},
EmptyMutation, EmptySubscription, RootNode, EmptyMutation, EmptySubscription, RootNode,
}; };
use rocket::{response::content, State}; use rocket::{response::content, Rocket, State};
type Schema = RootNode<'static, Query, EmptyMutation<Database>, EmptySubscription<Database>>; type Schema = RootNode<'static, Query, EmptyMutation<Database>, EmptySubscription<Database>>;
@ -31,7 +31,7 @@ fn post_graphql_handler(
#[rocket::main] #[rocket::main]
async fn main() { async fn main() {
rocket::ignite() Rocket::build()
.manage(Database::new()) .manage(Database::new())
.manage(Schema::new( .manage(Schema::new(
Query, Query,

View file

@ -521,7 +521,7 @@ mod tests {
self, get, self, get,
http::ContentType, http::ContentType,
local::asynchronous::{Client, LocalResponse}, local::asynchronous::{Client, LocalResponse},
post, routes, Rocket, State, post, routes, Build, Rocket, State,
}; };
type Schema = RootNode<'static, Query, EmptyMutation<Database>, EmptySubscription<Database>>; type Schema = RootNode<'static, Query, EmptyMutation<Database>, EmptySubscription<Database>>;
@ -608,12 +608,12 @@ mod tests {
assert_eq!(resp.await.status_code, 200); assert_eq!(resp.await.status_code, 200);
} }
fn make_rocket() -> Rocket { fn make_rocket() -> Rocket<Build> {
make_rocket_without_routes().mount("/", routes![post_graphql_handler, get_graphql_handler]) make_rocket_without_routes().mount("/", routes![post_graphql_handler, get_graphql_handler])
} }
fn make_rocket_without_routes() -> Rocket { fn make_rocket_without_routes() -> Rocket<Build> {
rocket::ignite().manage(Database::new()).manage(Schema::new( Rocket::build().manage(Database::new()).manage(Schema::new(
Query, Query,
EmptyMutation::<Database>::new(), EmptyMutation::<Database>::new(),
EmptySubscription::<Database>::new(), EmptySubscription::<Database>::new(),