Introduce event language detection

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-08-19 20:43:35 +02:00
parent 7c9b76765f
commit d577b07c6e
16 changed files with 206 additions and 15 deletions

View File

@@ -104,6 +104,7 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
field(:inserted_at, :datetime, description: "When the event was created")
field(:options, :event_options, description: "The event options")
field(:metadata, list_of(:event_metadata), description: "A key-value list of metadata")
field(:language, non_null(:string), description: "The event language")
end
@desc "The list of visibility options for an event"
@@ -401,6 +402,7 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
)
arg(:contacts, list_of(:contact), default_value: [], description: "The events contacts")
arg(:language, :string, description: "The event language", default_value: "und")
resolve(&Event.create_event/3)
end
@@ -444,6 +446,7 @@ defmodule Mobilizon.GraphQL.Schema.EventType do
arg(:metadata, list_of(:event_metadata_input), description: "The event metadata")
arg(:draft, :boolean, description: "Whether or not the event is a draft")
arg(:contacts, list_of(:contact), default_value: [], description: "The events contacts")
arg(:language, :string, description: "The event language", default_value: "und")
resolve(&Event.update_event/3)
end