Pluxbox Logo

Mutation Block

Purpose:

The mutation blocks help us modify the records in the database.

Input

  • Execute
    Sends the mutation(request), when a true value is provided. When the query returns(response), the output is passed to the value. Depending on the type of the Mutation Block we have some more Inputs in addition to the Execute.

Types:

There are 4 main types of mutation blocks:

  • Create

The create block helps us create a record in the database.
Input: An Object of the record that we want to add

  • Update

The update block helps us update a record in the database.
Input:

  • Id: the unique key of the record that we want to modify.
  • An Object of the record that we want to replace the previous record with.
  • Delete

The delete block helps us delete a record from the database.
Input:

  • Id: the unique key of the record that we want to delete.
  • Upsert

The upsert block is a mix of the crete and the update block. It will act as an Update block if both an Id and an Object are provided. Otherwise if only the Object is provided it will act as a Create block.

Output:

All of the blocks above output an Object of the record that has been modified