1#[derive(Default, std::fmt::Debug, Clone, Copy)]
2pub enum ListDirection {
3 #[default]
4 Ascending,
5 Descending,
6}
7
8#[derive(std::fmt::Debug, Clone, Copy)]
9pub struct Sort<T> {
10 pub by: T,
11 pub direction: ListDirection,
12}
13
14#[derive(Debug)]
15pub struct PaginatedQueryArgs<T: std::fmt::Debug> {
16 pub first: usize,
17 pub after: Option<T>,
18}
19
20impl<T: std::fmt::Debug> Default for PaginatedQueryArgs<T> {
21 fn default() -> Self {
22 Self {
23 first: 100,
24 after: None,
25 }
26 }
27}
28
29pub struct PaginatedQueryRet<T, C> {
30 pub entities: Vec<T>,
31 pub has_next_page: bool,
32 pub end_cursor: Option<C>,
33}