reactive_graph_dynamic_graph_api/
flow_mutation_field_factory.rs

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