mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 20:41:49 +03:00
f83a8e591f
Rename the admin secret key header used to access GraphQL engine from X-Hasura-Access-Key to X-Hasura-Admin-Secret. Server CLI and console all support the older flag but marks it as deprecated. |
||
---|---|---|
.. | ||
HTTPTrigger | ||
.gitignore | ||
host.json | ||
README.md |
Setup tables
- Create table:
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 Cloud Function
- Run the following commands to deploy:
az group create --name 'my-functions-group' --location southindia
az storage account create --name 'myfunctionsstorage' --location southindia --resource-group 'my-functions-group' --sku Standard_LRS
az functionapp create --name 'myfunctionsapp' --storage-account 'myfunctionsstorage' --resource-group 'my-functions-group' --consumption-plan-location southindia
func azure login
func azure subscriptions set 'Free Trial'
func azure functionapp publish 'myfunctionsapp'
- Set Environment variables
ADMIN_SECRET
andHGE_ENDPOINT
- Add a X-Function-Key header if Authorization level is enabled
Running locally
func host start
Check Logs
func azure functionapp logstream 'myfunctionsapp'
Add the trigger in Hasura GraphQL
- In events tab, add a trigger
- Select all insert, update, delete operations for the trigger.
- Paste your function URL as the webhook.