[英]Graphql mutation error in aws amplify appsync
I am trying to insert/mutate a data using graphql to a dynamodb, see image below having error while inserting data.我正在尝试使用 graphql 将数据插入/突变为 dynamodb,请参见下图,插入数据时出现错误。 I am confused if the error exist while creating the schema or while mutating the data.
如果在创建模式或更改数据时存在错误,我会感到困惑。 The table was created using amplify
该表是使用 amplify 创建的
this is the schema script这是模式脚本
type PersonalAttributes {
FirstName: String
LastName: String
MiddleName: String
Email: String
Highlights: String
}
type Configurations {
StudyTopic: String
SpokenLanguage: String
Gender: String
ReadbackSpeed: Float
}
type Chapter {
CTitle: String
Content: String
TermHighlights: [String]
}
type Book {
Title: String
Author: String
HighlightsChapter: [Chapter]
}
type Athena @model {
UserKey: ID
UserName: String!
PersonalInformation: [PersonalAttributes]
SysConfig: [Configurations]
Books: [Book]
}
I recommend including an id: ID!
我建议包括一个
id: ID!
for your Athena
model. Provide a valid ID whenever you create Athena
objects.为您的
Athena
model。每当您创建Athena
对象时,请提供有效 ID。
The error indicates that no id
was provided (Dynamo wanted a valid, non-null String, but it got null.)该错误表明未提供任何
id
(Dynamo 想要一个有效的非空字符串,但它得到了 null。)
The error results from the create mutation call, not from setup of the Dynamo table.错误是由 create mutation 调用引起的,而不是由 Dynamo 表的设置引起的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.