reactive_graph_dynamic_graph_api/
union_manager.rs

1use async_graphql::dynamic::Union;
2use async_trait::async_trait;
3use springtime_di::injectable;
4
5use reactive_graph_lifecycle::Lifecycle;
6
7pub const UNION_ALL_ENTITIES: &str = "AllEntities";
8pub const UNION_NAMESPACE_ENTITIES_SUFFIX: &str = "Entities";
9
10pub const UNION_ALL_RELATIONS: &str = "AllRelations";
11pub const UNION_NAMESPACE_RELATIONS_SUFFIX: &str = "Relations";
12
13pub const UNION_ALL_FLOWS: &str = "AllFlows";
14pub const UNION_NAMESPACE_FLOWS_SUFFIX: &str = "Flows";
15
16#[injectable]
17#[async_trait]
18pub trait UnionManager: Send + Sync + Lifecycle {
19    /// Returns the unions of the dynamic graph.
20    fn get_unions(&self) -> Vec<Union>;
21
22    /// Returns the union for all entity types.
23    fn all_entities(&self) -> Union;
24
25    /// Returns the union for all relation types.
26    fn all_relations(&self) -> Union;
27
28    /// Returns the union for all flow types.
29    fn all_flows(&self) -> Union;
30}