use serde::Deserialize;
#[derive(Debug, Clone, Deserialize)]
pub struct Connection<T> {
pub nodes: Vec<T>,
#[serde(default, rename = "pageInfo")]
pub page_info: PageInfo,
}
#[derive(Debug, Clone, Default, Deserialize)]
pub struct PageInfo {
#[serde(default, rename = "hasNextPage")]
pub has_next_page: bool,
#[serde(default, rename = "endCursor")]
pub end_cursor: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct Ref<I> {
pub id: I,
}
#[derive(Debug)]
pub struct Page<T> {
pub items: Vec<T>,
pub page_info: PageInfo,
pub append: bool,
}
impl<T> Page<T> {
pub fn new(items: Vec<T>, page_info: PageInfo, append: bool) -> Self {
Self {
items,
page_info,
append,
}
}
}