graphene-django-cud
graphene-django-cud copied to clipboard
Allow overwriting return ids in Batch Delete
Currently, return ids in both the DeleteMutation and the BatchDeleteMutation are base64 encoded using the to_global_id function in graphql_relay. The purpose is to ensure that between different models, ids of objects remain unique.
In DeleteMutation, there is a classmethod named get_return_id that can be overridden safely so long as you have your own ids that are unique between models.
However, the BatchDeleteMutation does not have this functionality, and this PR adds that so that users do not have to explicitly decode returned global ids - so long as they are already unique between different models.
Further, graphene-python allows the use of custom nodes. This PR will go hand in hand with this, if you choose to override the to_global_id method.
Great! But please use the get_return_id from DeleteMutation as the template for your implementation, as it contains some additional complexity which can be useful here as well.
Apologies for the delayed response. I think I've added the complexity you are referring to in the DeleteMutation!