Myz
Myz

Reputation: 828

Migrate from AWS AppSync to Apollo GraphQL (Javascript)

I am fairly new to GraphQL and have been using AWS AppSync service for GraphQL APIs. I use AWS Cognito for authentication/authorization, some Lambda functions and also have serverless RDS instance that is connected to my API. My question is:

How can I or is there a way to migrate from AppSync to Apollo GraphQL implementation in Javascript with least amount of rewriting the code and keeping the data sources as they are?

Reasons:

  1. No support for versioning in AppSync. I am unable to find way to revert back to an old version of my API. Currently, I backup my API by downloading the schema.json from AppSync and backup all my resolvers in a text file.
  2. If code gets bigger, browser gets unresponsive and takes good amount of time to load for the first time.
  3. Helper functions in $util serves great but at some points, I find it lacking somethings that I want to do differently. To work around this, I use Lambda functions. Therefore, no support for adding custom modules or libraries in AppSync.
  4. Sometimes, testing and debugging a resolver can be really frustrating. I am used to print on console and I find it really helpful.

Any help would be much appreciated.

Upvotes: 4

Views: 1413

Answers (1)

cyberwombat
cyberwombat

Reputation: 40084

This isn't really an answer on migration but more of some thoughts on your issues that you might consider.

  1. Versioning. You might explore working offline using either serverless or AWS's own SAM - that way you'd be able to version your configs.

  2. Browser gets unresponsive - My guess this is not going to get resolved by migration - perhaps there is a design issue that could be improved here.

  3. Helper functions in $util - I understand though you can often find workarounds. VTL is pretty powerful (though annoying sometimes) and I've never had to rely on a Lamdba except to do things far beyond the scope of any helper (running JSON Schema validators for ex). But I can see how it would be nice to write your own for sure.

  4. Debugging - Going offline with one of the solutions in #1 is going to help there. I don't have much experience with SAM but I use serverless very extensively and the appsync offline options offer debugging.

Perhaps this helps.

Upvotes: 2

Related Questions