'DjangoFormMutationOptions' object has no attribute 'model'

286 views Asked by At

I am trying to create a mutation using DjangoFormMutation, I am getting an error that DjangoFormMutationOptions has no attribute 'model', here is the error that I am getting.

{
  "errors": [
    {
      "message": "'DjangoFormMutationOptions' object has no attribute 'model'",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "updateLocation"
      ]
    }
  ],
  "data": {
    "updateLocation": null
  }
}

here is my mutation

class UpdateLocation(DjangoFormMutation):
    location = graphene.Field(LocationType)

    class Meta:
        form_class = UpdateLocationForm


    def perform_mutate(cls, form, info):
        return super().perform_mutate(form, info)

and this is my form

class UpdateLocationForm(forms.Form):
    name = forms.CharField()
    id = forms.IntegerField()

    class Meta:
        fields = ['name', 'id']
1

There are 1 answers

0
Amir Ebneroomi On

in UpdateLocationForm You need to change id to something else.