diff --git a/README.md b/README.md index 45cdd7b8..7453eddf 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ cargo bench -- "chat run" #measure all with jemalloc cargo bench --features jemalloc -#measure only simple run with jemalloc +#measure only simple run with jemalloc cargo bench --features jemalloc -- "simple run" ``` @@ -94,6 +94,7 @@ Read more here: https://bheisler.github.io/criterion.rs/book/criterion_rs.html * Actix-web [async-graphql-actix-web](https://crates.io/crates/async-graphql-actix-web) * Warp [async-graphql-warp](https://crates.io/crates/async-graphql-warp) * Tide [async-graphql-tide](https://crates.io/crates/async-graphql-tide) +* Rocket [async-graphql-rocket](https://github.com/async-graphql/async-graphql/tree/master/integrations/rocket) ## License diff --git a/docs/en/src/integrations.md b/docs/en/src/integrations.md index 5ed956a9..136f51b6 100644 --- a/docs/en/src/integrations.md +++ b/docs/en/src/integrations.md @@ -5,5 +5,6 @@ - Actix-web [async-graphql-actix-web](https://crates.io/crates/async-graphql-actix-web) - Warp [async-graphql-warp](https://crates.io/crates/async-graphql-warp) - Tide [async-graphql-tide](https://crates.io/crates/async-graphql-tide) +- Rocket [async-graphql-rocket](https://github.com/async-graphql/async-graphql/tree/master/integrations/rocket) **Even if the server you are currently using is not in the above list, it is quite simple to implement similar functionality yourself.** diff --git a/examples b/examples index 1c6f9821..d635246b 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 1c6f98211dec59f512fc2628b17d8e7d5a74bba6 +Subproject commit d635246bdc9a1eb0d115efb6ba890a417defb394 diff --git a/integrations/rocket/Cargo.toml b/integrations/rocket/Cargo.toml index 186b969d..7154a6d9 100644 --- a/integrations/rocket/Cargo.toml +++ b/integrations/rocket/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async-graphql-rocket" -version = "2.0.3" +version = "2.0.8" authors = ["Daniel Wiesenberg "] edition = "2018" description = "async-graphql for Rocket.rs" @@ -16,7 +16,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] async-graphql = { path = "../..", version = "=2.0.8" } -rocket = { git = "https://github.com/SergioBenitez/Rocket/", rev = "8da034a", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released -serde = "1.0.116" +rocket = { git = "https://github.com/SergioBenitez/Rocket/", rev = "0c150c2", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released +serde = "1.0.117" serde_json = "1.0.59" tokio-util = { version = "0.3.1", default-features = false, features = ["compat"] } diff --git a/integrations/rocket/src/lib.rs b/integrations/rocket/src/lib.rs index 704d796a..ccb91462 100644 --- a/integrations/rocket/src/lib.rs +++ b/integrations/rocket/src/lib.rs @@ -33,7 +33,7 @@ mod query_deserializer; /// # Examples /// /// ```ignore -/// #[rocket::post("/graphql", data = "", format = "application/json")] +/// #[rocket::post("/graphql", data = "", format = "application/json", rank = 1)] /// async fn graphql_request(schema: State<'_, ExampleSchema>, request: BatchRequest) -> Response { /// request.execute(&schema).await /// } @@ -93,12 +93,12 @@ impl FromData for BatchRequest { /// # Examples /// /// ```ignore -/// #[rocket::post("/graphql?")] +/// #[rocket::post("/graphql?", rank = 2)] /// async fn graphql_query(schema: State<'_, ExampleSchema>, query: Request) -> Result { /// query.execute(&schema).await /// } /// -/// #[rocket::post("/graphql", data = "", format = "application/json")] +/// #[rocket::post("/graphql", data = "", format = "application/json", rank = 1)] /// async fn graphql_request(schema: State<'_, ExampleSchema>, request: Request) -> Result { /// request.execute(&schema).await /// } diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs index e40cdb07..fdb109c4 100644 --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -131,10 +131,7 @@ impl Registry { write!(sdl, "type {} ", name).ok(); if let Some(implements) = self.implements.get(name) { if !implements.is_empty() { - write!(sdl, "implements ").ok(); - for interface in implements { - write!(sdl, "& {} ", interface).ok(); - } + write!(sdl, "implements {} ", implements.iter().map(AsRef::as_ref).collect::>().join(" & ")).ok(); } }