Currently it appears that when defining a subscription the return type annotation must be set to typing.AsyncGenerator[str, None]
, like so:
@strawberry.type
class Subscription:
@strawberry.subscription
async def time(self, info) -> typing.AsyncGenerator[str, None]:
...
Do we need to use typing.AsyncGenerator
as the return type for subscription definitions? I'm not sure that I love that dev experience. Would it be bad practice to use raw types as the return type? Something like:
@strawberry.subscription
async def time(self, info) -> str:
...
Or maybe a we could use a custom return type for subscriptions:
@strawberry.subscription
async def time(self, info) -> strawberry.subscription_result(str):
...
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