diff --git a/Makefile.toml b/Makefile.toml index 09b7b381..4c33aae7 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -86,13 +86,4 @@ private = true condition = { env_set = [ "RELEASE_LEVEL" ] } description = "Run `cargo-release` for every crate, but only make changes locally" command = "cargo-release" -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/../_build/release.toml", "--no-confirm", "--skip-publish", "--skip-push", "--skip-tag", "${RELEASE_LEVEL}"] - -[tasks.test-verbose] -dependencies = ["test-async-verbose"] - -[tasks.test-async-verbose] -description = "Runs cargo test with async feature" -category = "Test" -command = "cargo" -args = ["test", "--verbose", "--features", "async", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )"] \ No newline at end of file +args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/../_build/release.toml", "--no-confirm", "--skip-publish", "--skip-push", "--skip-tag", "${RELEASE_LEVEL}"] \ No newline at end of file diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml index 979aa99d..04f07daf 100644 --- a/docs/book/tests/Cargo.toml +++ b/docs/book/tests/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" build = "build.rs" [dependencies] -juniper = { path = "../../../juniper", features = ["async"] } +juniper = { path = "../../../juniper" } juniper_iron = { path = "../../../juniper_iron" } futures = "0.3.1" diff --git a/integration_tests/async_await/Cargo.toml b/integration_tests/async_await/Cargo.toml index 4134e3f9..c3abc53e 100644 --- a/integration_tests/async_await/Cargo.toml +++ b/integration_tests/async_await/Cargo.toml @@ -4,10 +4,7 @@ version = "0.1.0" authors = ["Christoph Herzog "] edition = "2018" -[features] -async = [] - [dependencies] -juniper = { path = "../../juniper", features = ["async"] } +juniper = { path = "../../juniper" } futures = "0.3.1" tokio = { version = "0.2", features = ["rt-core", "time", "macros"] } \ No newline at end of file diff --git a/integration_tests/juniper_tests/Cargo.toml b/integration_tests/juniper_tests/Cargo.toml index 89ae47f7..155e860d 100644 --- a/integration_tests/juniper_tests/Cargo.toml +++ b/integration_tests/juniper_tests/Cargo.toml @@ -4,12 +4,9 @@ version = "0.1.0" publish = false edition = "2018" -[features] -async = ["juniper/async", "futures"] - [dependencies] juniper = { path = "../../juniper" } -futures = { version = "0.3.1", optional = true } +futures = "0.3.1" [dev-dependencies] serde_json = { version = "1" } diff --git a/integration_tests/juniper_tests/src/codegen/derive_enum.rs b/integration_tests/juniper_tests/src/codegen/derive_enum.rs index e7528601..0e967bcb 100644 --- a/integration_tests/juniper_tests/src/codegen/derive_enum.rs +++ b/integration_tests/juniper_tests/src/codegen/derive_enum.rs @@ -4,7 +4,6 @@ use fnv::FnvHashMap; #[cfg(test)] use juniper::{self, DefaultScalarValue, FromInputValue, GraphQLType, InputValue, ToInputValue}; -#[cfg(feature = "async")] use futures; #[derive(juniper::GraphQLEnum, Debug, PartialEq)] diff --git a/integration_tests/juniper_tests/src/codegen/derive_object.rs b/integration_tests/juniper_tests/src/codegen/derive_object.rs index b283b542..b2d6389f 100644 --- a/integration_tests/juniper_tests/src/codegen/derive_object.rs +++ b/integration_tests/juniper_tests/src/codegen/derive_object.rs @@ -7,7 +7,6 @@ use juniper::{DefaultScalarValue, GraphQLObject}; #[cfg(test)] use juniper::{self, execute, EmptyMutation, GraphQLType, RootNode, Value, Variables}; -#[cfg(feature = "async")] use futures; #[derive(GraphQLObject, Debug, PartialEq)] diff --git a/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs b/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs index 191967be..3c5909f1 100644 --- a/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs +++ b/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs @@ -9,7 +9,6 @@ use juniper::{ GraphQLType, RootNode, Value, Variables, }; -#[cfg(feature = "async")] use futures; pub struct Query; diff --git a/integration_tests/juniper_tests/src/codegen/impl_union.rs b/integration_tests/juniper_tests/src/codegen/impl_union.rs index ec51097c..8e039335 100644 --- a/integration_tests/juniper_tests/src/codegen/impl_union.rs +++ b/integration_tests/juniper_tests/src/codegen/impl_union.rs @@ -1,4 +1,3 @@ -#[cfg(feature = "async")] use futures; // Trait. diff --git a/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs b/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs index 244b5c5c..f4861bcb 100644 --- a/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs +++ b/integration_tests/juniper_tests/src/codegen/scalar_value_transparent.rs @@ -1,5 +1,4 @@ use fnv::FnvHashMap; -#[cfg(feature = "async")] use futures; use juniper::{DefaultScalarValue, FromInputValue, GraphQLType, InputValue, ToInputValue}; diff --git a/integration_tests/juniper_tests/src/custom_scalar.rs b/integration_tests/juniper_tests/src/custom_scalar.rs index 50afc173..a8e77bac 100644 --- a/integration_tests/juniper_tests/src/custom_scalar.rs +++ b/integration_tests/juniper_tests/src/custom_scalar.rs @@ -1,6 +1,5 @@ extern crate serde_json; -#[cfg(feature = "async")] use futures; #[cfg(test)] diff --git a/integration_tests/juniper_tests/src/issue_371.rs b/integration_tests/juniper_tests/src/issue_371.rs index 749078d1..0c9a49c8 100644 --- a/integration_tests/juniper_tests/src/issue_371.rs +++ b/integration_tests/juniper_tests/src/issue_371.rs @@ -1,7 +1,6 @@ // Original author of this test is . use juniper::*; -#[cfg(feature = "async")] use futures; pub struct Context; diff --git a/integration_tests/juniper_tests/src/issue_398.rs b/integration_tests/juniper_tests/src/issue_398.rs index b1513588..87320ebd 100644 --- a/integration_tests/juniper_tests/src/issue_398.rs +++ b/integration_tests/juniper_tests/src/issue_398.rs @@ -1,7 +1,6 @@ // Original author of this test is . use juniper::*; -#[cfg(feature = "async")] use futures; struct Query; diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml index fcc7ef45..84ca66f1 100644 --- a/juniper/Cargo.toml +++ b/juniper/Cargo.toml @@ -24,7 +24,6 @@ harness = false path = "benches/bench.rs" [features] -async = ["juniper_codegen/async", "futures"] expose-test-schema = [] default = [ "bson", @@ -39,7 +38,7 @@ juniper_codegen = { version = "0.14.2", path = "../juniper_codegen" } bson = { version = "0.14.0", optional = true } chrono = { version = "0.4.0", optional = true } fnv = "1.0.3" -futures = { version = "0.3.1", optional = true } +futures = "0.3.1" indexmap = { version = "1.0.0", features = ["serde-1"] } serde = { version = "1.0.8" } serde_derive = { version = "1.0.2" } diff --git a/juniper/src/executor/mod.rs b/juniper/src/executor/mod.rs index c5209a7f..54c8063f 100644 --- a/juniper/src/executor/mod.rs +++ b/juniper/src/executor/mod.rs @@ -372,7 +372,6 @@ where } /// Resolve a single arbitrary value into an `ExecutionResult` - #[cfg(feature = "async")] pub async fn resolve_async(&self, info: &T::TypeInfo, value: &T) -> ExecutionResult where T: crate::GraphQLTypeAsync + Send + Sync, @@ -386,7 +385,6 @@ where } /// Resolve a single arbitrary value, mapping the context to a new type - #[cfg(feature = "async")] pub async fn resolve_with_ctx_async( &self, info: &T::TypeInfo, @@ -421,7 +419,6 @@ where /// Resolve a single arbitrary value into a return value /// /// If the field fails to resolve, `null` will be returned. - #[cfg(feature = "async")] pub async fn resolve_into_value_async(&self, info: &T::TypeInfo, value: &T) -> Value where T: crate::GraphQLTypeAsync + Send + Sync, @@ -747,7 +744,6 @@ where Ok((value, errors)) } -#[cfg(feature = "async")] pub async fn execute_validated_query_async<'a, 'b, QueryT, MutationT, CtxT, S>( document: &'b Document<'a, S>, operation: &'b Spanning>, diff --git a/juniper/src/executor_tests/mod.rs b/juniper/src/executor_tests/mod.rs index aefac036..dff2a5fb 100644 --- a/juniper/src/executor_tests/mod.rs +++ b/juniper/src/executor_tests/mod.rs @@ -5,8 +5,7 @@ mod introspection; mod variables; // FIXME: re-enable -#[cfg(not(feature = "async"))] +#[cfg(TODO)] mod interfaces_unions; -#[cfg(feature = "async")] mod async_await; diff --git a/juniper/src/http/mod.rs b/juniper/src/http/mod.rs index d4ce4d41..6d60690b 100644 --- a/juniper/src/http/mod.rs +++ b/juniper/src/http/mod.rs @@ -93,7 +93,6 @@ where )) } - #[cfg(feature = "async")] pub async fn execute_async<'a, CtxT, QueryT, MutationT>( &'a self, root_node: &'a RootNode<'a, QueryT, MutationT, S>, diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs index 4f1b0822..c04f65e6 100644 --- a/juniper/src/lib.rs +++ b/juniper/src/lib.rs @@ -184,7 +184,6 @@ pub use crate::{ /// A pinned, boxed future that can be polled. pub type BoxFuture<'a, T> = std::pin::Pin + 'a + Send>>; -#[cfg(feature = "async")] pub use crate::types::async_await::GraphQLTypeAsync; /// An error that prevented query execution @@ -258,7 +257,6 @@ where } /// Execute a query in a provided schema -#[cfg(feature = "async")] pub async fn execute_async<'a, S, CtxT, QueryT, MutationT>( document_source: &'a str, operation_name: Option<&str>, diff --git a/juniper/src/macros/scalar.rs b/juniper/src/macros/scalar.rs index b18f1bd4..239d1361 100644 --- a/juniper/src/macros/scalar.rs +++ b/juniper/src/macros/scalar.rs @@ -42,307 +42,6 @@ /// In addition to implementing `GraphQLType` for the type in question, /// `FromInputValue` and `ToInputValue` is also implemented. This makes the type /// usable as arguments and default values. -#[cfg(not(feature = "async"))] -#[macro_export] -macro_rules! graphql_scalar { - ( @as_expr $e:expr) => { $e }; - - ( - @generate, - meta = { - name = $name:ty, - outname = {$($outname:tt)+}, - scalar = {$($scalar:tt)+}, - $(description = $descr:tt,)* - }, - resolve = { - self_var = $resolve_self_var:ident, - body = $resolve_body: block, - return_type = $resolve_retun_type: ty, - }, - from_input_value = { - arg = $from_input_value_arg: ident, - result = $from_input_value_result: ty, - body = $from_input_value_body: block, - }, - from_str = { - value_arg = $from_str_arg: ident, - result = $from_str_result: ty, - body = $from_str_body: block, - lifetime = $from_str_lt: tt, - }, - - ) => { - $crate::__juniper_impl_trait!( - impl <$($scalar)+> GraphQLType for $name { - type Context = (); - type TypeInfo = (); - - fn name(_: &Self::TypeInfo) -> Option<&str> { - Some($crate::graphql_scalar!(@as_expr $($outname)+)) - } - - fn meta<'r>( - info: &Self::TypeInfo, - registry: &mut $crate::Registry<'r, $crate::__juniper_insert_generic!($($scalar)+)> - ) -> $crate::meta::MetaType<'r, $crate::__juniper_insert_generic!($($scalar)+)> - where - $crate::__juniper_insert_generic!($($scalar)+): 'r - { - let meta = registry.build_scalar_type::(info); - $( - let meta = meta.description($descr); - )* - meta.into_meta() - } - - fn resolve( - &$resolve_self_var, - _: &(), - _: Option<&[$crate::Selection<$crate::__juniper_insert_generic!($($scalar)+)>]>, - _: &$crate::Executor< - Self::Context, - $crate::__juniper_insert_generic!($($scalar)+) - >) -> $crate::ExecutionResult<$crate::__juniper_insert_generic!($($scalar)+)> { - Ok($resolve_body) - } - }); - - $crate::__juniper_impl_trait!( - impl<$($scalar)+> ToInputValue for $name { - fn to_input_value(&$resolve_self_var) -> $crate::InputValue<$crate::__juniper_insert_generic!($($scalar)+)> { - let v = $resolve_body; - $crate::ToInputValue::to_input_value(&v) - } - } - ); - - $crate::__juniper_impl_trait!( - impl<$($scalar)+> FromInputValue for $name { - fn from_input_value( - $from_input_value_arg: &$crate::InputValue<$crate::__juniper_insert_generic!($($scalar)+)> - ) -> $from_input_value_result { - $from_input_value_body - } - } - ); - - $crate::__juniper_impl_trait!( - impl<$($scalar)+> ParseScalarValue for $name { - fn from_str<$from_str_lt>($from_str_arg: $crate::parser::ScalarToken<$from_str_lt>) -> $from_str_result { - $from_str_body - } - } - ); - }; - - // No more items to parse - ( - @parse_functions, - meta = { - name = $name:ty, - outname = {$($outname:tt)+}, - scalar = {$($scalar:tt)+}, - $(description = $descr:tt,)* - }, - resolve = {$($resolve_body:tt)+}, - from_input_value = {$($from_input_value_body:tt)+}, - from_str = {$($from_str_body:tt)+}, - rest = - ) => { - $crate::graphql_scalar!( - @generate, - meta = { - name = $name, - outname = {$($outname)+}, - scalar = {$($scalar)+}, - $(description = $descr,)* - }, - resolve = {$($resolve_body)+}, - from_input_value = {$($from_input_value_body)+}, - from_str = {$($from_str_body)+}, - ); - }; - - ( - @parse_functions, - meta = { - name = $name:ty, - outname = {$($outname:tt)+}, - scalar = {$($scalar:tt)+}, - $(description = $descr:tt,)* - }, - $(from_input_value = {$($from_input_value_body:tt)+})*, - $(from_str = {$($from_str_body:tt)+})*, - rest = - ) => { - compile_error!("Missing resolve function"); - }; - - ( - @parse_functions, - meta = { - name = $name:ty, - outname = {$($outname:tt)+}, - scalar = {$($scalar:tt)+}, - $(description = $descr:tt,)* - }, - resolve = {$($resolve_body:tt)+}, - $(from_str = {$($from_str_body:tt)+})*, - rest = - ) => { - compile_error!("Missing from_input_value function"); - }; - - ( - @parse_functions, - meta = { - name = $name:ty, - outname = {$($outname:tt)+}, - scalar = {$($scalar:tt)+}, - $(description = $descr:tt,)* - }, - resolve = {$($resolve_body:tt)+}, - from_input_value = {$($from_input_value_body:tt)+}, - rest = - ) =>{ - compile_error!("Missing from_str function"); - }; - - - // resolve(&self) -> Value { ... } - ( - @parse_functions, - meta = {$($meta:tt)*}, - $(resolve = {$($resolve_body:tt)+},)* - $(from_input_value = {$($from_input_value_body:tt)+},)* - $(from_str = {$($from_str_body:tt)+},)* - rest = resolve(&$selfvar:ident) -> $return_ty:ty $body:block $($rest:tt)* - ) => { - $crate::graphql_scalar!( - @parse_functions, - meta = {$($meta)*}, - resolve = { - self_var = $selfvar, - body = $body, - return_type = $return_ty, - }, - $(from_input_value = {$($from_input_value_body)+},)* - $(from_str = {$($from_str_body)+},)* - rest = $($rest)* - ); - }; - - // from_input_value(arg: &InputValue) -> ... { ... } - ( - @parse_functions, - meta = { $($meta:tt)* }, - $(resolve = {$($resolve_body:tt)+})*, - $(from_input_value = {$($from_input_value_body:tt)+},)* - $(from_str = {$($from_str_body:tt)+},)* - rest = from_input_value($arg:ident: &InputValue) -> $result:ty $body:block $($rest:tt)* - ) => { - $crate::graphql_scalar!( - @parse_functions, - meta = { $($meta)* }, - $(resolve = {$($resolve_body)+},)* - from_input_value = { - arg = $arg, - result = $result, - body = $body, - }, - $(from_str = {$($from_str_body)+},)* - rest = $($rest)* - ); - }; - - // from_str(value: &str) -> Result - ( - @parse_functions, - meta = { $($meta:tt)* }, - $(resolve = {$($resolve_body:tt)+},)* - $(from_input_value = {$($from_input_value_body:tt)+},)* - $(from_str = {$($from_str_body:tt)+},)* - rest = from_str<$from_str_lt: tt>($value_arg:ident: ScalarToken<$ignored_lt2: tt>) -> $result:ty $body:block $($rest:tt)* - ) => { - $crate::graphql_scalar!( - @parse_functions, - meta = { $($meta)* }, - $(resolve = {$($resolve_body)+},)* - $(from_input_value = {$($from_input_value_body)+},)* - from_str = { - value_arg = $value_arg, - result = $result, - body = $body, - lifetime = $from_str_lt, - }, - rest = $($rest)* - ); - }; - - // description: - ( - @parse_functions, - meta = { - name = $name:ty, - outname = {$($outname:tt)+}, - scalar = {$($scalar:tt)+}, - }, - $(resolve = {$($resolve_body:tt)+},)* - $(from_input_value = {$($from_input_value_body:tt)+},)* - $(from_str = {$($from_str_body:tt)+},)* - rest = description: $descr:tt $($rest:tt)* - ) => { - $crate::graphql_scalar!( - @parse_functions, - meta = { - name = $name, - outname = {$($outname)+}, - scalar = {$($scalar)+}, - description = $descr, - }, - $(resolve = {$($resolve_body)+},)* - $(from_input_value = {$($from_input_value_body)+},)* - $(from_str = {$($from_str_body)+},)* - rest = $($rest)* - ); - }; - - ( - @parse, - meta = { - lifetimes = [], - name = $name: ty, - outname = {$($outname:tt)*}, - scalar = {$($scalar:tt)*}, - }, - rest = $($rest:tt)* - ) => { - $crate::graphql_scalar!( - @parse_functions, - meta = { - name = $name, - outname = {$($outname)*}, - scalar = {$($scalar)*}, - }, - rest = $($rest)* - ); - }; - - (@$($stuff:tt)*) => { - compile_error!("Invalid syntax for `graphql_scalar!`"); - }; - - ($($rest:tt)*) => { - $crate::__juniper_parse_object_header!( - callback = graphql_scalar, - rest = $($rest)* - ); - } -} - -// FIXME: prevent duplicating the whole macro for async. -#[cfg(feature = "async")] #[macro_export] macro_rules! graphql_scalar { ( @as_expr $e:expr) => { $e }; diff --git a/juniper/src/schema/schema.rs b/juniper/src/schema/schema.rs index b0c42664..e10d8037 100644 --- a/juniper/src/schema/schema.rs +++ b/juniper/src/schema/schema.rs @@ -75,7 +75,6 @@ where } } -#[cfg(feature = "async")] impl<'a, CtxT, S, QueryT, MutationT> crate::GraphQLTypeAsync for RootNode<'a, QueryT, MutationT, S> where @@ -93,7 +92,7 @@ where arguments: &'b Arguments, executor: &'b Executor, ) -> crate::BoxFuture<'b, ExecutionResult> { - use futures::future::{ready, FutureExt}; + use futures::future::ready; match field_name { "__schema" | "__type" => { let v = self.resolve_field(info, field_name, arguments, executor); diff --git a/juniper/src/types/async_await.rs b/juniper/src/types/async_await.rs index 53db423c..47899da5 100644 --- a/juniper/src/types/async_await.rs +++ b/juniper/src/types/async_await.rs @@ -1,5 +1,5 @@ use crate::{ - ast::{Directive, FromInputValue, InputValue, Selection}, + ast::Selection, value::{Object, ScalarValue, Value}, }; @@ -12,6 +12,7 @@ use crate::BoxFuture; use super::base::{is_excluded, merge_key_into, Arguments, GraphQLType}; +// TODO: docs. pub trait GraphQLTypeAsync: GraphQLType + Send + Sync where Self::Context: Send + Sync, @@ -62,7 +63,6 @@ where // Wrapper function around resolve_selection_set_into_async_recursive. // This wrapper is necessary because async fns can not be recursive. -#[cfg(feature = "async")] pub(crate) fn resolve_selection_set_into_async<'a, 'e, T, CtxT, S>( instance: &'a T, info: &'a T::TypeInfo, @@ -94,7 +94,6 @@ enum AsyncValue { Nested(Value), } -#[cfg(feature = "async")] pub(crate) async fn resolve_selection_set_into_async_recursive<'a, T, CtxT, S>( instance: &'a T, info: &'a T::TypeInfo, diff --git a/juniper/src/types/containers.rs b/juniper/src/types/containers.rs index 4af6bd0c..50cecac8 100644 --- a/juniper/src/types/containers.rs +++ b/juniper/src/types/containers.rs @@ -210,7 +210,6 @@ where Ok(Value::list(result)) } -#[cfg(feature = "async")] async fn resolve_into_list_async<'a, S, T, I>( executor: &'a Executor<'a, T::Context, S>, info: &'a T::TypeInfo, @@ -247,7 +246,6 @@ where Ok(Value::list(values)) } -#[cfg(feature = "async")] impl crate::GraphQLTypeAsync for Vec where T: crate::GraphQLTypeAsync, @@ -266,7 +264,6 @@ where } } -#[cfg(feature = "async")] impl crate::GraphQLTypeAsync for &[T] where T: crate::GraphQLTypeAsync, @@ -285,7 +282,6 @@ where } } -#[cfg(feature = "async")] impl crate::GraphQLTypeAsync for Option where T: crate::GraphQLTypeAsync, diff --git a/juniper/src/types/mod.rs b/juniper/src/types/mod.rs index a394161e..281adf49 100644 --- a/juniper/src/types/mod.rs +++ b/juniper/src/types/mod.rs @@ -5,5 +5,4 @@ pub mod pointers; pub mod scalars; pub mod utilities; -#[cfg(feature = "async")] pub mod async_await; diff --git a/juniper/src/types/pointers.rs b/juniper/src/types/pointers.rs index 12f783b7..f3c27091 100644 --- a/juniper/src/types/pointers.rs +++ b/juniper/src/types/pointers.rs @@ -129,7 +129,6 @@ where } } -#[cfg(feature = "async")] impl<'e, S, T> crate::GraphQLTypeAsync for &'e T where S: ScalarValue + Send + Sync, @@ -216,7 +215,6 @@ where } } -#[cfg(feature = "async")] impl<'e, S, T> crate::GraphQLTypeAsync for std::sync::Arc where S: ScalarValue + Send + Sync, @@ -230,7 +228,6 @@ where selection_set: Option<&'a [Selection]>, executor: &'a Executor, ) -> crate::BoxFuture<'a, crate::ExecutionResult> { - use futures::future; (**self).resolve_async(info, selection_set, executor) } } diff --git a/juniper/src/types/scalars.rs b/juniper/src/types/scalars.rs index e4c51336..39477f26 100644 --- a/juniper/src/types/scalars.rs +++ b/juniper/src/types/scalars.rs @@ -1,4 +1,3 @@ -#[cfg(feature = "async")] use futures; use serde_derive::{Deserialize, Serialize}; use std::{char, convert::From, marker::PhantomData, ops::Deref, u32}; @@ -196,7 +195,6 @@ where } } -#[cfg(feature = "async")] impl<'e, S> crate::GraphQLTypeAsync for &'e str where S: ScalarValue + Send + Sync, @@ -329,7 +327,6 @@ where } } -#[cfg(feature = "async")] impl crate::GraphQLTypeAsync for EmptyMutation where S: ScalarValue + Send + Sync, diff --git a/juniper_benchmarks/Cargo.toml b/juniper_benchmarks/Cargo.toml index 09dfbd9d..fd58ea73 100644 --- a/juniper_benchmarks/Cargo.toml +++ b/juniper_benchmarks/Cargo.toml @@ -9,11 +9,8 @@ edition = "2018" name = "benchmark" harness = false -[features] -async = [] - [dependencies] -juniper = { path = "../juniper", features = ["async"] } +juniper = { path = "../juniper" } futures = "0.3.1" [dev-dependencies] diff --git a/juniper_codegen/Cargo.toml b/juniper_codegen/Cargo.toml index 41c0cacd..b85b4e31 100644 --- a/juniper_codegen/Cargo.toml +++ b/juniper_codegen/Cargo.toml @@ -14,18 +14,15 @@ edition = "2018" [lib] proc-macro = true -[features] -async = ["futures"] - [dependencies] proc-macro2 = "1.0.1" syn = { version = "1.0.3", features = ["full", "extra-traits", "parsing"] } -quote = "1.0.2" +quote = "1.0.3" proc-macro-error = "0.3.4" -futures = { version = "0.3.1", optional = true } +futures = "0.3.1" [dev-dependencies] -juniper = { version = "0.14.2", path = "../juniper", features = ["async"] } +juniper = { version = "0.14.2", path = "../juniper"} [badges] travis-ci = { repository = "graphql-rust/juniper" } diff --git a/juniper_codegen/src/derive_enum.rs b/juniper_codegen/src/derive_enum.rs index 37f2c6a9..e404e79e 100644 --- a/juniper_codegen/src/derive_enum.rs +++ b/juniper_codegen/src/derive_enum.rs @@ -206,7 +206,6 @@ pub fn impl_enum(ast: &syn::DeriveInput, is_internal: bool) -> TokenStream { }); } - #[cfg(feature = "async")] let _async = quote!( impl<__S> #juniper_path::GraphQLTypeAsync<__S> for #ident where @@ -226,9 +225,6 @@ pub fn impl_enum(ast: &syn::DeriveInput, is_internal: bool) -> TokenStream { } ); - #[cfg(not(feature = "async"))] - let _async = quote!(); - let body = quote! { impl<__S> #juniper_path::GraphQLType<__S> for #ident where __S: diff --git a/juniper_codegen/src/derive_scalar_value.rs b/juniper_codegen/src/derive_scalar_value.rs index 0c457ca8..24320650 100644 --- a/juniper_codegen/src/derive_scalar_value.rs +++ b/juniper_codegen/src/derive_scalar_value.rs @@ -110,7 +110,6 @@ fn impl_scalar_struct( None => quote!(), }; - #[cfg(feature = "async")] let _async = quote!( impl <__S> #crate_name::GraphQLTypeAsync<__S> for #ident @@ -134,9 +133,6 @@ fn impl_scalar_struct( } ); - #[cfg(not(feature = "async"))] - let _async = quote!(); - quote!( #_async diff --git a/juniper_codegen/src/util/mod.rs b/juniper_codegen/src/util/mod.rs index 2b817b87..aa79c20d 100644 --- a/juniper_codegen/src/util/mod.rs +++ b/juniper_codegen/src/util/mod.rs @@ -830,7 +830,6 @@ impl GraphQLTypeDefiniton { }; let (impl_generics, _, where_clause) = generics.split_for_impl(); - #[cfg(feature = "async")] let resolve_field_async = { let resolve_matches_async = self.fields.iter().map(|field| { let name = &field.name; @@ -946,9 +945,6 @@ impl GraphQLTypeDefiniton { ) }; - #[cfg(not(feature = "async"))] - let resolve_field_async = quote!(); - let output = quote!( impl#impl_generics #juniper_crate_name::GraphQLType<#scalar> for #ty #type_generics_tokens #where_clause @@ -1011,7 +1007,7 @@ impl GraphQLTypeDefiniton { #[cfg(test)] mod test { use super::*; - use quote::__rt::*; + use quote::__private::*; use syn::{Ident, LitStr}; fn strs_to_strings(source: Vec<&str>) -> Vec { diff --git a/juniper_hyper/Cargo.toml b/juniper_hyper/Cargo.toml index a0f232bc..322c2844 100644 --- a/juniper_hyper/Cargo.toml +++ b/juniper_hyper/Cargo.toml @@ -8,9 +8,6 @@ documentation = "https://docs.rs/juniper_hyper" repository = "https://github.com/graphql-rust/juniper" edition = "2018" -[features] -async = ["juniper/async", "futures"] - [dependencies] serde = "1.0" serde_json = "1.0" @@ -19,7 +16,7 @@ url = "2" juniper = { version = "0.14.2", default-features = false, path = "../juniper"} tokio = "0.2" hyper = "0.13" -futures = { version = "0.3", optional = true } +futures = { version = "0.3.1" } [dev-dependencies] pretty_env_logger = "0.2" diff --git a/juniper_hyper/Makefile.toml b/juniper_hyper/Makefile.toml index d730517f..109c4028 100644 --- a/juniper_hyper/Makefile.toml +++ b/juniper_hyper/Makefile.toml @@ -8,8 +8,5 @@ condition = { channels = ["nightly"] } [tasks.test-verbose] condition = { channels = ["nightly"] } -[tasks.test-async-verbose] -condition = { channels = ["nightly"] } - [tasks.ci-coverage-flow] condition = { channels = ["nightly"] } diff --git a/juniper_hyper/src/lib.rs b/juniper_hyper/src/lib.rs index 6755f195..01924691 100644 --- a/juniper_hyper/src/lib.rs +++ b/juniper_hyper/src/lib.rs @@ -3,17 +3,14 @@ #[cfg(test)] extern crate reqwest; -#[cfg(feature = "async")] use futures; use hyper::{ header::{self, HeaderValue}, Body, Method, Request, Response, StatusCode, }; -#[cfg(feature = "async")] -use juniper::GraphQLTypeAsync; use juniper::{ http::GraphQLRequest as JuniperGraphQLRequest, serde::Deserialize, DefaultScalarValue, - GraphQLType, InputValue, RootNode, ScalarValue, + GraphQLType, GraphQLTypeAsync, InputValue, RootNode, ScalarValue, }; use serde_json::error::Error as SerdeError; use std::{error::Error, fmt, string::FromUtf8Error, sync::Arc}; @@ -53,7 +50,6 @@ where } } -#[cfg(feature = "async")] pub async fn graphql_async( root_node: Arc>, context: Arc, @@ -164,7 +160,6 @@ where resp } -#[cfg(feature = "async")] async fn execute_request_async( root_node: Arc>, context: Arc, @@ -309,7 +304,6 @@ where } } - #[cfg(feature = "async")] async fn execute_async<'a, CtxT: 'a, QueryT, MutationT>( self, root_node: Arc>, @@ -391,7 +385,7 @@ impl Error for GraphQLRequestError { } } } -#[cfg(feature = "async")] + #[cfg(test)] mod tests { use futures; diff --git a/juniper_iron/Cargo.toml b/juniper_iron/Cargo.toml index f5bab6d5..1b37451d 100644 --- a/juniper_iron/Cargo.toml +++ b/juniper_iron/Cargo.toml @@ -11,15 +11,12 @@ documentation = "https://docs.rs/juniper_iron" repository = "https://github.com/graphql-rust/juniper" edition = "2018" -[features] -# Fake feature to help CI. -async = [] - [dependencies] serde = { version = "1.0.2" } serde_json = { version = "1.0.2" } serde_derive = { version = "1.0.2" } juniper = { version = "0.14.2", path = "../juniper" } +futures = "0.3.1" urlencoded = { version = ">= 0.5, < 0.7" } iron = ">= 0.5, < 0.7" diff --git a/juniper_rocket/Cargo.toml b/juniper_rocket/Cargo.toml index e6e557aa..20da54a1 100644 --- a/juniper_rocket/Cargo.toml +++ b/juniper_rocket/Cargo.toml @@ -11,10 +11,6 @@ documentation = "https://docs.rs/juniper_rocket" repository = "https://github.com/graphql-rust/juniper" edition = "2018" -[features] -# Fake feature to help CI. -async = [] - [dependencies] serde = { version = "1.0.2" } serde_json = { version = "1.0.2" } diff --git a/juniper_rocket/Makefile.toml b/juniper_rocket/Makefile.toml index e5a871dc..8695d6a6 100644 --- a/juniper_rocket/Makefile.toml +++ b/juniper_rocket/Makefile.toml @@ -7,9 +7,6 @@ condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc [tasks.test-verbose] condition = { channels = ["nightly"] } -[tasks.test-async-verbose] -condition = { channels = ["nightly"] } - [tasks.test-verbose.windows] condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } } diff --git a/juniper_rocket_async/Cargo.toml b/juniper_rocket_async/Cargo.toml index 831ab660..0e896fdd 100644 --- a/juniper_rocket_async/Cargo.toml +++ b/juniper_rocket_async/Cargo.toml @@ -11,9 +11,6 @@ documentation = "https://docs.rs/juniper_rocket" repository = "https://github.com/graphql-rust/juniper" edition = "2018" -[features] -async = [ "juniper/async" ] - [dependencies] serde = { version = "1.0.2" } serde_json = { version = "1.0.2" } diff --git a/juniper_rocket_async/Makefile.toml b/juniper_rocket_async/Makefile.toml index e5a871dc..8695d6a6 100644 --- a/juniper_rocket_async/Makefile.toml +++ b/juniper_rocket_async/Makefile.toml @@ -7,9 +7,6 @@ condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc [tasks.test-verbose] condition = { channels = ["nightly"] } -[tasks.test-async-verbose] -condition = { channels = ["nightly"] } - [tasks.test-verbose.windows] condition = { channels = ["nightly"], env = { "TARGET" = "x86_64-pc-windows-msvc" } } diff --git a/juniper_rocket_async/src/lib.rs b/juniper_rocket_async/src/lib.rs index 4a19c856..9c5531c9 100644 --- a/juniper_rocket_async/src/lib.rs +++ b/juniper_rocket_async/src/lib.rs @@ -52,15 +52,10 @@ use rocket::{ }; use juniper::{http, InputValue}; - use juniper::{ serde::Deserialize, DefaultScalarValue, FieldError, GraphQLType, RootNode, ScalarValue, }; - -#[cfg(feature = "async")] use juniper::GraphQLTypeAsync; - -#[cfg(feature = "async")] use futures::future::{FutureExt, TryFutureExt}; #[derive(Debug, serde_derive::Deserialize, PartialEq)] @@ -110,7 +105,6 @@ where } } - #[cfg(feature = "async")] pub async fn execute_async<'a, CtxT, QueryT, MutationT>( &'a self, root_node: &'a RootNode<'_, QueryT, MutationT, S>, @@ -213,7 +207,6 @@ where } /// Asynchronously execute an incoming GraphQL query - #[cfg(feature = "async")] pub async fn execute_async( &self, root_node: &RootNode<'_, QueryT, MutationT, S>, diff --git a/juniper_warp/Cargo.toml b/juniper_warp/Cargo.toml index 4849d1be..4f38a248 100644 --- a/juniper_warp/Cargo.toml +++ b/juniper_warp/Cargo.toml @@ -8,9 +8,6 @@ documentation = "https://docs.rs/juniper_warp" repository = "https://github.com/graphql-rust/juniper" edition = "2018" -[features] -async = [ "juniper/async", "futures03" ] - [dependencies] warp = "0.1.8" juniper = { version = "0.14.2", path = "../juniper", default-features = false } diff --git a/juniper_warp/src/lib.rs b/juniper_warp/src/lib.rs index 35004fda..ada742f6 100644 --- a/juniper_warp/src/lib.rs +++ b/juniper_warp/src/lib.rs @@ -45,7 +45,6 @@ use serde::Deserialize; use std::sync::Arc; use warp::{filters::BoxedFilter, Filter}; -#[cfg(feature = "async")] use futures03::future::{FutureExt, TryFutureExt}; use juniper::{DefaultScalarValue, InputValue, ScalarValue}; @@ -87,7 +86,6 @@ where } } - #[cfg(feature = "async")] pub async fn execute_async<'a, CtxT, QueryT, MutationT>( &'a self, root_node: &'a juniper::RootNode<'a, QueryT, MutationT, S>, @@ -272,7 +270,6 @@ where } /// FIXME: docs -#[cfg(feature = "async")] pub fn make_graphql_filter_async( schema: juniper::RootNode<'static, Query, Mutation, S>, context_extractor: BoxedFilter<(Context,)>,