我在 Django 中有一个客户模型。
#models.py
class Customer(models.Model):
name = models.CharField(max_length=500, blank=True, null=True)
mobile = models.BigIntegerField(blank=True,null=True)
recent_visit_time = models.DateField(auto_now=True)
#forms.py
class CustomerForm(ModelForm):
class Meta:
model = Customer
fields = ['name','mobile']
#mutations.py
class CustomerMutation(DjangoModelFormMutation):
class Meta:
form_class = CustomerForm
我正在使用ModelForm
创建石墨烯-django 突变。我可以从管理面板添加手机号码,但无法通过突变来添加。我想添加一个 10 位数字,但 GraphQL 只允许我添加 9 位数字。
我收到以下错误:
{
"errors": [
{
"message": "Int cannot represent non 32-bit signed integer value: 88776655433"
}
],
"data": {
"customer": [
{
"id": "2",
"mobile": null,
"name": "Harsh Behl"
}
]
}
}