Skip to content

Commit

Permalink
[graphql] subscription handle_graphql_errors (#7482)
Browse files Browse the repository at this point in the history
run these erros through the class method, same as request errors

## Test Plan

eyes
  • Loading branch information
alangenfeld committed Apr 22, 2022
1 parent 5bf224a commit ade2be8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python_modules/dagit/dagit/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,9 @@ def execute_graphql_subscription(
if isinstance(async_result, ExecutionResult):
if not async_result.errors:
check.failed(f"Only expect non-async result on error, got {async_result}")
error_payload = format_graphql_error(async_result.errors[0]) # type: ignore
return None, error_payload
handled_errors = self.handle_graphql_errors(async_result.errors)
# return only one entry for subscription response
return None, handled_errors[0]

# in the future we should get back async gen directly, back compat for now
disposable, async_gen = _disposable_and_async_gen_from_obs(async_result, get_event_loop())
Expand Down

0 comments on commit ade2be8

Please sign in to comment.