profusion / sgqlc

Simple GraphQL Client
https://sgqlc.readthedocs.io/
ISC License
513 stars 85 forks source link

GitHub schema #101

Closed Mogost closed 4 years ago

Mogost commented 4 years ago

Thank you for your efforts. I tried using this library to work with the GitHub API and everything works fine! I see that the project already has a GitHub scheme here. But this code is included as an example and not persist in build package and I have to copy it to my project. Is it possible to avoid copying and include it in the package (so that we can just import it)?

barbieri commented 4 years ago

Hi @Mogost,

I think it's better and safer for you to host the copy in your own package. The example is not updated frequently and I'd need to release a new package every time GH updates their API... which may be cumbersome. It's meant as a simple example only.

Including it in your package allows for on-demand update, you may update the schema as you see fit.

Mogost commented 4 years ago

Ok. Thank you.

Mogost commented 4 years ago

Maybe it will be useful for someone. Plus, I hope this will help more people learn about sgqlc. I created a small package sgqlc-schemas so that schemas for popular APIs can be easily installed and used without having to store them in code.

barbieri commented 4 years ago

@Mogost nice! Could you send a PR to this repo linking to it from README file? Otherwise I can do it myself.

As for the repo, what about split into multiple packages? Not a huge overhead to have unused schemas, but is more scalable to host many APIs in the future

Mogost commented 4 years ago

@Mogost nice! Could you send a PR to this repo linking to it from README file? Otherwise I can do it myself.

Please change the README yourself, as you see fit.

As for the repo, what about split into multiple packages? Not a huge overhead to have unused schemas, but is more scalable to host many APIs in the future

As for this, I was thinking about separation. But at the current moment it seems to me much easier to maintain one repository with schemas than a whole set of repositories. The separation would make sense if the schemas were written by hand. But since they are generated automatically, I am thinking about updating them automatically without human intervention. This process can most likely be fully automated thanks to Github actions.

barbieri commented 4 years ago

finally done as https://github.com/profusion/sgqlc/commit/fb664fc63a13e871648995f2e0bfca705c23ec9f