1

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 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

2 Comments

As @mwarger mention, you can annotate your gql schema with @function. See aws.amazon.com/blogs/mobile/…
Here's the link to the latest docs docs.amplify.aws/cli/graphql-transformer/function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.