From 85c12854eb559f4ead3b3ef2f318f7da2cb53de5 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Sat, 17 Feb 2024 11:00:11 +0100 Subject: [PATCH] Add missing filter call in complete_awaitable_value() --- src/graphql/execution/execute.py | 1 + tests/execution/test_subscribe.py | 2 +- tests/execution/test_variables.py | 8 +++----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/graphql/execution/execute.py b/src/graphql/execution/execute.py index af992acf..74ead0af 100644 --- a/src/graphql/execution/execute.py +++ b/src/graphql/execution/execute.py @@ -1142,6 +1142,7 @@ async def complete_awaitable_value( ) error = located_error(raw_error, field_nodes, path.as_list()) handle_field_error(error, return_type, errors) + self.filter_subsequent_payloads(path, async_payload_record) completed = None return completed diff --git a/tests/execution/test_subscribe.py b/tests/execution/test_subscribe.py index 1db123e4..9c133da9 100644 --- a/tests/execution/test_subscribe.py +++ b/tests/execution/test_subscribe.py @@ -488,7 +488,7 @@ async def resolves_to_an_error_if_variables_were_wrong_type(): ], ) - assert result.errors[0].original_error is None + assert result.errors[0].original_error # Once a subscription returns a valid AsyncIterator, it can still yield errors. diff --git a/tests/execution/test_variables.py b/tests/execution/test_variables.py index 8e82ebec..7a9ebb82 100644 --- a/tests/execution/test_variables.py +++ b/tests/execution/test_variables.py @@ -27,11 +27,11 @@ ) -def faulty_parse_value(value: str) -> str: +def faulty_parse_value(_value: str) -> str: raise TestFaultyScalarGraphQLError -def faulty_parse_literal(ast: ValueNode, _variables=None) -> str: +def faulty_parse_literal(_ast: ValueNode, _variables=None) -> str: raise TestFaultyScalarGraphQLError @@ -733,9 +733,7 @@ def reports_error_for_array_passed_into_string_input(): ], ) - errors = result.errors - assert errors - assert errors[0].original_error + assert result.errors[0].original_error def reports_error_for_non_provided_variables_for_non_nullable_inputs(): # Note: this test would typically fail validation before