Current section

Files

Jump to
riptide lib riptide handlers mutation.ex
Raw

lib/riptide/handlers/mutation.ex

defmodule Riptide.Handler.Mutation do
@moduledoc false
use Riptide.Handler
def handle_call("riptide.mutation", mut, state) do
(mut["merge"] || %{})
|> Riptide.Mutation.new(mut["delete"] || %{})
|> Riptide.mutation(state)
|> case do
{:ok, _mut} -> {:reply, :ok, state}
{:error, err} -> {:error, err, state}
end
end
end