Add features to juniper_benchmarks

This commit is contained in:
Christian Legnitto 2020-01-20 23:23:42 -08:00
parent ad3c7ef6d9
commit 6aebe5a30f
2 changed files with 6 additions and 2 deletions

View file

@ -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"

View file

@ -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();