mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 20:41:49 +03:00
a21f6cd648
Changes compared to `/v1alpha1/graphql` * Changed all graphql responses in **/v1/graphql** endpoint to be 200. All graphql clients expect responses to be HTTP 200. Non-200 responses are considered transport layer errors. * Errors in http and websocket layer are now consistent and have similar structure. |
||
---|---|---|
.. | ||
.gitignore | ||
index.js | ||
package.json | ||
README.md |
Setup tables
- Create the table using the console:
Table name: notes
Columns:
id: Integer auto-increment
note: Text
Table name: note_revision
Columns:
id: Integer auto-increment
note: Text
note_id: Integer (foreign key to notes.id)
update_at: Timestamp, default `now()`
Setup AWS Lambda
Create a lambda function in AWS. This will be our webhook.
- In this folder, run
npm install
- Then create a zip:
zip -r hge-mutation.zip .
- Create a Lambda function.
- Select Node.js 8.10 as the runtime.
- Select "start from scratch".
- Add API gateway as a trigger.
- Add an API to API gateway.
- Upload the zip from previous step. The handler function of your lambda will be
index.handler
. - Add the following enviroment variables in your lambda config:
ACCESS_KEY
: this is the access key you configured when you setup HGE.HGE_ENDPOINT
: the URL on which you HGE instance is running.
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.