ldd / gatsby-source-github-api

Pull data into Gatsby from Github API v4
MIT License
65 stars 10 forks source link

Getting contributors on each repostirory? #24

Closed Blakeinstein closed 3 years ago

Blakeinstein commented 3 years ago

As far as I am aware, this is not possible with graphql currently, and the default REST Api (v3) is necesssary. How would one go about adding the same here?

I know its necessarily not an issue with this plugin. But I would love to know.

ldd commented 3 years ago

It seems you are right.

It would be outside of the scope of this project, but if it were me, i would just write a short bash script file that fetches this with the default REST api. Then I'd use jq to manipulate the result and write it to a JSON file.

you could probably do it in a git hook.

Let me know what you end up doing! :D

Blakeinstein commented 3 years ago

One solution I can think of is to just make the graphql queries seperately from gatsby and then once i had the repositories list, I can then get contributors and write the result to a json file. And use the json file in the build process. This should also allow me to add dummy data, as another issue I have right now is with other people contributing to the code. They may not have an api key with same access level, resulting in errors on the queries and also I cannot test pull requests with a test build process as the repo secrets are not made available to PRs

Blakeinstein commented 3 years ago

This is what I ended up doing, fetching said data to json at vuild time and loading that. Thanks!