2019-02-21 17:11:49 +00:00
|
|
|
defmodule MobilizonWeb.Resolvers.Search do
|
|
|
|
@moduledoc """
|
|
|
|
Handles the event-related GraphQL calls
|
|
|
|
"""
|
|
|
|
alias MobilizonWeb.API.Search
|
|
|
|
|
|
|
|
@doc """
|
2019-04-12 13:04:32 +00:00
|
|
|
Search persons
|
2019-02-21 17:11:49 +00:00
|
|
|
"""
|
2019-04-12 13:04:32 +00:00
|
|
|
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)
|
2019-02-21 17:11:49 +00:00
|
|
|
end
|
|
|
|
end
|