Despite _RESOLVER_TYPE
containing Awaitable[T]
mypy complains about passing callables to strawberry.field
:
from typing import Callable, Awaitable
import strawberry
resolver: Callable[..., Awaitable[int]]
"""
e.g.
async def resolver() -> int:
...
"""
owo = strawberry.field(resolver)
Full error:
Argument 1 to "field" has incompatible type "Callable[..., Awaitable[int]]";
expected "StrawberryResolver[<nothing>] |
Callable[..., <nothing>] |
Callable[..., Coroutine[<nothing>, Any, Any]] |
Callable[..., Awaitable[<nothing>]] |
staticmethod[Any, <nothing>] |
classmethod[Any, Any,<nothing>]" [arg-type]
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too