Skip to content

Commit

Permalink
fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danplischke committed Aug 26, 2024
1 parent 870db53 commit dba5700
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ariadne/asgi/handlers/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def encode_execution_result(self) -> str:
Returns the JSON string representation of the execution result
"""
payload: Dict[str, Any] = {}
if self.result.data:
if self.result is not None and self.result.data is not None:
payload["data"] = self.result.data
if self.result.errors:
if self.result is not None and self.result.errors is not None:
errors = []
for error in self.result.errors:
log_error(error, self.logger)
Expand Down Expand Up @@ -710,7 +710,7 @@ async def handle_sse_request(self, request: Request) -> Response:
"""

try:
data = await self.extract_data_from_request(request)
data: Any = await self.extract_data_from_request(request)
query = await self.get_query_from_sse_request(request, data)

if self.schema is None:
Expand Down Expand Up @@ -795,7 +795,7 @@ async def sse_subscribe_to_graphql(
event="next",
result=ExecutionResult(
errors=[
GraphQLError(message=error.get("message"))
GraphQLError(message=cast(str, error.get("message", "")))
for error in error_payload
]
),
Expand Down

0 comments on commit dba5700

Please sign in to comment.