Skip to content

Commit cab6dec

Browse files
authored
Implement GraphQLTypeAsync for Box (#582)
1 parent 5f777e8 commit cab6dec

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

juniper/src/types/pointers.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,23 @@ where
215215
}
216216
}
217217

218+
impl<S, T, CtxT> crate::GraphQLTypeAsync<S> for Box<T>
219+
where
220+
T: crate::GraphQLTypeAsync<S, Context = CtxT>,
221+
T::TypeInfo: Send + Sync,
222+
S: ScalarValue + Send + Sync,
223+
CtxT: Send + Sync,
224+
{
225+
fn resolve_async<'a>(
226+
&'a self,
227+
info: &'a Self::TypeInfo,
228+
selection_set: Option<&'a [Selection<S>]>,
229+
executor: &'a Executor<Self::Context, S>,
230+
) -> crate::BoxFuture<'a, crate::ExecutionResult<S>> {
231+
(**self).resolve_async(info, selection_set, executor)
232+
}
233+
}
234+
218235
impl<'e, S, T> crate::GraphQLTypeAsync<S> for std::sync::Arc<T>
219236
where
220237
S: ScalarValue + Send + Sync,

0 commit comments

Comments
 (0)