mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-22 17:46:57 +03:00
Rename subscribe method to EXPERIMENTAL_subscribe
This commit is contained in:
parent
64af43748c
commit
d69a488d37
|
@ -475,7 +475,7 @@ class Schema:
|
||||||
kwargs = normalize_execute_kwargs(kwargs)
|
kwargs = normalize_execute_kwargs(kwargs)
|
||||||
return await graphql(self.graphql_schema, *args, **kwargs)
|
return await graphql(self.graphql_schema, *args, **kwargs)
|
||||||
|
|
||||||
async def subscribe(self, query, *args, **kwargs):
|
async def EXPERIMENTAL_subscribe(self, query, *args, **kwargs):
|
||||||
document = parse(query)
|
document = parse(query)
|
||||||
kwargs = normalize_execute_kwargs(kwargs)
|
kwargs = normalize_execute_kwargs(kwargs)
|
||||||
return await subscribe(self.graphql_schema, document, *args, **kwargs)
|
return await subscribe(self.graphql_schema, document, *args, **kwargs)
|
||||||
|
|
|
@ -26,7 +26,7 @@ schema = Schema(query=Query, subscription=Subscription)
|
||||||
@mark.asyncio
|
@mark.asyncio
|
||||||
async def test_subscription():
|
async def test_subscription():
|
||||||
subscription = "subscription { countToTen }"
|
subscription = "subscription { countToTen }"
|
||||||
result = await schema.subscribe(subscription)
|
result = await schema.EXPERIMENTAL_subscribe(subscription)
|
||||||
count = 0
|
count = 0
|
||||||
async for item in result:
|
async for item in result:
|
||||||
count = item.data["countToTen"]
|
count = item.data["countToTen"]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user