Skip to content

Commit 0137998

Browse files
committed
Update test
1 parent 949ada4 commit 0137998

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

strawberry/extensions/base_extension.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def should_await(self, _next: Callable) -> bool:
5858
some performance hits, especially because we know if the resolver
5959
is async or not at schema creation time.
6060
"""
61-
return _next._is_async
61+
return _next._is_async # type: ignore
6262

6363
def resolve(
6464
self,

tests/benchmarks/test_execute_with_extensions.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
from inspect import isawaitable
32
from pathlib import Path
43
from typing import Any, Dict, List
54

@@ -21,7 +20,7 @@ def get_results(self) -> AwaitableOrValue[Dict[str, Any]]:
2120
class ResolveExtension(SchemaExtension):
2221
async def resolve(self, _next, root, info, *args: Any, **kwargs: Any) -> Any:
2322
result = _next(root, info, *args, **kwargs)
24-
if isawaitable(result):
23+
if self.should_await(_next):
2524
result = await result
2625
return result
2726

0 commit comments

Comments
 (0)