Skip to content

Commit f8f413f

Browse files
committed
Fix lint
1 parent 7a4bcc2 commit f8f413f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

strawberry/extensions/mask_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def on_operation(self) -> Iterator[None]:
5656

5757
if isinstance(result, ExecutionResult):
5858
self._process_result(result)
59-
else:
59+
elif result:
6060
self._process_result(result.initial_result)
6161

6262

strawberry/schema/_graphql_core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Union
22

33
from graphql.execution import ExecutionContext as GraphQLExecutionContext
4-
from graphql.execution import ExecutionResult as GraphQLExecutionResult
4+
from graphql.execution import ExecutionResult as OriginalGraphQLExecutionResult
55
from graphql.execution import execute, subscribe
66

77
from strawberry.types import ExecutionResult
@@ -25,25 +25,27 @@
2525
)
2626

2727
GraphQLExecutionResult = Union[
28-
GraphQLExecutionResult, InitialIncrementalExecutionResult
28+
OriginalGraphQLExecutionResult, InitialIncrementalExecutionResult
2929
]
3030

3131
except ImportError:
3232
GraphQLIncrementalExecutionResults = type(None)
33+
GraphQLExecutionResult = OriginalGraphQLExecutionResult # type: ignore
3334

3435
incremental_execution_directives = () # type: ignore
3536
experimental_execute_incrementally = None
3637

3738

3839
# TODO: give this a better name, maybe also a better place
3940
ResultType = Union[
40-
GraphQLExecutionResult,
41+
OriginalGraphQLExecutionResult,
4142
GraphQLIncrementalExecutionResults,
4243
ExecutionResult,
4344
]
4445

4546
__all__ = [
4647
"GraphQLExecutionContext",
48+
"GraphQLExecutionResult",
4749
"GraphQLIncrementalExecutionResults",
4850
"ResultType",
4951
"execute",

strawberry/schema/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ async def _handle_execution_result(
546546
if isinstance(result, GraphQLExecutionResult):
547547
result = ExecutionResult(data=result.data, errors=result.errors)
548548
result.extensions = await extensions_runner.get_extensions_results(context)
549-
context.result = result # type: ignore # mypy failed to deduce correct type.
549+
context.result = result
550550
return result
551551

552552
async def execute(

0 commit comments

Comments
 (0)