Files
2026-02-05 15:27:49 +08:00

10 lines
369 B
JavaScript

const isForwardSearch = (givenPageInfo) => {
return givenPageInfo.hasOwnProperty("hasNextPage");
};
const getCursorFrom = (pageInfo) => isForwardSearch(pageInfo) ? pageInfo.endCursor : pageInfo.startCursor;
const hasAnotherPage = (pageInfo) => isForwardSearch(pageInfo) ? pageInfo.hasNextPage : pageInfo.hasPreviousPage;
export {
getCursorFrom,
hasAnotherPage
};