Rules

Every mutation includes a rule set. This rule set defines the conditions that must apply to mutate a reaction.

Example: Say you wish to write movie reviews. In order to write these reviews, the following conditions must apply:

  • User must have sufficient privileges to write reviews
  • Movie must exist
  • Users can only write one review per movie
  • Content cannot be void
  • Rating cannot be null
  • Rating must be between 1 to 5

If all conditions apply, a reaction will be created, updated or deleted. You can freely define rules for each type of mutation and reaction.