Skip to content

Support cursor-based pagination for repositories.

Warren Gifford requested to merge 13715-repository-cursor into main

Created by: flying-robot

This introduces an after parameter that can be supplied to a repositories query for pagination purposes:

{
  repositories(first: 1, after: "UmVwb3...") {
    nodes {
      name
      description
      url
    }
    pageInfo {
      endCursor
    }
  }
}

Note that from the client's perspective, the GraphQL parameter is a string (specifically, a Base64-encoded opaque value). An intermediate transformation will handle unmarshalling the string into a dedicated cursor type and taking an appropriate action.

This adopts the same style and semantics as the searchCursor elsewhere within this package. It handles transformation to/from an opaque string value and a cursor structure, which can be used to shuttle the pagination data between layers.

fixes https://github.com/sourcegraph/sourcegraph/issues/13715

Merge request reports

Loading