-
Notifications
You must be signed in to change notification settings - Fork 47
Extending build in create mutations when only null=True #195
Comments
Hey @nour-bouzid , That's basically how django works. In your field you specified that it can be null, but the way it is now it has to receive a value for it (which can be null) The correct way of solving this would be to add a The introspection in this lib will make the field mandatory or not depending on one of those keywords being set: https://github.com/blb-ventures/strawberry-django-plus/blob/main/strawberry_django_plus/types.py#L328 |
Hey @bellini666
in my
|
@nour-bouzid depends on wether you want it to be optional or not
So if null is an option, you can't make it mandatory. If you are using If you don't want to mess with your model, yuu probably need to type it directly (e.g. with |
Awesome thank you 🙂 |
@nour-bouzid can I close this issue? |
I have the following a model with the following field:
And I am trying to write a mutation for creating invitations:
the create resolver gives the following message:
I was only able to solve this by adding
blank=True
in the field but I don't want to do this. Is there any way around this?The text was updated successfully, but these errors were encountered: