add start and end cursor to the pageinfo

This commit is contained in:
Hongbo Wu
2024-05-28 17:08:13 +08:00
parent 2e57ceba3a
commit 4d5a26de2c

View File

@ -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
},
}
})