2020-06-19 19:27:10 +02:00
|
|
|
defmodule Mobilizon.GraphQL.Schema.StatisticsType do
|
|
|
|
@moduledoc """
|
|
|
|
Schema representation for Statistics
|
|
|
|
"""
|
|
|
|
use Absinthe.Schema.Notation
|
|
|
|
|
|
|
|
alias Mobilizon.GraphQL.Resolvers.Statistics
|
|
|
|
|
|
|
|
@desc "A statistics object"
|
|
|
|
object :statistics do
|
|
|
|
# Instance name
|
|
|
|
field(:number_of_users, :integer, description: "The number of local users")
|
|
|
|
field(:number_of_events, :integer, description: "The number of local events")
|
|
|
|
field(:number_of_comments, :integer, description: "The number of local comments")
|
2020-09-30 10:42:19 +02:00
|
|
|
field(:number_of_groups, :integer, description: "The number of local groups")
|
2020-06-19 19:27:10 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
object :statistics_queries do
|
|
|
|
@desc "Get the instance statistics"
|
|
|
|
field :statistics, :statistics do
|
|
|
|
resolve(&Statistics.get_statistics/3)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|