Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to test AppSync code locally and/or in CI/CD?

I am looking to dive into a project using AppSync. So far I have been able to find plenty of articles and such online giving all the steps as to what buttons to click in order to get a sample project running, but none of them seem to touch on how one deals with it from a local development or in a CI/CD environment. Its probably my "old school" idea of how dev usually works, but I was expecting some way to simulate enough of the environment locally to do development and run unit tests, but I can't seem to find any way to do just that. And when I get to the UI portion I have no idea how to have a local dev instance of the backend to run against.

Do people not develop in this way anymore, opting to instead stand up a "development stack"? I just want to make sure I am not painting myself into a corner in the future.

like image 887
CodeChimp Avatar asked Aug 09 '18 21:08

CodeChimp


People also ask

How do I test AWS AppSync?

Testing Resolvers In the AWS AppSync console, go to the Schema page, and choose an existing resolver on the right to edit it. Or, choose Attach to add a new resolver. At the top of the page, choose Select test context, choose Create new context, and then enter a name.

How do I deploy AppSync?

Create a stage to deploy the application stack to an Alpha environment for further testing and validations. Create the End-to-End Test stage. Create end-to-end tests to validate the AWS AppSync GraphQL API endpoint returns appropriate results for queries and mutations. Create the Production Deployment stage.

What is AppSync AWS?

AWS AppSync is a serverless GraphQL and Pub/Sub API service that simplifies building modern web and mobile applications. AWS AppSync GraphQL APIs simplify application development by providing a single endpoint to securely query or update data from multiple databases, microservices, and APIs.


1 Answers

Short answer is no. Here are your options:

  • AppSync Emulator for Serverless Framework. It's a nice emulator, but still limited and differs quite a bit from the the real API in my opinion.
  • We ended up writing separated unit tests for VTL templates and compare result query to an appropriate fixture. You could deploy full featured VTL Parser on Java but there are simpler solutions: a Python library AirSpeed; for JS you could use one from the AppSync Emulator.
like image 137
Shmygol Avatar answered Dec 14 '22 23:12

Shmygol