1. 18
    Run Multiple DB Operations with Custom Resolvers and Fauna Query Language
    5m 46s

Run Multiple DB Operations with Custom Resolvers and Fauna Query Language

Share this video with your friends

Send Tweet

Let's implement the delete shop functionality to the buttons that we've added to the shop manage page. Fauna allows you to define custom resolvers to run multiple database operations so you don't have to make multiple trips to the database.

We'll define a new mutation in our GraphQL schema that will take in a shop id and sets the @resolver directive which will tell Fauna to create a custom resolver that we can define within Fauna.

In our Fauna database, you'll see that we have a new user generated function created. This function accepts Fauna Query Language which is the native api for interacting with Fauna. We'll perform a multi-step operation by deleting the shop and then all of the products associated with that shop.

You can read more about Fauna Query Language here and take the getting started guide to get a feel for the language.