1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-29 03:15:27 +00:00
mobilizon/lib/graphql/resolvers/search.ex
Thomas Citharel 5afdd80c71
Fix searching for persons
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-05-02 19:27:34 +02:00

32 lines
794 B
Elixir

defmodule Mobilizon.GraphQL.Resolvers.Search do
@moduledoc """
Handles the event-related GraphQL calls
"""
alias Mobilizon.GraphQL.API.Search
@doc """
Search persons
"""
def search_persons(_parent, %{page: page, limit: limit} = args, _resolution) do
Search.search_actors(Map.put(args, :minimum_visibility, :private), page, limit, :Person)
end
@doc """
Search groups
"""
def search_groups(_parent, %{page: page, limit: limit} = args, _resolution) do
Search.search_actors(args, page, limit, :Group)
end
@doc """
Search events
"""
def search_events(_parent, %{page: page, limit: limit} = args, _resolution) do
Search.search_events(args, page, limit)
end
def interact(_parent, %{uri: uri}, _resolution) do
Search.interact(uri)
end
end