mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 12:31:52 +03:00
.. | ||
src | ||
pom.xml | ||
README.md |
Setup tables
- Create table:
notes:
id: int
note: text
Setup AWS Lambda
Create a lambda function in AWS. This will be our webhook.
- Create a function.
- Select Java 8 as the runtime.
- Select "start from scratch".
- Add API gateway as a trigger.
- Add an API to API gateway.
- Edit the code in the
handleRequest
method in/src/main/java/example/Hello.java
.
Deploy AWS Lambda
- In terminal go into project:
cd community/boilerplates/serverless-triggers/aws-lambda/java/echo
- Build deployment package:
mvn package
- Upload
target/java-lambda-1.0-SNAPSHOT.jar
using AWS console.
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.