【发布时间】:2020-05-23 16:38:12
【问题描述】:
我正在尝试推送我的 AWS Amplify API 架构/创建资源,但错误提示:
✖ An error occurred when pushing the resources to the cloud
managerId field is not of type Int
如果我在 Writer 类型上将 managerId 更改为 Int,错误就会消失,但我不想这样做。应该是身份证。知道这里有什么问题吗?
schema.graphql
type Writer implements Person
@model
@searchable
@key(name: "byManager", fields: ["managerId", "hourlyPay"])
@auth(rules: [
{allow: groups, groups: ["Admin"]},
{allow: public, provider: iam, operations: [read]}
])
{
id: ID!
managerId: ID!
name: String!
hourlyPay: Float!
manager: Manager! @connection(fields: ["managerId"])
}
type Manager implements Person
@model
@searchable
@auth(rules: [
{allow: groups, groups: ["Admin"]},
{allow: public, provider: iam, operations: [read]}
])
{
id: ID!
name: String!
department: String
writers: [Writer!]! @connection(keyName: "byManager", fields: ["id"])
}
谢谢!
【问题讨论】:
-
能否将
Person接口的定义包含进来看看那里定义了什么
标签: amazon-web-services graphql aws-amplify aws-appsync