ariebovenberg / quiz

🎱 Capable GraphQL client for Python
https://quiz.readthedocs.io
Apache License 2.0
67 stars 4 forks source link

Support GraphQL SDL #63

Open stickystyle opened 5 years ago

stickystyle commented 5 years ago

Our schemas are written using the GraphQL SDL, rather than JSON. Are there plans to support parsing this format for Schema.from_path()?

ariebovenberg commented 5 years ago

Hi @stickystyle, thanks for creating this issue.

There are currently no plans for implementing this, but it definitely makes to do so.

Currently the Schema is tied to the JSON representation. This is a temporary thing, which would have to be removed sometime in the future anyway.

Thus, the to-do list for supporting GraphQL SDL is:

  1. Write a parser for the GraphQL SDL or find an existing parser
  2. Refactor Schema to no longer be tied to the JSON representation.
  3. Rethink the Schema constructor naming conventions for loading from JSON, SDL.

I don't have the time at the moment to implement this feature, but you're welcome to submit a PR. Item (1) should be able to be done without me. I could give input for items (2) and (3)

ariebovenberg commented 5 years ago

Note that it is possible to work around this issue by loading the schema from the GraphQL API itself (Schema.from_url()), which can be persisted to disk as JSON (Schema.to_path(), Schema.from_path())

link to docs