From 2da07a17c233a64b6811cc9b861072dd2d7c6001 Mon Sep 17 00:00:00 2001 From: flonou <10209267+flonou@users.noreply.github.com> Date: Tue, 5 Nov 2024 00:52:11 +0100 Subject: [PATCH] fix sub-variables are not correctly recovered from sub-fields --- .../client_generators/dependencies/base_operation.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ariadne_codegen/client_generators/dependencies/base_operation.py b/ariadne_codegen/client_generators/dependencies/base_operation.py index 9f9c766..2be9407 100644 --- a/ariadne_codegen/client_generators/dependencies/base_operation.py +++ b/ariadne_codegen/client_generators/dependencies/base_operation.py @@ -144,13 +144,11 @@ def get_formatted_variables(self) -> Dict[str, Dict[str, Any]]: formatted_variables = self.formatted_variables.copy() # Collect variables from subfields - for subfield in self._subfields: - subfield.get_formatted_variables() - formatted_variables.update(subfield.formatted_variables) + for subfield in self._subfields: + formatted_variables.update(subfield.get_formatted_variables()) # Collect variables from inline fragments for subfields in self._inline_fragments.values(): - for subfield in subfields: - subfield.get_formatted_variables() - formatted_variables.update(subfield.formatted_variables) + for subfield in subfields: + formatted_variables.update(subfield.get_formatted_variables()) return formatted_variables