Exposing Mypy-compatible type information
See original GitHub issueI’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:
class Me(ObjectType[User]):
full_name = graphene.String()
def resolve_full_name(self, info):
return self.get_full_name()
And getting a guarantee that User.get_full_name() returns something assignable to Optional[String].
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Mypy error - incompatible types in assignment - Stack Overflow
The problem is that mypy inferred that the type of your result variable is Dict[str, bool] due to how you first initialized it...
Read more >Common issues and solutions - mypy 0.991 documentation
Note that sometimes library stubs have imprecise type information, e.g. the pow() ... value foo(1) # error: Argument 1 to "foo" has incompatible...
Read more >python/mypy - Gitter
In short, does the typing module exhibit an API to typecheck a variable at runtime, similar to isinstance() but understanding the type classes...
Read more >Mypy Documentation - Read the Docs
Mypy has a powerful and easy-to-use type system, supporting features such as type inference, generics, callable types, tuple types, union types, ...
Read more >Category: Tech | Matrix.org
Mypy will report and reject equality tests between incompatible types. If mypy can spot that an equality is always False , there's a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Field
attributes. Feel free to use / file issues / contribute!https://github.com/trialspark/graphene-stubs
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.