Hi,
I am struggling with the CUD mutation and the partial inputs, the schema does not detect at all that the fields are optional
class MyModel(models.Model):
title = models.CharField()
subtitle = models.CharField()
# I first tried this
@strawberry_django.input(MyModel, fields="__all__", partial=True)
class MyModelInput:
pass
# then tried with this
@strawberry_django.partial(MyModel, fields="__all__")
class MyModelInputPartial:
pass
# and this, also tried with 'auto'
@strawberry_django.partial(MyModel, fields="__all__")
class MyModelInputPartial:
title: str | None
subtitle: str | None
@strawberry_django.type(
MyModel,
fields="__all__",
)
class MyModelType:
pass
@strawberry.type
class Mutation:
update: MyModelType = strawberry_django.mutations.update(MyModelInputPartial)
I tried using NodeInput as well, nothing works, in the schema subtitle and title are always mandatory data inputs
I want to only input either title or subtitle without having to reset the other attribute.
Thanks for you help,
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too