Move queries and mutations to submodules

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-01-25 15:41:10 +01:00
parent 0c2931c10b
commit c55ae19f84
9 changed files with 220 additions and 203 deletions

View File

@@ -4,6 +4,7 @@ defmodule MobilizonWeb.Schema.Events.ParticipantType do
"""
use Absinthe.Schema.Notation
import Absinthe.Resolution.Helpers, only: [dataloader: 1]
alias MobilizonWeb.Resolvers
@desc "Represents a participant to an event"
object :participant do
@@ -15,4 +16,14 @@ defmodule MobilizonWeb.Schema.Events.ParticipantType do
field(:actor, :actor, description: "The actor that participates to the event")
field(:role, :integer, description: "The role of this actor at this event")
end
object :participant_queries do
@desc "Get all participants for an event uuid"
field :participants, list_of(:participant) do
arg(:uuid, non_null(:uuid))
arg(:page, :integer, default_value: 1)
arg(:limit, :integer, default_value: 10)
resolve(&Resolvers.Event.list_participants_for_event/3)
end
end
end