.. | |||
README.md | Loading last commit info... | ||
lambda_function.rb |
README.md
Setup tables
- Create table:
profile (
id INT PRIMARY KEY,
name TEXT
)
Setup AWS Lambda
Create a lambda function in AWS. This will be our webhook.
- Create a function.
- Select Ruby 2.5 as the runtime.
- Select "Author from scratch".
- Select "handler" as the function name.
- Press "Create function".
- Add API gateway as a trigger (in this example you can use Open as the security option).
- Add an API to API gateway.
- Add the code in
lambda_function.rb
to the lambda function editor. The handler function of your lambda will be the lambda_handler.
Add the trigger in Hasura GraphQL
- In events tab, add a trigger
- Select all insert, update, delete operations for the trigger.
- Paste the API endpoint of your AWS lambda as the webhook.
Test your integration
- Create a record.
- Update a record.
- Delete a record.
- Check the logs (in the Events tab) to see what is going on.