Skip to content

Instantly share code, notes, and snippets.

@inancgumus
Last active July 20, 2022 18:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inancgumus/61dbc5c8bbc6d0343656b8049449be81 to your computer and use it in GitHub Desktop.
Save inancgumus/61dbc5c8bbc6d0343656b8049449be81 to your computer and use it in GitHub Desktop.
List repositories by stars (paginated)

Run using the explorer, here.

First Page:

query { 
  topic(name: "go") {
    repositories(first: 100, orderBy: {field: STARGAZERS, direction:DESC}) {
      edges {
        node {
          url
          description
          stargazerCount
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

Next Page:

query { 
  topic(name: "go") {
    repositories(first: 100, after: "<endCursorIDHere>", orderBy: {field: STARGAZERS, direction:DESC}) {
      edges {
        node {
          url
          description
          stargazerCount
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment