Update Data in Database Triggered by Client Interactions with Netlify Serverless Functions

InstructorJason Lengstorf

Share this video with your friends

Send Tweet

We'll update our boops count by utilizing the update_boops_by_pk, an auto-generated query provided by Hasura.

We'll create a new serverless function called add-boop.js that takes events and arguments provided by the UpdateBoopCount mutation.

We can increment and store the boop count by making a request with the handleBoop function.

As UX improvements, the button is disabled and enabled when the increment boop function is being called. The button text updates to match the current state.