Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick91 committed Dec 12, 2024
1 parent 949ada4 commit 0137998
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion strawberry/extensions/base_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def should_await(self, _next: Callable) -> bool:
some performance hits, especially because we know if the resolver
is async or not at schema creation time.
"""
return _next._is_async
return _next._is_async # type: ignore

def resolve(
self,
Expand Down
3 changes: 1 addition & 2 deletions tests/benchmarks/test_execute_with_extensions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
from inspect import isawaitable
from pathlib import Path
from typing import Any, Dict, List

Expand All @@ -21,7 +20,7 @@ def get_results(self) -> AwaitableOrValue[Dict[str, Any]]:
class ResolveExtension(SchemaExtension):
async def resolve(self, _next, root, info, *args: Any, **kwargs: Any) -> Any:
result = _next(root, info, *args, **kwargs)
if isawaitable(result):
if self.should_await(_next):
result = await result
return result

Expand Down

0 comments on commit 0137998

Please sign in to comment.