-
Notifications
You must be signed in to change notification settings - Fork 830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing Mypy-compatible type information #966
Comments
Looks like this might not be possible - An approach closer to #729 (comment) seems to make more sense - this way everything to know about a resolver lives in one place. |
From my understanding, much (if not all) of the Graphene and graphql-core codebase is type hinted with Python 2.7 style annotations, but all of the user generated types have attributes through some metaprogramming, which can be a challenge to generate stubs for. There's a mypy issue here discussing a similar topic: |
Those type hints are not exported, see this PEP-561 section. And as you've noted, they don't cover that much of user's code. For the metaprogramming part a plugin would be needed. I've looked into it, but I'm not sure how to tie field declarations with types of resolvers (maybe we'll need a new mypy hook?). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi all, I created a repo for stubs for this library and wrote a plugin for it to match resolver function definitions to their corresponding |
That packages hasn't seen an update since March 2020, only 2 months after it was announced here. It would be great if mypy itself can export type hints, can this issue be re-opened? |
Would also like to see this re-opened |
Bump. This is still a problem. |
I'd like to use Mypy for checking a Graphene-based app. Is anyone working on stubs, or even better - a Mypy plugin?
What I imagine is writing:
And getting a guarantee that User.get_full_name() returns something assignable to Optional[String].
The text was updated successfully, but these errors were encountered: