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