From cab6decdbc54f55692c205bd34f92a8d493a5fe7 Mon Sep 17 00:00:00 2001 From: Jade Devin Cabatlao Date: Sun, 22 Mar 2020 13:04:58 +0800 Subject: [PATCH] Implement GraphQLTypeAsync for Box (#582) --- juniper/src/types/pointers.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/juniper/src/types/pointers.rs b/juniper/src/types/pointers.rs index 6d32e4ac..b599b2ca 100644 --- a/juniper/src/types/pointers.rs +++ b/juniper/src/types/pointers.rs @@ -215,6 +215,23 @@ where } } +impl crate::GraphQLTypeAsync for Box +where + T: crate::GraphQLTypeAsync, + T::TypeInfo: Send + Sync, + S: ScalarValue + Send + Sync, + CtxT: Send + Sync, +{ + fn resolve_async<'a>( + &'a self, + info: &'a Self::TypeInfo, + selection_set: Option<&'a [Selection]>, + executor: &'a Executor, + ) -> crate::BoxFuture<'a, crate::ExecutionResult> { + (**self).resolve_async(info, selection_set, executor) + } +} + impl<'e, S, T> crate::GraphQLTypeAsync for std::sync::Arc where S: ScalarValue + Send + Sync,