mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-10 19:57:15 +03:00
Add id input field to model form mutation
This commit is contained in:
parent
d6dbe2a4a8
commit
748dc4c509
|
@ -77,7 +77,7 @@ class DjangoFormMutation(BaseDjangoFormMutation):
|
|||
only_fields=(), exclude_fields=(), **options):
|
||||
|
||||
if not form_class:
|
||||
raise Exception('form_class is required for FormMutation')
|
||||
raise Exception('form_class is required for DjangoFormMutation')
|
||||
|
||||
form = form_class()
|
||||
input_fields = fields_for_form(form, only_fields, exclude_fields)
|
||||
|
@ -128,6 +128,7 @@ class DjangoModelFormMutation(BaseDjangoFormMutation):
|
|||
|
||||
form = form_class()
|
||||
input_fields = fields_for_form(form, only_fields, exclude_fields)
|
||||
input_fields['id'] = convert_form_field(model._meta.pk)
|
||||
|
||||
registry = get_global_registry()
|
||||
model_type = registry.get_type_for_model(model)
|
||||
|
|
Loading…
Reference in New Issue
Block a user