Closed keithhackbarth closed 2 weeks ago
I agree with you!
We do support nested updating, but for sure we don't want to call save
on those nested relation when they did not get changed.
@bellini666 - I can volunteer some time to write some tests and PR if you think is worthy of a fix. Do you know of another way to do it in the meantime?
I also noticed that this case seems to be broken:
@strawberry_django.input(Fruit)
class FruitInputPartial(PermissionMixin):
id: auto
location_id: ID
mutation PatchFruit {
patchFruit(data: {id: 1, locationID: 1}) {
id
location { id }
}
}
Expected: Updates location or throws an error Actual: Does nothing
@bellini666 - I can volunteer some time to write some tests and PR if you think is worthy of a fix. Do you know of another way to do it in the meantime?
It surely is. And contributions are always very welcomed! 😊
Feel free to ping me either here or at our discord channel if you need help with anything!
Example type:
Example mutation
Expected
Only the fruit model receives clean and save. 1 database save operations
Actual
Both the model and relation receive clean and save. 2 database save operations
Additional Context
The reason this is painful is because of performance concerns. But also if paired with a library such as
django-simple-history
it creates a bunch of empty saves in foreign relationships.Upvote & Fund