简体   繁体   中英

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? Or the only/best way to have more complicated processing is to use a lambda function ?

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; 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

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? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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