strawberry-django
strawberry-django copied to clipboard
How to override the logic on the Basic create, retrieve, update and delete (CRUD) types and mutations
I will like to override the logic inside basic create mutation, much like in django restframework modelviewsets or serializers. What is the best way of doing this?
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
Hi @sisocobacho ,
What exactly are you trying to override?
You can probably override the field to call your own function instead of the ones the current ones call for example. Or you can have a basic mutation and call the create/retrieve/update/delete functions for example.
If you want to give an example of a use case I can suggest something for you
Hello, Thanks for the suggestions. Basically what I am trying to do is insert business logic inside those mutation without having to rewrite a new one from 0 and make use off the functionality that those mutations already have. For example doing something before or after saving the model in the create mutation.
Yeah hooks are a great idea..