Skip to content

Instantly share code, notes, and snippets.

@CodebyOmar
Created February 20, 2019 09:36
Show Gist options
  • Save CodebyOmar/669591805c08e1339d65a53c68687368 to your computer and use it in GitHub Desktop.
Save CodebyOmar/669591805c08e1339d65a53c68687368 to your computer and use it in GitHub Desktop.
Setting up Hasura Event Triggers via API
{
"type": "bulk",
"args": [
{
"args": {
"headers": [],
"insert": {
"columns": [
"id",
"username",
"last_seen",
"last_typed",
"date_created"
]
},
"name": "add-user-to-rooms",
"table": {
"name": "users",
"schema": "public"
},
"webhook": "https://<YOUR_NGROK_URL>/addtorooms"
},
"type": "create_event_trigger"
},
{
"args": {
"headers": [],
"insert": {
"columns": [
"id",
"msg_text",
"username",
"room_id",
"msg_timestamp"
]
},
"name": "send-push-notification",
"table": {
"name": "messages",
"schema": "public"
},
"webhook": "https://<YOUR_NGROK_URL>/send/notification"
},
"type": "create_event_trigger"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment