async-graphql/src/types/connection/page_info.rs

19 lines
513 B
Rust
Raw Normal View History

use crate::SimpleObject;
2020-03-19 09:20:12 +00:00
/// Information about pagination in a connection
#[derive(SimpleObject)]
#[graphql(internal)]
2020-03-19 09:20:12 +00:00
pub struct PageInfo {
/// When paginating backwards, are there more items?
pub has_previous_page: bool,
2020-03-19 09:20:12 +00:00
/// When paginating forwards, are there more items?
pub has_next_page: bool,
2020-03-19 09:20:12 +00:00
/// When paginating backwards, the cursor to continue.
pub start_cursor: Option<String>,
2020-03-19 09:20:12 +00:00
/// When paginating forwards, the cursor to continue.
pub end_cursor: Option<String>,
2020-03-19 09:20:12 +00:00
}