diff --git a/src/schema/model.rs b/src/schema/model.rs index f1810a35..8836b638 100644 --- a/src/schema/model.rs +++ b/src/schema/model.rs @@ -21,6 +21,17 @@ pub struct RootNode { phantom_wrapped: PhantomData, } +// RootNode implements Send + Sync if both the mutation type and query +// type implements them. SchemaType also needs to implement them. +// +// InnerT does _not_ need to implement Send + Sync because it does not +// actually appear in the struct. +unsafe impl Send for RootNode + where QueryT: Send, MutationT: Send, SchemaType: Send { } + +unsafe impl Sync for RootNode + where QueryT: Sync, MutationT: Sync, SchemaType: Sync { } + /// Metadata for a schema pub struct SchemaType { types: HashMap,