✂️ Split GraphQL schema into several files

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-01-14 17:13:17 +01:00
parent 66b0cd8e0c
commit b0bc8dfa5d
13 changed files with 403 additions and 290 deletions

View File

@@ -0,0 +1,11 @@
defmodule MobilizonWeb.Schema.Events.CategoryType do
use Absinthe.Schema.Notation
@desc "A category"
object :category do
field(:id, :id, description: "The category's ID")
field(:description, :string, description: "The category's description")
field(:picture, :picture, description: "The category's picture")
field(:title, :string, description: "The category's title")
end
end

View File

@@ -0,0 +1,14 @@
defmodule MobilizonWeb.Schema.Events.ParticipantType do
use Absinthe.Schema.Notation
@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