Riptide.mutation

You're seeing just the function mutation, go back to Riptide module for more information.
Link to this function

mutation(mut, state \\ %{internal: true})

View Source

Specs

mutation(Riptide.Mutation.t(), any()) ::
  {:ok, Riptide.Mutation.t()} | {:error, any()}

Apply a mutation. This will do following steps in order

  1. Trigger Riptide.Interceptor.mutation_before/4
  2. Trigger Riptide.Interceptor.mutation_effect/4
  3. Broadcast mutation to interested processes
  4. Write mutation to stores
  5. Trigger c:Riptide.Interceptor.mutation_after/4

Examples

iex> mut = Riptide.Mutation.put_merge(["foo", "bar"], "hello")
iex> Riptide.mutation(mut)
{:ok, %{
  merge: %{
    "foo" => %{
      "bar" => "hello
    }
  },
  delete: %{}
}}