Graphql 如何在django graphene中变异手机号码?
我在django有一个客户模型Graphql 如何在django graphene中变异手机号码?,graphql,graphene-python,graphene-django,Graphql,Graphene Python,Graphene Django,我在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=T
#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"
}
]
}
}
您是否收到错误消息?您提到“GraphQL只允许添加9位数字”,这需要进一步细化。你到底是什么意思?你收到错误信息了吗?您提到“GraphQL只允许添加9位数字”,这需要进一步细化。你到底是什么意思?