Im trying to apply filters in subscription but I’m having some trouble in the resolver file.
the absinth resolution requires as a parameter a {:ok, params} o {:error,params } so it can execute, the problem is that everything y send appears at my subscription, i want to stop the execution so nothing is sent to my subscription
this is what I have tried
def subscribe(item, args, %{context: %{current_token: _current_token}}) do
filter_subscription(item, args)
end
def subscribe(_args, _info, _ctx) do
{:error, "Not Authorized"}
end
def filter_subscription(item, %{filter: filter}) do
IO.inspect item
IO.inspect(filter)
case filter do
%{name: name}->
case String.contains?(item.name, name) do
true ->
{:ok, item}
false ->
nil
end
_hey ->
IO.puts "error"
end
end
end ```