reactive_graph_graphql_schema/query/behaviours/
behaviour.rs1use async_graphql::Object;
2
3use reactive_graph_behaviour_model_api::BehaviourTypeId;
4use reactive_graph_graph::NamespacedTypeGetter;
5
6pub struct GraphQLBehaviour {
7 behaviour_ty: BehaviourTypeId,
8}
9
10#[Object(name = "Behaviour")]
12impl GraphQLBehaviour {
13 async fn namespace(&self) -> String {
15 self.behaviour_ty.namespace()
16 }
17
18 async fn name(&self) -> String {
20 self.behaviour_ty.type_name()
21 }
22}
23
24impl From<BehaviourTypeId> for GraphQLBehaviour {
25 fn from(behaviour_ty: BehaviourTypeId) -> Self {
26 GraphQLBehaviour { behaviour_ty }
27 }
28}