2020-05-05 22:52:04 +00:00
|
|
|
#![allow(missing_docs)]
|
|
|
|
|
2020-05-05 05:21:45 +00:00
|
|
|
use crate::types::connection::cursor::Cursor;
|
2020-05-05 22:52:04 +00:00
|
|
|
use async_graphql_derive::SimpleObject;
|
2020-03-19 09:20:12 +00:00
|
|
|
|
2020-05-05 22:52:04 +00:00
|
|
|
/// Information about pagination in a connection
|
|
|
|
#[SimpleObject(internal, desc = "Information about pagination in a connection.")]
|
2020-03-19 09:20:12 +00:00
|
|
|
pub struct PageInfo {
|
|
|
|
#[field(desc = "When paginating backwards, are there more items?")]
|
2020-05-05 22:52:04 +00:00
|
|
|
pub has_previous_page: bool,
|
2020-03-19 09:20:12 +00:00
|
|
|
|
|
|
|
#[field(desc = "When paginating forwards, are there more items?")]
|
2020-05-05 22:52:04 +00:00
|
|
|
pub has_next_page: bool,
|
2020-03-19 09:20:12 +00:00
|
|
|
|
|
|
|
#[field(desc = "When paginating backwards, the cursor to continue.")]
|
2020-05-05 22:52:04 +00:00
|
|
|
pub start_cursor: Option<Cursor>,
|
2020-03-19 09:20:12 +00:00
|
|
|
|
|
|
|
#[field(desc = "When paginating forwards, the cursor to continue.")]
|
2020-05-05 22:52:04 +00:00
|
|
|
pub end_cursor: Option<Cursor>,
|
2020-03-19 09:20:12 +00:00
|
|
|
}
|