From 0bf9cf8e4a97d4d0af14a6d05aa48fc9c75b5d76 Mon Sep 17 00:00:00 2001 From: Daniel Wiesenberg Date: Wed, 28 Oct 2020 15:05:28 +0100 Subject: [PATCH 1/2] Point Rocket to repo with arangors included --- integrations/rocket/Cargo.toml | 3 ++- integrations/rocket/src/lib.rs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/integrations/rocket/Cargo.toml b/integrations/rocket/Cargo.toml index ce7a5546..6616be28 100644 --- a/integrations/rocket/Cargo.toml +++ b/integrations/rocket/Cargo.toml @@ -16,7 +16,8 @@ categories = ["network-programming", "asynchronous"] [dependencies] async-graphql = { path = "../..", version = "=2.8.5" } -rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "2893ce7", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released +#rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "2893ce7", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released +rocket = { git = "https://github.com/Weasy666/Rocket", default-features = false } serde = "1.0.125" serde_json = "1.0.64" tokio-util = { version = "0.6.5", default-features = false, features = ["compat"] } diff --git a/integrations/rocket/src/lib.rs b/integrations/rocket/src/lib.rs index 18ce8fc0..1272a3c8 100644 --- a/integrations/rocket/src/lib.rs +++ b/integrations/rocket/src/lib.rs @@ -12,6 +12,7 @@ #![forbid(unsafe_code)] use std::io::Cursor; +use core::any::Any; use async_graphql::http::MultipartOptions; use async_graphql::{ObjectType, ParseRequestError, Schema, SubscriptionType}; @@ -112,6 +113,12 @@ impl Request { { Response(schema.execute(self.0).await.into()) } + + /// Insert some data for this request. + pub fn data(mut self, data: D) -> Self { + self.0.data.insert(data); + self + } } impl From for Request { From e2848070e0234b3be44430fca70d480373ed32c1 Mon Sep 17 00:00:00 2001 From: Daniel Wiesenberg Date: Thu, 20 May 2021 11:59:51 +0200 Subject: [PATCH 2/2] Update Rocket to latest commit on master --- examples | 2 +- integrations/rocket/Cargo.toml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples b/examples index 4a5cfe2f..64e75d3c 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 4a5cfe2fc16061e8febd74b0e18f2d30b1cc07e5 +Subproject commit 64e75d3c3f0acbbf62412f966727581e96f70e0e diff --git a/integrations/rocket/Cargo.toml b/integrations/rocket/Cargo.toml index 6616be28..91739f11 100644 --- a/integrations/rocket/Cargo.toml +++ b/integrations/rocket/Cargo.toml @@ -16,8 +16,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] async-graphql = { path = "../..", version = "=2.8.5" } -#rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "2893ce7", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released -rocket = { git = "https://github.com/Weasy666/Rocket", default-features = false } -serde = "1.0.125" +rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "fa3e033", default-features = false } # TODO: Change to Cargo crate when Rocket 0.5.0 is released +serde = "1.0.126" serde_json = "1.0.64" -tokio-util = { version = "0.6.5", default-features = false, features = ["compat"] } +tokio-util = { version = "0.6.7", default-features = false, features = ["compat"] }