2019-01-14 17:13:17 +01:00
|
|
|
defmodule MobilizonWeb.Schema.Events.ParticipantType do
|
2019-01-14 17:48:08 +01:00
|
|
|
@moduledoc """
|
|
|
|
Schema representation for Participant
|
|
|
|
"""
|
2019-01-14 17:13:17 +01:00
|
|
|
use Absinthe.Schema.Notation
|
2019-01-14 17:48:08 +01:00
|
|
|
import Absinthe.Resolution.Helpers, only: [dataloader: 1]
|
2019-01-14 17:13:17 +01:00
|
|
|
|
|
|
|
@desc "Represents a participant to an event"
|
|
|
|
object :participant do
|
|
|
|
field(:event, :event,
|
|
|
|
resolve: dataloader(Events),
|
|
|
|
description: "The event which the actor participates in"
|
|
|
|
)
|
|
|
|
|
|
|
|
field(:actor, :actor, description: "The actor that participates to the event")
|
|
|
|
field(:role, :integer, description: "The role of this actor at this event")
|
|
|
|
end
|
|
|
|
end
|