2020-06-19 19:27:10 +02:00
|
|
|
defmodule Mobilizon.GraphQL.Resolvers.Statistics do
|
|
|
|
@moduledoc """
|
|
|
|
Handles the statistics-related GraphQL calls.
|
|
|
|
"""
|
|
|
|
|
|
|
|
alias Mobilizon.Service.Statistics, as: StatisticsModule
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
Gets config.
|
|
|
|
"""
|
|
|
|
def get_statistics(_parent, _params, _context) do
|
|
|
|
{:ok,
|
|
|
|
%{
|
|
|
|
number_of_users: StatisticsModule.get_cached_value(:local_users),
|
|
|
|
number_of_events: StatisticsModule.get_cached_value(:local_events),
|
2020-09-30 10:42:19 +02:00
|
|
|
number_of_comments: StatisticsModule.get_cached_value(:local_comments),
|
|
|
|
number_of_groups: StatisticsModule.get_cached_value(:local_groups)
|
2020-06-19 19:27:10 +02:00
|
|
|
}}
|
|
|
|
end
|
|
|
|
end
|