aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
89 stars 75 forks source link

How to do batch updates and deletes in amplify graph ql aws amplify #369

Open 2advancesolutions opened 4 years ago

2advancesolutions commented 4 years ago

Note: If your question is regarding the AWS Amplify Console service, please log it in the official AWS Amplify Console forum

Which Category is your question related to? Graph QL

What AWS Services are you utilizing? Aws Amplify

Provide additional details e.g. code snippets

I just want to know where is the documentation location on how to do batch updates and deletes. Can you please provide clear answer how to do this?

jkeys-ecg-nmsu commented 4 years ago

Is Dynamo or Aurora Serverless your backing data source?

It's tough, AppSync doesn't seem to be designed or have ad-hoc support for these kind of traditional database operations, even though these situations crop up in natural architectures. And of course the Amplify team is constrained by service limitations in all categories.

2advancesolutions commented 4 years ago

My backend data source is Dynamo it would be a shame if this wasn't consider. I could use mysql with app sync but would i need to create custom mutations and would like to see if they could provide docs only docs i see is basic crud

How ever i see a work around aws-amplify/amplify-category-api#443 Not sure if this is the fix but needs to be supported out of the box

yuth commented 4 years ago

Amplify CLI does not support batch updates and deletes out of the box with resolvers created using the transformer. One of the problems that we have in generating resolvers that can support batch operations is not knowing the table names, at the time of resolver templates generation. Table names are determined by the cloudformation at the time of deployement by CloudFormation which happens after the resolvers are generated.

I am marking this as a feature request and adding it to our backlog.

2advancesolutions commented 4 years ago

@yuth thanks for your follow up regarding the issue. Amplify is becoming more and more popular these days hopefully you can add this feature soon. Maybe you can create a new directive for @batch and after we create the api and push and go back to modify the model we can maybe add @batch to the model so when we push again and now the resolvers know the table names since it's already created. Thanks for your support