40
loading...
This website collects cookies to deliver better user experience
products
ORDER BY id DESC LIMIT 20 OFFSET 40. However, there are two problems. SELECT id, title
FROM `products`
WHERE id > 5
ORDER BY id DESC
LIMIT 5
SELECT concat(a, b) AS ab FROM foo;
SELECT concat(name, id) AS cursor FROM file ORDER BY name
. You can still remain order by name
and use unique cursor by concatenating id after the name column.Cursors are pointers to the spot where we’ve left off in the data. More specifically, cursors are variables that can hold any value that the client can pass to the server to help it find the point at which it should start returning data. It doesn’t matter what value you use, and in fact, it should be opaque from the point of view of the client.
type File {
id: ID!
name: String!
extension: String!
size: Int!
location: String!
}
type PageInfo {
endCursor: String
hasNextPage: Boolean!
startCursor: String
hasPrevPage: Boolean!
}
type FileConnection {
edges: [File]
pageInfo: PageInfo!
totalCount: Int!
}
query {
files(page: {first: 5, after: "00100302"}) {
edges {
name
extension
}
pageInfo {
endcursor
hasNextPage
}
totalCount
}
}