Postgres triggers on GraphQL mutations
Postgres triggers can be used to perform backend operations like validation and inserting/updating related data whenever inserts or updates occur on tables. These triggers are associated with a table or view and are fired when an event such as INSERT, DELETE, UPDATE, or TRUNCATE takes place. Triggers can be invoked before, after, or instead of the operation. They can be used for server-side validation and inserting related data in a single transaction. For example, in a banking application, triggers can ensure that deposit amounts are valid and greater than zero, and in a note-taking app, they can create revisions whenever a note is updated.
Company
Hasura
Date published
Aug. 30, 2018
Author(s)
Anon Ray
Word count
507
Language
English
Hacker News points
None found.