diff --git a/juniper/src/types/containers.rs b/juniper/src/types/containers.rs index b2355742..e8b6d6e0 100644 --- a/juniper/src/types/containers.rs +++ b/juniper/src/types/containers.rs @@ -1,4 +1,5 @@ use std::{ + collections::HashSet, mem::{self, MaybeUninit}, ptr, }; @@ -220,7 +221,7 @@ where } } -impl GraphQLType for std::collections::HashSet +impl GraphQLType for HashSet where T: GraphQLType, S: ScalarValue, @@ -237,7 +238,7 @@ where } } -impl GraphQLValue for std::collections::HashSet +impl GraphQLValue for HashSet where T: GraphQLValue, S: ScalarValue, @@ -259,6 +260,24 @@ where } } +impl GraphQLValueAsync for HashSet +where + T: GraphQLValueAsync, + T::TypeInfo: Sync, + T::Context: Sync, + S: ScalarValue + Send + Sync, +{ + fn resolve_async<'a>( + &'a self, + info: &'a Self::TypeInfo, + _: Option<&'a [Selection]>, + executor: &'a Executor, + ) -> crate::BoxFuture<'a, ExecutionResult> { + let f = resolve_into_list_async(executor, info, self.iter()); + Box::pin(f) + } +} + impl GraphQLType for [T] where S: ScalarValue,