* 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/
type Mutation {
batchAdd(models: [Input]): [Model]
}
@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
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.batchAddfield that was defined in yourschema.graphqlwhere 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@modeldirective 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.