mobilizon/lib/graphql/resolvers/search.ex
Thomas Citharel 3807ab1b63
Allow events to be searched by location and period
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-08-10 15:40:18 +02:00

29 lines
691 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, %{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, %{page: page, limit: limit} = args, _resolution) do
Search.search_events(args, page, limit)
end
end