python-graphql-client icon indicating copy to clipboard operation
python-graphql-client copied to clipboard

Add Type Hints

Open DaleSeo opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe.

We recently started using Mypy as a static type checker and realized that this library can cause type errors like below due to missing type hints or library stubs around the API.

app/memberships/repository.py:12:1: error: Skipping analyzing 'python_graphql_client': found module but no type hints or library stubs  [import]
    from python_graphql_client import GraphqlClient
    ^
app/admin.py:9:1: error: Skipping analyzing 'python_graphql_client': found module but no type hints or library stubs  [import]
    from python_graphql_client import GraphqlClient
    ^

Describe the solution you'd like

I think adding type hints to this library would be helpful for Mypy users.

Describe alternatives you've considered

Providing library stubs could also work but considering the amount of code here, I'm afraid that would be overkill.

Additional context

Optionally, this library itself considering not only type hinting but also type checking using Mypy.

DaleSeo avatar Jun 17 '20 16:06 DaleSeo

Great idea, just follow the pep guide lines https://www.python.org/dev/peps/pep-0561/ which I think mypy supports.

xkludge avatar Jun 17 '20 17:06 xkludge