Skip to content

Commit

Permalink
process_errors() now called by schema (graphql_transport_ws)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanvalur committed Aug 25, 2023
1 parent 58abd4c commit 5195d88
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ async def get_result_source():
assert result_source.errors
payload = [err.formatted for err in result_source.errors]
await self.send_message(ErrorMessage(id=message.id, payload=payload))
self.schema.process_errors(result_source.errors)
return

# Create task to handle this subscription, reserve the operation ID
Expand Down Expand Up @@ -306,13 +305,10 @@ async def handle_async_results(
error_payload = [err.formatted for err in result.errors]
error_message = ErrorMessage(id=operation.id, payload=error_payload)
await operation.send_message(error_message)
# don't need to call schema.process_errors() here because
# it was already done by schema.execute()
return
else:
next_payload = {"data": result.data}
if result.errors:
self.schema.process_errors(result.errors)
next_payload["errors"] = [
err.formatted for err in result.errors
]
Expand Down

0 comments on commit 5195d88

Please sign in to comment.