reactive_graph_dynamic_graph_api/
relation_mutation_object_factory.rs

1use async_graphql::dynamic::Field;
2use async_graphql::dynamic::Object;
3use async_trait::async_trait;
4use reactive_graph_graph::RelationType;
5use reactive_graph_lifecycle::Lifecycle;
6use springtime_di::injectable;
7
8#[injectable]
9#[async_trait]
10pub trait RelationMutationObjectFactory: Send + Sync + Lifecycle {
11    /// Creates the mutation objects for all relation types.
12    fn create_mutation_objects(&self) -> Vec<Object>;
13
14    /// Creates the mutation object for the given relation type.
15    fn create_mutation_object(&self, relation_type: RelationType) -> Object;
16
17    /// Creates the update field in the mutation object for the given relation type.
18    fn create_update_field(&self, relation_type: &RelationType) -> Option<Field>;
19
20    /// Creates the trigger field in the mutation object for the given relation type.
21    fn create_trigger_field(&self, relation_type: &RelationType) -> Option<Field>;
22
23    /// Creates the export field in the mutation object for the given relation type.
24    fn create_export_field(&self) -> Field;
25
26    /// Creates the delete field in the mutation object for the given relation type.
27    fn create_delete_field(&self) -> Field;
28}