Make id field an ID type

This commit is contained in:
Grant McConnaughey 2017-11-29 15:25:24 -06:00
parent 748dc4c509
commit 6d7a0d053d
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ class DjangoModelFormMutation(BaseDjangoFormMutation):
form = form_class() form = form_class()
input_fields = fields_for_form(form, only_fields, exclude_fields) input_fields = fields_for_form(form, only_fields, exclude_fields)
input_fields['id'] = convert_form_field(model._meta.pk) input_fields['id'] = graphene.ID()
registry = get_global_registry() registry = get_global_registry()
model_type = registry.get_type_for_model(model) model_type = registry.get_type_for_model(model)

View File

@ -22,7 +22,7 @@ def test_needs_form_class():
class MyMutation(DjangoFormMutation): class MyMutation(DjangoFormMutation):
pass pass
assert exc.value.args[0] == 'form_class is required for FormMutation' assert exc.value.args[0] == 'form_class is required for DjangoFormMutation'
def test_has_output_fields(): def test_has_output_fields():