I have been trying to figure out how I want to implement pagination in my graphql api. I was thinking of following Relay Cursor Connections Specification
This is simple enough building something that looks like
{
allFilms {
edges {
cursor
node {
id
title
}
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
My question is around the cursor. I always thought the cursor was the equivalent of an id/primary key. From my reading it is not. It is a point/location in the connection.
Can someone explain to me what it is and where it comes from. Is this a NoSql concept? I am guessing when connecting to a relational database the cursor would be the id/primary key?