【发布时间】:2019-11-02 23:35:12
【问题描述】:
我正在尝试在我的 AppSync 控制台中的查询编辑器上运行查询。此 AppSync API 连接到我的 Aurora Serverless。我不知道为什么我的突变返回 null。
这是我的架构:
input CreateMyAWSServiceInput {
id: Int!
shortName: String
longName: String
description: String
serviceRegionName: String!
feedUrl: String
imageUrl: String
}
type Mutation {
deleteMyAWSService(id: Int!): MyAWSService
createMyAWSService(createMyAWSServiceInput: CreateMyAWSServiceInput!): MyAWSService
updateMyAWSService(updateMyAWSServiceInput: UpdateMyAWSServiceInput!): MyAWSService
}
type MyAWSService {
id: Int!
shortName: String
longName: String
description: String
serviceRegionName: String!
feedUrl: String
imageUrl: String
}
type Query {
getMyAWSService(id: Int!): MyAWSService
listMyAWSServices: [MyAWSService]
}
type Subscription {
onCreateMyAWSService: MyAWSService
@aws_subscribe(mutations: ["createMyAWSService"])
}
input UpdateMyAWSServiceInput {
id: Int!
shortName: String
longName: String
description: String
serviceRegionName: String
feedUrl: String
imageUrl: String
}
这是我的查询:
mutation create {
createMyAWSService(createMyAWSServiceInput: {
id:3,
shortName:"abc",
longName:"defghi",
serviceRegionName: "123"
}){
id
shortName
longName
}
}
这些是我的结果:
{
"data": {
"createMyAWSService": null
}
}
我收到 null 并且无法写入我的表有什么原因吗?
【问题讨论】:
标签: graphql aws-appsync amazon-aurora