Make resolvers with returns work again

Note that this only fixes the non-async case
This commit is contained in:
Christian Legnitto 2019-11-03 22:07:40 -08:00
parent 321c3af38d
commit 560a172587
2 changed files with 1 additions and 4 deletions

View file

@ -95,8 +95,6 @@ impl Root {
Ok(0)
}
/*
* FIXME: make this work again
fn with_return() -> i32 {
return 0;
}
@ -104,7 +102,6 @@ impl Root {
fn with_return_field_result() -> FieldResult<i32> {
return Ok(0);
}
*/
}
graphql_interface!(Interface: () |&self| {

View file

@ -751,7 +751,7 @@ impl GraphQLTypeDefiniton {
};
quote!(
#name => {
let res #_type = { #code };
let res #_type = (|| { #code })();
#juniper_crate_name::IntoResolvable::into(
res,
executor.context()