Note: If you use more than one middleware, keep in mind that ORDER MATTERS. The correct order is UsePaging > UseProjection > UseFiltering > UseSorting.
type Query {
booksPage(
first: Int # 下一頁參數,筆數
after: String # 下一頁參數,endCursor of this page.
last: Int # 上一頁參數,筆數
before: String # 上一頁參數,startCursor of this page.
): BooksPageConnection
}
"""
A connection to a list of items.
"""
type BooksPageConnection {
pageInfo: PageInfo!
edges: [BooksPageEdge!]
nodes: [Book!]
}
"""
Information about pagination in a connection.
"""
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
"""
An edge in a connection.
"""
type BooksPageEdge {
cursor: String!
node: Book!
}