简体   繁体   English

AWS Appsync 在一个 dynamodb 解析器中的多个 dynamodb 请求

[英]AWS Appsync multiple dynamodb requesst in one dynamodb resolver

I would like to know if it is possible to have multiple dynamodb request using only one dynamo resolver in AppSync?我想知道是否可以在 AppSync 中仅使用一个 dynamo 解析器来进行多个 dynamodb 请求? Or the only/best way to have more complicated processing is to use a lambda function ?或者进行更复杂处理的唯一/最佳方法是使用 lambda 函数?

Practically, no.实际上,没有。 You even cannot query on multiple indices in a single resource definition for an query, indeed.实际上,您甚至无法在单个资源定义中查询多个索引以进行查询。

However, if you are to use that structure for joining multiple DynamoDB tables, you can attach resolvers not to the query entry;但是,如果您要使用该结构连接多个 DynamoDB 表,您可以将解析器附加到查询条目; but to the field you want to relate on other fields.但与您想与其他领域相关的领域。

I had an issue like relating users to another table for containing the posts and I've passed it by attaching a resolver aiming the Posts field of the User type.我有一个问题,比如将用户与另一个包含帖子的表相关联,我通过附加一个针对用户类型的帖子字段的解析器来传递它。

This issue refers to a similar problem and is quite helpful for that kind of cases: https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/17这个问题指的是一个类似的问题,对这种情况非常有帮助: https : //github.com/awslabs/aws-mobile-appsync-sdk-js/issues/17

If it is not the case of yours, you can elaborate the question.如果不是你的情况,你可以详细说明这个问题。 I may look like guessing your purpose for relating tables, all in all.总而言之,我可能看起来像是在猜测您关联表格的目的。

Have you looked at batch resolvers with AWS AppSync?您是否查看过使用 AWS AppSync 的批量解析器? https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html

This will allow you to write to one or more tables in a single request, and also allow you to do multiple write/read/delete operations in a single request.这将允许您在单个请求中写入一个或多个表,还允许您在单个请求中执行多个写入/读取/删除操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM