question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exposing Mypy-compatible type information

See original GitHub issue

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:

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ckarnellcommented, Jan 8, 2020

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

0reactions
stale[bot]commented, Jul 29, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found