Amplify-cli: How to define batch AppSync mutations

Created on 19 Oct 2018  路  2Comments  路  Source: aws-amplify/amplify-cli

* Which Category is your question related to? *
How to create batch AppSync mutation as according to https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html

* What AWS Services are you utilizing? *
AppSync, DynamoDB

* Provide additional details e.g. code snippets *
How do I create a batch AppSync mutations as the example in https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html, using Amplify?

amplify/backend/api//schema.graphql does not look like the correct place to create

type Mutation {
  batchAdd(models: [Input]): [Model]
}
graphql-transformer question

Most helpful comment

@kangks Thank you for the comment. We are actively working on building a customer resolver flow into both the Amplify CLI and GraphQL Transform that will allow you to define custom resolvers using VTL. This will allow you to attach a custom resolver to the Mutation.batchAdd field that was defined in your schema.graphql where you can implement the batch write mutation yourself with VTL on your local machine. The CLI will then take your VTL and wire it up with the rest of your API. In the future, the @model directive may expose capabilities to generate batch mutations in addition to what it generates today but this is not yet planned and does not have a release date.

All 2 comments

@kangks Thank you for the comment. We are actively working on building a customer resolver flow into both the Amplify CLI and GraphQL Transform that will allow you to define custom resolvers using VTL. This will allow you to attach a custom resolver to the Mutation.batchAdd field that was defined in your schema.graphql where you can implement the batch write mutation yourself with VTL on your local machine. The CLI will then take your VTL and wire it up with the rest of your API. In the future, the @model directive may expose capabilities to generate batch mutations in addition to what it generates today but this is not yet planned and does not have a release date.

Closing this issue since we have a duplicate issue for Custom resolvers opened out here -> https://github.com/aws-amplify/amplify-cli/issues/74

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onlybakam picture onlybakam  路  3Comments

ReidWeb picture ReidWeb  路  3Comments

MageMasher picture MageMasher  路  3Comments

nicksmithr picture nicksmithr  路  3Comments

nason picture nason  路  3Comments