Search code examples
graphqlaws-amplifyaws-appsyncvtl

Resolver Mapping Template development guidelines


Subject
I'm using amplify with GraphQL and DynamoDB as backend which works through AppSync. AppSync generates json based on vtl and executes it (I don't know in fact what part of the service executes it) - so it names as Resolver Mapping Template

I need to cover all my GraphQL endpoints with custom resolvers written by me but development hurts, cause I cannot find any workaround how to simplify development and testing except via aws console, what is slow and inconvenient

What I tried
As an approach I tried to create DynamoDB json files and upload them via awscli, but AppSync uses another json format - Resolver Mapping Template

What I need
I would like to know any workaround and guidelines how to develop, debug and test my resolvers. So I need 2 options or both

  1. Compare generated template with all $util stuff. nice to have
  2. Execute generated template via cli into DynamoDB for checking results (or maybe there are any mock system). great to have

Solution

  • The recommendation would be to use the Amplify CLI to manage auto-creating the resolvers as well as updating them yourself to alleviate some of the 'development hurts' part.

    I noticed that you mentioned one of the things you are looking for is the ability to rapidly test the resolvers (that in this case amplify cli will create for you) but as stated it will take some time with every amplify push for the cfn to update. What might interest in you (and potentially alleviate this issue for you) is this new RFC for the amplify cli: https://github.com/aws-amplify/amplify-cli/issues/1433

    See if it covers your needs if not, add a comment to that github post.