From 3617a1c96dd6279a4529956904528b40c2b72d53 Mon Sep 17 00:00:00 2001 From: Kien Dang Date: Sat, 31 Dec 2022 11:49:01 +0800 Subject: [PATCH] Use async def instead of the deprecated asyncio.coroutine --- graphql_server/flask/graphqlview.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphql_server/flask/graphqlview.py b/graphql_server/flask/graphqlview.py index e663366..2278049 100644 --- a/graphql_server/flask/graphqlview.py +++ b/graphql_server/flask/graphqlview.py @@ -27,6 +27,7 @@ GraphiQLOptions, render_graphiql_sync, ) +from graphql_server.utils import wrap_in_async class GraphQLView(View): @@ -126,7 +127,7 @@ async def get_async_execution_results(): *( ex if ex is not None and is_awaitable(ex) - else asyncio.coroutine(lambda: ex)() + else wrap_in_async(lambda: ex)() for ex in execution_results ) )