From 0929bad163bbe11b35ffc6a474832075498d9ffc Mon Sep 17 00:00:00 2001 From: Christian Legnitto Date: Sun, 3 Nov 2019 22:14:44 -0800 Subject: [PATCH] Fix non-async resolvers with returns in the async case --- juniper_codegen/src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/juniper_codegen/src/util.rs b/juniper_codegen/src/util.rs index 3182aedb..d6a71d59 100644 --- a/juniper_codegen/src/util.rs +++ b/juniper_codegen/src/util.rs @@ -901,7 +901,7 @@ impl GraphQLTypeDefiniton { quote!( #name => { - let res #_type = { #code }; + let res #_type = (||{ #code })(); let res2 = #juniper_crate_name::IntoResolvable::into( res, executor.context()