reactive_graph_graphql_schema/query/
mod.rs

1use async_graphql::*;
2use uuid::Uuid;
3
4pub use behaviours::*;
5pub use instances::*;
6pub use json_schema::*;
7pub use types::*;
8
9pub mod behaviours;
10pub mod instances;
11pub mod json_schema;
12pub mod types;
13
14pub struct ReactiveGraphQuery;
15
16/// Search queries for the type system, the instances and the flows.
17#[Object(name = "Query")]
18impl ReactiveGraphQuery {
19    /// Search for types (components, entity types, relation types).
20    async fn types(&self) -> Types {
21        Types
22    }
23
24    /// Search for instances (entity instances, relation instances).
25    async fn instances(&self) -> Instances {
26        Instances
27    }
28
29    /// Search for behaviours (entity behaviours, entity component behaviours, relation behaviours,
30    /// relation component behaviours).
31    async fn behaviours(&self) -> Behaviours {
32        Behaviours
33    }
34
35    /// JSON Schema definitions.
36    async fn json_schema(&self) -> JsonSchema {
37        JsonSchema
38    }
39
40    async fn random_uuid(&self, _context: &Context<'_>) -> String {
41        Uuid::new_v4().to_string()
42    }
43}