Open mkitzmann opened 1 year ago
Interesting, thank you. I will look into this for the next release.
For reference, the above query yields the following reply:
{
"data": {
"search": {
"repos": [
{
"repo": {
"url": "https://github.com/electerious/Ackee",
"name": "Ackee",
"owner": {
"avatarUrl": "https://avatars.githubusercontent.com/u/499088?v=4"
},
"descriptionHTML": "<div>Self-hosted, Node.js based analytics tool for those who care about privacy.</div>",
"stargazerCount": 3914,
"defaultBranchRef": {
"target": {
"july": {
"totalCount": 0
}
}
}
}
},
{
"repo": {
"url": "https://github.com/aptabase/aptabase",
"name": "aptabase",
"owner": {
"avatarUrl": "https://avatars.githubusercontent.com/u/126899775?v=4"
},
"descriptionHTML": "<div>✨ Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps</div>",
"stargazerCount": 227,
"defaultBranchRef": {
"target": {
"july": {
"totalCount": 89
}
}
}
}
}
]
}
}
}
As discussed here https://lemmy.world/post/3622280
Using the Github GraphQL API would allow to query all the needed data for 100 repos with one request. This would make it possible to stay below the rate limit without using a timeout. (More info on the GraphQL ratelimits)
An example of how this could look can be found here: https://github.com/mkitzmann/awwesome/blob/main/src/lib/query.ts
The (POST) request to https://api.github.com/graphql looks something like this:
It can be tested inside the GitHub GraphQL explorer: https://docs.github.com/en/graphql/overview/explorer