ash_graphql/lib/resource/subscription/resolve_function.ex

14 lines
328 B
Elixir
Raw Normal View History

2024-01-05 00:53:59 +13:00
defmodule AshGraphql.Resource.Subscription.ResolveFunction do
use AshGraphql.Resource.Subscription.Resolve
@impl true
def resolve(changeset, [fun: {m, f, a}], context) do
apply(m, f, [changeset, context | a])
end
@impl true
def resolve(changeset, [fun: fun], context) do
fun.(changeset, context)
end
end