✂️ Split GraphQL schema into several files
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
11
lib/mobilizon_web/schema/events/category.ex
Normal file
11
lib/mobilizon_web/schema/events/category.ex
Normal 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
|
||||
14
lib/mobilizon_web/schema/events/participant.ex
Normal file
14
lib/mobilizon_web/schema/events/participant.ex
Normal 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
|
||||
Reference in New Issue
Block a user