fluentci_graphql/schema/objects/
cache.rs1use async_graphql::{InputObject, Object, ID};
2use fluentci_types::cache as types;
3
4pub mod input {
5 use super::*;
6
7 #[derive(Debug, Clone, InputObject)]
8 pub struct CacheInput {
9 pub id: ID,
10 }
11}
12
13#[derive(Debug, Clone, Default)]
14pub struct Cache {
15 pub id: ID,
16 pub key: String,
17}
18
19#[Object]
20impl Cache {
21 async fn id(&self) -> &ID {
22 &self.id
23 }
24
25 async fn key(&self) -> &str {
26 &self.key
27 }
28}
29
30impl From<types::Cache> for Cache {
31 fn from(cache: types::Cache) -> Self {
32 Self {
33 id: ID(cache.id),
34 key: cache.key,
35 }
36 }
37}