Allow to register custom categories

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-03-28 20:02:43 +02:00
parent f5bdedf789
commit 368911b58e
40 changed files with 4587 additions and 725 deletions

View File

@@ -16,6 +16,13 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
field(:contact, :string, description: "The instance's contact details")
field(:languages, list_of(:string), description: "The instance's admins languages")
field(:event_categories, list_of(:event_category_option),
description: "The instance list of event categories possibilities"
) do
resolve(&Config.event_categories/3)
end
field(:registrations_open, :boolean, description: "Whether the registrations are opened")
field(:registrations_allowlist, :boolean,
@@ -332,6 +339,14 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
)
end
@desc """
Event categories list configuration
"""
object :event_category_option do
field(:id, :string, description: "The ID of the event category")
field(:label, :string, description: "The translated name of the event category")
end
object :config_queries do
@desc "Get the instance config"
field :config, :config do