Typed GraphQL client code generator built on top of GQL.
Tries to make python-written queries easier instead of relying on the user to remember all the correct and required types (I mean who can remember the whole graphql schema of an API right).
All fields are annotated with types, IDE auto-completion and hints should work.
poetry install
poetry run python -m tests.generate
- Use client generated in tests/*/generated/client.py
- For mocked JOBS api -
docker run -d --rm -p 127.0.0.1:9002:9002 -v "$(pwd)/tests/graphql-faker:/mock" apisguru/graphql-faker /mock/schema.graphql
poetry install
poetry run python -m gqlient.cli --help
for further instructions
- Basic client generation
- Simple queries
- Actually creating and executing queries
- Nested fields
- Fragments, Unions, Interfaces
- Class renaming
- Mutations
- Hinting for return types
- Class-like access for returned data
- Hinting for returned union/interface types
- Aliases
- Better hinting for returned union/interface types (resolve field type clashes with aliases etc.)
- Separate client code to multiple modules
- Add docstrings from graphql schema documentation
- Eliminate duplicated code
- Eliminate duplicated templates
- Conditional imports
- Tests
- Documentation
- Structured jinja templates
- Well formatted Python code (spaces, blank lines, etc)
- Client customization
- Async
- Subscriptions
- Minimal dependency client (including required packages etc.)