GraphQL:整数太长?(AWS放大/图形QL变换)

GraphQL:整数太长?(AWS放大/图形QL变换),graphql,aws-amplify,Graphql,Aws Amplify,我使用GraphQL转换作为AWS Amplify的一部分。现在我想创建以下突变。但是,到的整数似乎太长。阅读文档的时间应该可以长得多。你知道为什么我总是收到错误:类型错误的验证错误type:argument'input.to'with value'IntValue{value=49160381234}不是有效的'Int'@'createNumber mutation createNumber { createNumber(input: { username: "mymail@gma

我使用GraphQL转换作为AWS Amplify的一部分。现在我想创建以下突变。但是,
的整数似乎太长。阅读文档的时间应该可以长得多。你知道为什么我总是收到错误:
类型错误的验证错误type:argument'input.to'with value'IntValue{value=49160381234}不是有效的'Int'@'createNumber

mutation createNumber {
  createNumber(input: {
    username: "mymail@gmail.com"
    to: 49160381234
  }) {
    username
    to
  }
}
这里是我的模式:

type Message
  @model
  @auth(rules: [{ allow: owner }])
  @key(fields: ["to", "from"]) # `to` as primary index and `from` as sort key.
  @key(
    name: "byToByTimestamp"
    fields: ["to", "timestamp"]
    queryField: "messagesByToByTimestamp"
  ) {
  to: Int!
  from: String!
  medium: String!
  messageBody: String!
  timestamp: Int!
}

type Number
  @model
  @key(fields: ["to"]) # Each number can only exist once.
  @key(
    name: "byUserByTo"
    fields: ["username", "to"]
    queryField: "numberByUserByTo"
  ) {
  username: String!
  to: Int!
  messages: [Message] @connection(keyName: "byToByTimestamp", fields: ["to"])
}

type User @model @key(fields: ["username"]) {
  username: String!
  numbers: [Number] @connection(keyName: "byUserByTo", fields: ["username"])
}
发件人:

Int标量类型表示有符号的32位数字非小数值。支持32位整数或数字类型的响应格式应使用该类型来表示此标量。。。如果整数内部值表示小于-2^31或大于等于2^31的值,则应引发字段错误

由于Int必须是32位值,因此其值不能大于2147483647。对于值可能高于该值的字段,规范建议:

大于32位的数字整数值应使用字符串或自定义的标量类型,因为并非所有平台和传输都支持编码大于32位的整数


有趣的是,这解释了为什么我可以直接在DynamoDB中输入更长的整数,但不能通过GraphQL突变。谢谢你,丹尼尔!