Skip to content

Commit

Permalink
Fix some regressions from commit 38c9dd
Browse files Browse the repository at this point in the history
Move the non-None handling for patch and filter update mutations slightly, to conform to existing logic.

Regressions should be removed, while we still are handling required and optional fields more gracefully.

Signed-off-by: Tormod Haugland <[email protected]>
  • Loading branch information
tOgg1 committed Oct 26, 2023
1 parent 38c9dde commit f6f04a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions graphene_django_cud/mutations/batch_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def __init_subclass_with_meta__(
cls,
_meta=None,
model=None,
optional_fields=(),
required_fields=(),
optional_fields=None,
required_fields=None,
type_name=None,
**kwargs,
):
Expand All @@ -35,8 +35,8 @@ def __init_subclass_with_meta__(
return super().__init_subclass_with_meta__(
_meta=_meta,
model=model,
optional_fields=optional_fields,
required_fields=required_fields,
optional_fields=optional_fields or (),
required_fields=required_fields or (),
type_name=input_type_name,
**kwargs,
)
2 changes: 1 addition & 1 deletion graphene_django_cud/mutations/filter_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init_subclass_with_meta__(
only_fields=(), # Deprecated in favor of `fields`
exclude=(),
exclude_fields=(), # Deprecated in favor of `exclude`
optional_fields=(),
optional_fields=None, # Explicitly defaulted to None here and handled below.
required_fields=(),
field_types=None,
auto_context_fields=None,
Expand Down
8 changes: 4 additions & 4 deletions graphene_django_cud/mutations/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def __init_subclass_with_meta__(
cls,
_meta=None,
model=None,
optional_fields=(),
required_fields=(),
optional_fields=None,
required_fields=None,
type_name=None,
**kwargs,
):
Expand All @@ -35,8 +35,8 @@ def __init_subclass_with_meta__(
return super().__init_subclass_with_meta__(
_meta=_meta,
model=model,
optional_fields=optional_fields,
required_fields=required_fields,
optional_fields=optional_fields or (),
required_fields=required_fields or (),
type_name=input_type_name,
**kwargs,
)

0 comments on commit f6f04a0

Please sign in to comment.