diff --git a/examples/warp_subscriptions/Cargo.toml b/examples/warp_subscriptions/Cargo.toml index da05cf99..5cdc12d6 100644 --- a/examples/warp_subscriptions/Cargo.toml +++ b/examples/warp_subscriptions/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] async-stream = "0.3" env_logger = "0.9" -futures = "0.3.1" +futures = "0.3" juniper = { path = "../../juniper" } juniper_graphql_ws = { path = "../../juniper_graphql_ws" } juniper_warp = { path = "../../juniper_warp", features = ["subscriptions"] } diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml index ca5e24c6..7b3789ab 100644 --- a/juniper/Cargo.toml +++ b/juniper/Cargo.toml @@ -43,7 +43,7 @@ bson = { version = "2.4", features = ["chrono-0_4"], optional = true } chrono = { version = "0.4", features = ["alloc"], default-features = false, optional = true } chrono-tz = { version = "0.6", default-features = false, optional = true } fnv = "1.0.3" -futures = { version = "0.3.1", features = ["alloc"], default-features = false } +futures = { version = "0.3.22", features = ["alloc"], default-features = false } futures-enum = { version = "0.1.12", default-features = false } graphql-parser = { version = "0.4", optional = true } indexmap = { version = "1.0", features = ["serde-1"] } diff --git a/juniper/src/types/async_await.rs b/juniper/src/types/async_await.rs index 562bff7c..827a1d50 100644 --- a/juniper/src/types/async_await.rs +++ b/juniper/src/types/async_await.rs @@ -1,3 +1,5 @@ +use std::future; + use crate::{ ast::Selection, executor::{ExecutionResult, Executor}, @@ -254,7 +256,7 @@ where let is_non_null = meta_field.field_type.is_non_null(); let response_name = response_name.to_string(); - async_values.push(AsyncValueFuture::Field(async move { + async_values.push_back(AsyncValueFuture::Field(async move { // TODO: implement custom future type instead of // two-level boxing. let res = instance @@ -317,12 +319,12 @@ where if let Ok(Value::Object(obj)) = sub_result { for (k, v) in obj { - async_values.push(AsyncValueFuture::FragmentSpread(async move { - AsyncValue::Field(AsyncField { + async_values.push_back(AsyncValueFuture::FragmentSpread( + future::ready(AsyncValue::Field(AsyncField { name: k, value: Some(v), - }) - })); + })), + )); } } else if let Err(e) = sub_result { sub_exec.push_error_at(e, *start_pos); @@ -362,19 +364,19 @@ where if let Ok(Value::Object(obj)) = sub_result { for (k, v) in obj { - async_values.push(AsyncValueFuture::InlineFragment1(async move { - AsyncValue::Field(AsyncField { + async_values.push_back(AsyncValueFuture::InlineFragment1( + future::ready(AsyncValue::Field(AsyncField { name: k, value: Some(v), - }) - })); + })), + )); } } else if let Err(e) = sub_result { sub_exec.push_error_at(e, *start_pos); } } } else { - async_values.push(AsyncValueFuture::InlineFragment2(async move { + async_values.push_back(AsyncValueFuture::InlineFragment2(async move { let value = resolve_selection_set_into_async( instance, info, diff --git a/juniper_actix/Cargo.toml b/juniper_actix/Cargo.toml index bb60ff5f..0bcb8d4c 100644 --- a/juniper_actix/Cargo.toml +++ b/juniper_actix/Cargo.toml @@ -27,7 +27,7 @@ actix-http = "3.0" actix-web = "4.0" actix-web-actors = "4.1.0" anyhow = "1.0" -futures = "0.3" +futures = "0.3.22" juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } juniper_graphql_ws = { version = "0.4.0-dev", path = "../juniper_graphql_ws", optional = true } http = "0.2.4" diff --git a/juniper_codegen/Cargo.toml b/juniper_codegen/Cargo.toml index ef78a0a2..b2291658 100644 --- a/juniper_codegen/Cargo.toml +++ b/juniper_codegen/Cargo.toml @@ -30,6 +30,6 @@ url = "2.0" [dev-dependencies] derive_more = "0.99.7" -futures = "0.3" +futures = "0.3.22" juniper = { path = "../juniper" } serde = "1.0" diff --git a/juniper_hyper/Cargo.toml b/juniper_hyper/Cargo.toml index 0f2f6bb2..59f1c8a1 100644 --- a/juniper_hyper/Cargo.toml +++ b/juniper_hyper/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["apollo", "graphql", "hyper", "juniper"] exclude = ["/examples/", "/release.toml"] [dependencies] -futures = "0.3.1" +futures = "0.3.22" hyper = { version = "0.14", features = ["server", "runtime"] } juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } serde_json = "1.0" diff --git a/juniper_iron/Cargo.toml b/juniper_iron/Cargo.toml index 82c18f9c..7eef05d3 100644 --- a/juniper_iron/Cargo.toml +++ b/juniper_iron/Cargo.toml @@ -18,7 +18,7 @@ keywords = ["apollo", "graphql", "iron", "juniper"] exclude = ["/examples/", "/release.toml"] [dependencies] -futures = "0.3.1" +futures = "0.3.22" iron = ">= 0.5, < 0.7" juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } serde_json = "1.0.2" diff --git a/juniper_rocket/Cargo.toml b/juniper_rocket/Cargo.toml index dc275ee3..e715609e 100644 --- a/juniper_rocket/Cargo.toml +++ b/juniper_rocket/Cargo.toml @@ -18,7 +18,7 @@ keywords = ["apollo", "graphql", "juniper", "rocket"] exclude = ["/examples/", "/tests/", "/release.toml"] [dependencies] -futures = "0.3.1" +futures = "0.3.22" juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } rocket = { version = "=0.5.0-rc.2", default-features = false } serde_json = "1.0.2" diff --git a/juniper_subscriptions/Cargo.toml b/juniper_subscriptions/Cargo.toml index 8ccf40e5..8c6a14a5 100644 --- a/juniper_subscriptions/Cargo.toml +++ b/juniper_subscriptions/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["graphql", "server", "subscription", "web", "websocket"] exclude = ["/release.toml"] [dependencies] -futures = "0.3.1" +futures = "0.3.22" juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } [dev-dependencies] diff --git a/juniper_warp/Cargo.toml b/juniper_warp/Cargo.toml index bb704a20..361b00f5 100644 --- a/juniper_warp/Cargo.toml +++ b/juniper_warp/Cargo.toml @@ -23,7 +23,7 @@ subscriptions = ["juniper_graphql_ws"] [dependencies] anyhow = "1.0" -futures = "0.3.1" +futures = "0.3.22" juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } juniper_graphql_ws = { version = "0.4.0-dev", path = "../juniper_graphql_ws", optional = true } serde = { version = "1.0.75", features = ["derive"] } diff --git a/tests/codegen/Cargo.toml b/tests/codegen/Cargo.toml index 3efcfaef..eff4f4ad 100644 --- a/tests/codegen/Cargo.toml +++ b/tests/codegen/Cargo.toml @@ -8,7 +8,7 @@ publish = false rustversion = "1.0" [dev-dependencies] -futures = "0.3.1" +futures = "0.3" juniper = { path = "../../juniper" } serde_json = "1.0" tokio = { version = "1.0", features = ["rt", "time", "macros"] } diff --git a/tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr b/tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr index c8a00ea3..2d2feacb 100644 --- a/tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr +++ b/tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr @@ -1,8 +1,11 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied - --> fail/interface/trait/argument_wrong_default_array.rs:3:1 + --> fail/interface/trait/argument_wrong_default_array.rs:5:41 | 3 | #[graphql_interface] - | ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` + | -------------------- required by a bound introduced by this call +4 | trait Character { +5 | fn wrong(&self, #[graphql(default = [true, false, false])] input: [bool; 2]) -> bool; + | ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | = help: the following other types implement trait `From`: <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> @@ -14,5 +17,4 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied <[u128; 1] as From> <[u128; 2] as From> and 7 others - = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` - = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: required for `[bool; 3]` to implement `Into<[bool; 2]>` diff --git a/tests/codegen/fail/object/argument_wrong_default_array.stderr b/tests/codegen/fail/object/argument_wrong_default_array.stderr index 76357529..1d92be56 100644 --- a/tests/codegen/fail/object/argument_wrong_default_array.stderr +++ b/tests/codegen/fail/object/argument_wrong_default_array.stderr @@ -1,8 +1,11 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied - --> fail/object/argument_wrong_default_array.rs:5:1 + --> fail/object/argument_wrong_default_array.rs:7:41 | 5 | #[graphql_object] - | ^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` + | ----------------- required by a bound introduced by this call +6 | impl ObjA { +7 | fn wrong(&self, #[graphql(default = [true, false, false])] input: [bool; 2]) -> bool { + | ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | = help: the following other types implement trait `From`: <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> @@ -14,5 +17,4 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied <[u128; 1] as From> <[u128; 2] as From> and 7 others - = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` - = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: required for `[bool; 3]` to implement `Into<[bool; 2]>` diff --git a/tests/codegen/fail/subscription/argument_wrong_default_array.stderr b/tests/codegen/fail/subscription/argument_wrong_default_array.stderr index ea5ccd3c..6b4e5257 100644 --- a/tests/codegen/fail/subscription/argument_wrong_default_array.stderr +++ b/tests/codegen/fail/subscription/argument_wrong_default_array.stderr @@ -1,8 +1,11 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied - --> fail/subscription/argument_wrong_default_array.rs:10:1 + --> fail/subscription/argument_wrong_default_array.rs:14:29 | 10 | #[graphql_subscription] - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` + | ----------------------- required by a bound introduced by this call +... +14 | #[graphql(default = [true, false, false])] input: [bool; 2], + | ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | = help: the following other types implement trait `From`: <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> @@ -14,5 +17,4 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied <[u128; 1] as From> <[u128; 2] as From> and 7 others - = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` - = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: required for `[bool; 3]` to implement `Into<[bool; 2]>`