mobilizon/lib/mobilizon_web/resolvers/search.ex
Chocobozzz d66bbc5414
Add ability to search on Group, Person or Event
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-04-23 10:53:04 +02:00

28 lines
691 B
Elixir

defmodule MobilizonWeb.Resolvers.Search do
@moduledoc """
Handles the event-related GraphQL calls
"""
alias MobilizonWeb.API.Search
@doc """
Search persons
"""
def search_persons(_parent, %{search: search, page: page, limit: limit}, _resolution) do
Search.search_actors(search, page, limit, :Person)
end
@doc """
Search groups
"""
def search_groups(_parent, %{search: search, page: page, limit: limit}, _resolution) do
Search.search_actors(search, page, limit, :Group)
end
@doc """
Search events
"""
def search_events(_parent, %{search: search, page: page, limit: limit}, _resolution) do
Search.search_events(search, page, limit)
end
end