serverless-appsync-plugin icon indicating copy to clipboard operation
serverless-appsync-plugin copied to clipboard

Add CLI commands for creating vtl templates

Open AlexHladin opened this issue 5 years ago • 0 comments

From my perspective, it is a good idea to add a few CLI commands for better developer experience. For example: schema.graphql

sap generate mutation --name createPet

The command will produce:

...
mutation {
  createPet: Pet
}
...
type Pet {
}
...

mappings.yml

- dataSource: PetDataSource
  type: Mutation
  field: createEntity
  request: 'create-entity-request-template.vtl'
  response: 'create-entity-response-template.vtl'

create-entity-request-template.vtl

{}

create-entity-response-template.vtl

{}

The CLI interface will allow us to speed up the configuration process. If you think that it is a good idea I create a PR with implementation.

AlexHladin avatar Mar 27 '20 17:03 AlexHladin