From a18ea3a0803f4ec5fdccb90c530932a3d9418940 Mon Sep 17 00:00:00 2001 From: flonou <10209267+flonou@users.noreply.github.com> Date: Fri, 15 Nov 2024 00:38:39 +0100 Subject: [PATCH] fix: field_names should not be converted to snake case --- ariadne_codegen/client_generators/custom_fields.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ariadne_codegen/client_generators/custom_fields.py b/ariadne_codegen/client_generators/custom_fields.py index bfc324c..c243db9 100644 --- a/ariadne_codegen/client_generators/custom_fields.py +++ b/ariadne_codegen/client_generators/custom_fields.py @@ -216,7 +216,7 @@ def _generate_class_field( """Handles the generation of field types.""" if getattr(field, "args") or method_required: return self.generate_product_type_method( - name, field_name, getattr(field, "args") + name, org_name, field_name, getattr(field, "args") ) return generate_ann_assign( target=generate_name(name), @@ -311,7 +311,7 @@ def _generate_on_method(self, class_name: str) -> ast.FunctionDef: ) def generate_product_type_method( - self, name: str, class_name: str, arguments: Optional[Dict[str, Any]] = None + self, name: str, org_name: str, class_name: str, arguments: Optional[Dict[str, Any]] = None ) -> ast.FunctionDef: """Generates a method for a product type.""" arguments = arguments or {} @@ -343,7 +343,7 @@ def generate_product_type_method( generate_return( value=generate_call( func=field_class_name, - args=[generate_constant(name)], + args=[generate_constant(org_name)], keywords=arguments_keyword, ) ),