-
-
Notifications
You must be signed in to change notification settings - Fork 575
Add Awaitable in resolver type #2528
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
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2528 +/- ##
=======================================
Coverage 96.70% 96.70%
=======================================
Files 183 183
Lines 7579 7579
Branches 1374 1374
=======================================
Hits 7329 7329
Misses 148 148
Partials 102 102 |
Thanks for adding the Here's a preview of the changelog: This release updates the typing for the resolver argument in import strawberry
async def get_user_age() -> int:
return 0
@strawberry.type
class User:
name: str
age: int = strawberry.field(resolver=get_user_age) Here's the preview release card for twitter: Here's the tweet text:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good @patrick91 ! Good tests too
Hello! It seems that this fix for pyright has made mypy unhappy. I can reproduce with this extra testcase in
This returns:
When I revert the resolver type change in |
@Mark90 sorry about that! I'll take a look at this today |
@Mark90 I've opened an issue on Mypy's side: python/mypy#14669 If that doesn't get solved I'll try to find a work around 😊 |
Thanks a lot for the quick action :) |
Description
This PR adds Awaitable inside our type for resolvers passed
to
strawberry.field
:)Types of Changes
Issues Fixed or Closed by This PR