reactive_graph_dynamic_graph_api/
entity_mutation_field_factory.rs

1use async_graphql::dynamic::Field;
2use async_trait::async_trait;
3use reactive_graph_graph::EntityType;
4use reactive_graph_graph::Namespace;
5use reactive_graph_lifecycle::Lifecycle;
6use springtime_di::injectable;
7
8#[injectable]
9#[async_trait]
10pub trait EntityMutationFieldFactory: Send + Sync + Lifecycle {
11    /// Creates the mutation fields for entity types in the given namespace.
12    fn create_mutation_fields(&self, namespace: &Namespace) -> Vec<Field>;
13
14    /// Creates the creation field for the given entity type.
15    fn create_creation_field(&self, entity_type: &EntityType) -> Field;
16}