Add the Cargo Table to Hasura
In the Hasura Console click the Data tab and click
Create Tableunder the default database.
Table name is
Frequently used columnsand select the id one with UUID
Add four other columns
- launch_id - text
- name - text
- user_id - text
- weight - integer
Add the table. You should now be on the modify page of the table.
- launch_id -> launchId
- user_id -> userId
Click on the permissions table and enter a new role of
Keep the insert permissions as disabled, we want to do our own validation on our server before inserting
For select permissions we allow with custom check of user_id _eq
X-Hasura-User-Id, allow user to access all columns, and allow them to make aggregation queries.
For update permissions the pre-update check will be the same as
selectand allow them only to update the
Finally, for delete allow with the same custom check as
For homework, send an email via Sendgrid whenever a new cargo is added using Hasura's Data Hub
- Build apps and APIs 10x faster
- Built-in authorization and caching
- 8x more performant than hand-rolled APIs