eamigo86 / graphene-django-extras

Extras functionalities for Graphene-Django
MIT License
417 stars 108 forks source link

When using a model with a UUID Field as ID the update method does not provide a UUID Field #184

Closed paulsermon-gemfair closed 2 years ago

paulsermon-gemfair commented 2 years ago

Pretty much as the title says.

I'm using ModelSerializer and DjangoSerializerMutation with a model that has a UUID as id.

This seems to break the UpdateField(). The ID does not appear as a property of the UpdateGenericType that is created.

Does anyone know of a simple way to fix this, or a way to subclass something to fix it myself? I tried to subclass DjangoSerializerMutation and change __init_subclass_with_meta__ so there is some logic there, but doesn't seem to work.

paulsermon-gemfair commented 2 years ago

I have decided to refactor and use uuids as a secondary unique key, but not as id. To allow this to be updated via mutations, make sure the field is marked as editable.