Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: field_names should not be converted to snake case #326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ariadne_codegen/client_generators/custom_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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 {}
Expand Down Expand Up @@ -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,
)
),
Expand Down