dtolnay/star-history

Iterate stargazers from both directions

Aperta

#10 aperta il 16 lug 2022

 (0 commenti) (0 reazioni) (0 assegnatari)Rust (12 fork)github user discovery
help wanted

Metriche repository

Star
 (201 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

For repos with lots of stars, we should be able to traverse all the stars in half as many GraphQL requests by iterating the stargazers simultaneously from the start and end.

Before:

repository(owner: "...", name: "...") {
  stargazers(after: "...", first: 100) {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {...}
  }
}

After:

repository(owner: "...", name: "...") {
  forward: stargazers(after: "...", first: 100) {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {...}
  }
  backward: stargazers(before: "...", last: 100) {
    pageInfo {
      hasPreviousPage
      startCursor
    }
    edges {...}
  }
}

Guida contributor