mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add start and end cursor to the pageinfo
This commit is contained in:
parent
2e57ceba3a
commit
4d5a26de2c
1 changed files with 6 additions and 2 deletions
|
|
@ -56,6 +56,8 @@ export const homeResolver = authorized<
|
|||
}
|
||||
}
|
||||
|
||||
const endCursor = sections[sections.length - 1].score.toString()
|
||||
|
||||
const edges = sections.map((section) => ({
|
||||
cursor: section.score.toString(),
|
||||
node: section.member,
|
||||
|
|
@ -64,8 +66,10 @@ export const homeResolver = authorized<
|
|||
return {
|
||||
edges,
|
||||
pageInfo: {
|
||||
hasPreviousPage: true, // there is always a previous page for new items
|
||||
hasNextPage: true, // there is always a next page for old items
|
||||
startCursor: after,
|
||||
endCursor,
|
||||
hasPreviousPage: true, // there is always a previous page for newer items
|
||||
hasNextPage: true, // there is always a next page for older items
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue