简体   繁体   English

aws amplify appsync 中的 Graphql 变异错误

[英]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.

相关问题 AWS Amplify GraphQL CreateOrUpdate / Upsert 突变 - AWS Amplify GraphQL CreateOrUpdate / Upsert mutation AWS Amplify CLI 生成的 GraphQL 突变中的 $condition 输入参数是什么? - What is the $condition input parameter for in a GraphQL mutation generated by AWS Amplify CLI? AWS appsync graphql 订阅 - AWS appsync graphql subscription Apollo Vue (using AWS Amplify/AppSync) Graphql 查询不拉父数据 - Apollo Vue (using AWS Amplify/AppSync) Graphql query does not pull parent data AWS Amplify AppSync GraphQL @Auth 指令:如何禁止公共用户列出元素 - AWS Amplify AppSync GraphQL @Auth directive: How can I forbid to list of elements for public user GraphQL 带有 AWS AppSync 注释的 Codegen - GraphQL Codegen with AWS AppSync Annotations AWS Appsync Lambda 突变的自定义解析器 - AWS Appsync Lambda Custom Resolver for mutation 使用 aws-amplify 更新 GraphQL object 时出现授权错误 - Authorization error when updating a GraphQL object using aws-amplify 何时禁用 aws Amplify 或 AppSync 冲突解决 - When to disable aws Amplify or AppSync conflict resolution 使用 require('aws-appsync') 模拟/运行 lambda function 时放大抛出错误 - Amplify throws error when mocking/running lambda function using require('aws-appsync')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM