diff --git a/juniper_benchmarks/Cargo.toml b/juniper_benchmarks/Cargo.toml index 431a98f5..566e5b4f 100644 --- a/juniper_benchmarks/Cargo.toml +++ b/juniper_benchmarks/Cargo.toml @@ -10,9 +10,12 @@ edition = "2018" name = "benchmark" harness = false +[features] +async = ["juniper/async", "futures"] + [dependencies] -juniper = { path = "../juniper", features = ["async"] } -futures = "=0.3.1" +juniper = { path = "../juniper" } +futures = { version = "=0.3.1", optional = true } [dev-dependencies] criterion = "0.2.11" diff --git a/juniper_benchmarks/src/lib.rs b/juniper_benchmarks/src/lib.rs index 6cdb7a51..f7a031a5 100644 --- a/juniper_benchmarks/src/lib.rs +++ b/juniper_benchmarks/src/lib.rs @@ -105,6 +105,7 @@ pub fn execute(query: &str, vars: Variables) -> QueryResult { juniper::execute(query, None, &root, &vars, &ctx).map_err(|e| format!("{:?}", e)) } +#[cfg(feature = "async")] pub async fn execute_async(query: &str, vars: Variables) -> QueryResult { let root = new_schema(); let ctx = Context::new();