1
votes

I believe the default data source when creating GraphQL API is DynamoDB, I would like to set it to Lambda function instead.

Is there a way to do this with Amplify?

if not, what is the workaround?

I found this AWS tutorial online that states:

we'll show you how to write a Lambda function that performs business logic based on the invocation of a GraphQL field operation.

but I couldn't use this with Amplify.

1

1 Answers

1
votes

For now, you can use this pattern described here to manually setup the correct templates and target a lambda that you setup with Amplify.

https://aws-amplify.github.io/docs/cli/graphql#add-a-custom-resolver-that-targets-an-aws-lambda-function

Soon (or maybe by the time you read this, based on the status of this PR) you'll be able to annotate your GraphQL Schema with @function and have it wire up all that same stuff for you.

Hope this helps.