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 77 forks source link

Minimize VTL files when they get above 64KB #233

Open GeorgeBellTMH opened 3 years ago

GeorgeBellTMH commented 3 years ago

We get Invalid request template given, must be less than 64kb in size. on some VTL files.

Looking at the files it appears they contain comments and are fairly verbose, this is great for people who are learning VTL or are going to manually update them, but for large generated files it would be good if we minimized the file size somehow.

One suggestion would be to remove comments if the file hits 64kb, then if the file is still above 64kb run some sort of minimization script on the file...such that $ownerAuthExpressions becomes $o1 (etc. etc.) and additional whitespace is removed.

Another solution would be to add a feature flag "minimizeVTL" that does the same.

GeorgeBellTMH commented 3 years ago

https://github.com/aws-amplify/amplify-cli/issues/2698