【发布时间】:2018-06-29 07:18:41
【问题描述】:
有什么方法可以将 appsync 连接到 dynamodb 并选择一次放置多个项目?我问的是 dynamodb reuqest 映射。
假设我们有 saveVotes 突变
type Mutation {
saveVotes(votes: [VoteInput]): [Vote]!
}
我应该如何设计 dynamo 请求模板以将每个投票保存为 dynamodb 中的单独对象?每个 VoteInput 都有 ID。我正在发送 5 个 VoteInput,并且我想要 5 个单独的对象,在 dynamodb 中有单独的 ID。 在 AWS 文档中,有仅针对单个 putItem 的示例,这对我来说还不够 https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-dynamodb.html#aws-appsync-resolver-mapping-template-reference-dynamodb-putitem
【问题讨论】:
-
当您执行单个
PutItem时,您的PutItem操作是否需要conditionExpression?如果没有,那么您可以使用 AWS AppSyncBatchPutItem操作。这里有一个关于如何使用它的教程docs.aws.amazon.com/appsync/latest/devguide/…。 -
当前日期最好的方法是什么?
标签: amazon-web-services graphql aws-appsync