Open mcroker opened 5 years ago
+1 on this one, aws-utils lacks several features added in Appsync (eg. Pipelines).
Apparently the amplify-cli repo has a "util mock" plugin that provides offline functionalities. Maybe it can be used to replace aws-utils?
Ref: https://github.com/aws-amplify/amplify-cli/tree/master/packages/amplify-util-mock
@marcoreni there is even a separate package for the simulator - maybe I find some time to look into this in the next weeks
@aheissenberger @marcoreni Also huge +1 because I stumbled upon an issue with @conduitvc/appsync-emulator-serverless
. And when I wanted to fix the issue in the package, I discovered that the package has been deprecated. 😱
So replacing @conduitvc/appsync-emulator-serverless
would be very welcomed. 🙇
The issue with @conduitvc/appsync-emulator-serverless
:
Recently @conduitvc/appsync-emulator-serverless
started to escape JSON from the data sources with HTML entities.
When I used for example $util.toJson($context.result)
in VTL template - it replaced "a": "b"
output to "a": "b"
- which is absolutely incorrect.
I discovered that @conduitvc/appsync-emulator-serverless
uses old version of velocityjs
which by default has escape
parameter set to true
. In version 2.0.0 of velocityjs
the escape
parameter set by default to false
.
Version 2.0.0 of velocityjs
:
https://github.com/shepherdwind/velocity.js/commit/ba00784962ceeb1a7c7e448f452c5ffb83fbc5cb#diff-04c6e90faac2675aa89e2176d2eec7d8R114
Hotfix:
$ npm install --save-dev velocityjs@2.0.0
"postinstall": "rm -rf node_modules/@conduitvc/appsync-emulator-serverless/node_modules/velocityjs"
@FilipPyrek have you tried to fix this with selected dependency resolution - I did this with yarn for other packages and it worked very well - I only use yarn so you have to find out how this works with npm: https://yarnpkg.com/lang/en/docs/selective-version-resolutions/
@aheissenberger thanks for suggestion. Anyway I think that best overall solution will be getting rid of @conduitvc/appsync-emulator-serverless
...
Hi all, I was facing the same issues as you all since the deprecation of the emulator.
I had a look into amplify-appsync-simulator
and started making a simple wrapper around it for serverless
and serverless-appsync-plugin
.
Check it out and leave me some feedback.
Thanks for your effort @bboure! I'll test this on monday and I'll give you feedbacks
The folks over at https://github.com/ConduitVC/aws-utils have published the following depreciation notice...
I know I'm fighting against the flow by not wanting to use amplify - but currently it is too limiting for my purpose; I think serverless-framework is a better fit for my needs... I wondered if you had any thoughts on how this impacts serverless-appsync-offline