Even more fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-06-15 19:41:11 +02:00
parent 2e85a4a3d3
commit ef6a1a21ac
17 changed files with 213 additions and 67 deletions

View File

@@ -9,6 +9,7 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do
alias Mobilizon.Conversations.Comment
alias Mobilizon.Events.Event
alias Mobilizon.Reports.{Note, Report}
alias Mobilizon.Users.User
alias Mobilizon.GraphQL.Resolvers.Admin
@@ -32,6 +33,7 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do
value(:event_update)
value(:actor_suspension)
value(:actor_unsuspension)
value(:user_deletion)
end
@desc "The objects that can be in an action log"
@@ -54,6 +56,9 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do
%Actor{type: "Person"}, _ ->
:person
%User{}, _ ->
:user
_, _ ->
nil
end)

View File

@@ -63,7 +63,10 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
field(:draft, :boolean, description: "Whether or not the event is a draft")
field(:participant_stats, :participant_stats)
field(:participant_stats, :participant_stats,
description: "Statistics on the event",
resolve: &Event.stats_participants/3
)
field(:participants, :paginated_participant_list, description: "The event's participants") do
arg(:page, :integer, default_value: 1)
@@ -121,11 +124,7 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
end
object :participant_stats do
field(:going, :integer,
description: "The number of approved participants",
resolve: &Event.stats_participants_going/3
)
field(:going, :integer, description: "The number of approved participants")
field(:not_approved, :integer, description: "The number of not approved participants")
field(:not_confirmed, :integer, description: "The number of not confirmed participants")
field(:rejected, :integer, description: "The number of rejected participants")

View File

@@ -15,7 +15,8 @@ defmodule Mobilizon.GraphQL.Schema.UserType do
@desc "A local user of Mobilizon"
object :user do
field(:id, non_null(:id), description: "The user's ID")
interfaces([:action_log_object])
field(:id, :id, description: "The user's ID")
field(:email, non_null(:string), description: "The user's email")
field(:actors, non_null(list_of(:person)),