sid88in / serverless-appsync-plugin

serverless plugin for appsync
MIT License
951 stars 189 forks source link

Feature Request: add maxBatchSize option to configure Direct Batch Resolvers #469

Open westd opened 2 years ago

westd commented 2 years ago

https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-lambda.html#direct-lambda-resolvers

AWS has added the ability to set a maxBatchSize on a resolver so that a direct lambda resolver can handle batch loading

Please can this be added as a feature to the plugin? 🙏

From the documentation above:

Direct Lambda Resolvers: Batching enabled You can enable batching for your Direct Lambda Resolver by configuring the maxBatchSize on your resolver. When maxBatchSize is set to a value greater than 0 for a Direct Lambda resolver, AWS AppSync sends requests in batches to your Lambda function in sizes up to maxBatchSize.

Setting maxBatchSize to 0 on a Direct Lambda resolver turns off batching.

For more information on how batching with Lambda resolvers works, see Advanced use case: Batching.

sorenandersen commented 2 years ago

Looking at this PR I believe maxBatchSize is on its way once v2 is a wrap: https://github.com/sid88in/serverless-appsync-plugin/pull/461

Thanks @bboure!

bboure commented 2 years ago

MaxBatchSize will indeed come in v2 but v1 too (See #463)

Master (v1) is unfortunately currently blocked by a breaking change introduced in the the latest PR. I still need to fix it before merging #463 and release a new version.

I'll keep you updated.

sorenandersen commented 2 years ago

Hi @bboure, can I ask - very politely - what is the expected timeline for a v1 release with MaxBatchSize support?

Thanks in advance for all the effort you put in.

Best, Søren

bboure commented 2 years ago

It was part of v.13.0 sorry for the delay

sorenandersen commented 2 years ago

Thank you, we really appreciate it!