Where are my cursors coming from because of my edges?

I am trying to figure out how I want to implement pagination in my graphics api. I was thinking of the following Relay cursor connection specification

This is a fairly simple construction of what looks like

{
  allFilms {
    edges {
      cursor
      node {
        id
        title
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}

      

My question is around the cursor. I've always thought that cursor is the equivalent of id / primary key. From my reading this is not the case. This is the point / location in the junction.

Can someone explain to me what it is and where it comes from. Is this a NoSql concept? I am assuming that when connecting to a relational database, the cursor will be the id / primary key?

+3


source to share


1 answer


Not really sure if that helps, but there is a short explanation here: In GraphQL, what "edges" and <node "mean



cursor

is a string to help determine where to include page breaks (or at least pagination, which I use to indicate page breaks), but this may have been explained already.

+1


source







All Articles