Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 1

How long does a cursor live?

For example, I request some tags in a repo:

 

query {
  viewer {
    repository(name: "SomeRepo") {
      id
      refs(refPrefix: "refs/tags/", first: 100) {
        edges {
          cursor
          node {
            name
          }
        }
      }
    }
  }
}

Then I store the repository id and the last cursor locally. After a few months, I make a new request:

 

query {
  node(id: "repositoryId") {
    ... on Repository {
      refs(refPrefix: "refs/tags/", first: 100, after: "cursorFetchedFewMonthsAgo") {
        edges {
          cursor
          node {
            name
          }
        }
      }
    }
  }
}

Would it return the expected result? Does cursor have a lifetime? Does it change when a tag is updated/added/deleted? Can I assume that the cursor is a persistent unique ID as long as the query argument remains the same?