2020-01-26 20:34:25 +01:00
|
|
|
defmodule Mobilizon.GraphQL.Resolvers.Search do
|
2019-02-21 18:11:49 +01:00
|
|
|
@moduledoc """
|
|
|
|
Handles the event-related GraphQL calls
|
|
|
|
"""
|
2020-01-26 21:11:16 +01:00
|
|
|
|
|
|
|
alias Mobilizon.GraphQL.API.Search
|
2019-02-21 18:11:49 +01:00
|
|
|
|
|
|
|
@doc """
|
2019-04-12 15:04:32 +02:00
|
|
|
Search persons
|
2019-02-21 18:11:49 +01:00
|
|
|
"""
|
2019-04-12 15:04:32 +02: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 18:11:49 +01:00
|
|
|
end
|
|
|
|
end
|