Javascript 如何使用Amplify从DynamoDB中删除一行?

Javascript 如何使用Amplify从DynamoDB中删除一行?,javascript,graphql,amazon-dynamodb,aws-amplify,aws-appsync,Javascript,Graphql,Amazon Dynamodb,Aws Amplify,Aws Appsync,我尝试运行此操作时出错: deletepair=async()=>{ 当我运行deletepair()时,会出现以下错误: error: TypeError: Must provide Source. Received: undefined 您的架构文件似乎包含了两次变异类型。请尝试将其更改为如下所示: type Mutation { addPairToItem(input: AddPairToItemInput!): Users! removePairFromItem(inpu

我尝试运行此操作时出错:

deletepair=async()=>{

当我运行deletepair()时,会出现以下错误:

  error:  TypeError: Must provide Source. Received: undefined

您的架构文件似乎包含了两次
变异类型。请尝试将其更改为如下所示:

type Mutation {
  addPairToItem(input: AddPairToItemInput!): Users!
  removePairFromItem(input: RemovePairInput!): Users!
}

这推成功了!我太傻了。非常感谢!我只是想测试一下,看看索引行是否真的被删除并报告回来
type Mutation {
  addPairToItem(input: AddPairToItemInput!): Users!
  removePairFromItem(input: RemovePairInput!): Users!
}