Skip to content

v0.2.0

Compare
Choose a tag to compare
@benjie benjie released this 19 Dec 16:20

⚠️ BREAKING CHANGE ⚠️ to the SQL hooks; all previous SQL hooks are now invalid.

SQL hooks have now both become easier to use and more powerful. Gone is the old way of defining the hooks using the mutation name (e.g. updateUserById) and having to navigate through the input object to find the data you need. Now you just use the table name and SQL operation to name the function (e.g. users_insert_before, note there's no need for quotes here too!), and you're automatically passed the relevant data object (e.g. userPatch for the updateUser* mutations). You're also now passed the record from the DB, so there's no struggles over parsing nodeId or determining the relevant unique key to use for the mutation. And our function support has increased significantly.

I've updated the README with the new instructions. Enjoy!

(The JS API is unchanged.)