kowainik / github-graphql

πŸ•ΈοΈ GraphQL bindings to GitHub API
https://kowainik.github.io/projects/github-graphql
Mozilla Public License 2.0
7 stars 0 forks source link

Split AST types into different modules #11

Closed chshersh closed 3 years ago

chshersh commented 3 years ago

GitHub GraphQL API is huge! And it won't be ideal to keep all types in the same single module. So let's refactor a bit and move them into separate modules.

chshersh commented 3 years ago

I think of introducing modules like:

GitHub.Repository
GitHub.Issues
GitHub.PullRequests
GitHub.Title
GitHub.Author
GitHub.Connection

And the main GitHub module will just reexport those modules. Each such module contains:

  1. The data type definition.
  2. Smart constructor.
  3. *ToAst function(s)
  4. Lenses after #10 is done
  5. Maybe something else in the future πŸ™‚

What do you think?

vrom911 commented 3 years ago

Looks great! πŸ‘πŸΌ

Do we want to have GraphQL prefix somewhere?

chshersh commented 3 years ago

@vrom911 Good question... On the one hand, I want to keep module names short. On the other hand, it makes sense to mention GraphQL in the module name somewhere to be consistent with the library name πŸ€”

chshersh commented 3 years ago

I propose to keep GitHub.GraphQL prefix only for GraphQL related API (types, AST, rendering), and GitHub for the rest. I like having only import qualified GitHub in the users' code, and I don't think that long names will be convenient...