diff --git a/graphene/types/schema.py b/graphene/types/schema.py index 928e179e..6c2fa929 100644 --- a/graphene/types/schema.py +++ b/graphene/types/schema.py @@ -348,7 +348,7 @@ class TypeMap(dict): resolver = get_unbound_function(resolver) - # TODO wrap resolver + # Wrap resolver def wrapped_resolver(*args, **kwargs): result = resolver(*args, **kwargs) return MapAsyncIterator(result, partial(map_payload_to_object, name)) diff --git a/tests_asyncio/test_subscribe.py b/tests_asyncio/test_subscribe.py index 8d2d79b1..cbd1d2df 100644 --- a/tests_asyncio/test_subscribe.py +++ b/tests_asyncio/test_subscribe.py @@ -1,44 +1,23 @@ from pytest import mark from graphene import ObjectType, Int, String, Schema -from graphene.types.objecttype import ObjectTypeOptions - - -MYPY = False -if MYPY: - from typing import Callable # NOQA class Query(ObjectType): a = String() -class SubscriptionOptions(ObjectTypeOptions): - pass - - class Subscription(ObjectType): - @classmethod - def __init_subclass_with_meta__( - cls, _meta=None, **options, - ): - if not _meta: - _meta = SubscriptionOptions(cls) + count_to_ten = Int() - super().__init_subclass_with_meta__(_meta=_meta, **options) - - -class MySubscription(Subscription): - count_to_ten = Int(yes=Int()) - - async def subscribe_count_to_ten(root, info, **kwargs): + async def subscribe_count_to_ten(root, info): count = 0 while count < 10: count += 1 yield count -schema = Schema(query=Query, subscription=MySubscription) +schema = Schema(query=Query, subscription=Subscription) @mark.asyncio