I work in a large organization where we use GitHub. We would like to make an API call (REST or GraphQL) to GitHub to retrieve repos that are interesting to a specific logged in user - me for example. This could be repos that I have contributed to or repos that anyone in any of my teams have contributed to. Any one of these would be fine.
We do have possible workarounds:
- We could loop the REST API
https://api.github.com/repos/OWNER/REPO/contributorsand check. We have close to 10 thousands repos though. - We have found some ways to loop the GraphQL API as well, but this also takes times, which means we end up having to query this once a day, save it to a database etc.
Surely there should be a way to do this in just one call.
We have tried the following with the GraphQL API:
repositoryOwner: Withlogin: "MyOrganization"we are only able to retrieve repos related to the organization andaffiliationsandownerAffiliationslooks like they follow the organization, not me as a logged in user. Note again that all the repos are owned by the organization, so that if I trylogin: "MyGitHubUser", I only get repos that I own privately.viewer: Hereviewer.repositoriesretrieves only repos that the current viewer owns, not those they contribute to.repository: Only retrieves a single repo.search: We have triedquery, but unsuccessfully (query documentation). The AI we have asked tries to useinvolves, but this does not retrieve contributors either.
Someone has suggested we look into OctoKit's GraphQL library, which is what we will try next.
We have looked at the REST API, but found only repo-by-repo possibilities.
Is this at all possible to do in one API call?