6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/types/decidim/core/has_localized_input_sort.rb', line 6
def self.included(child_class)
child_class.argument :locale,
type: String,
description: "Specify the locale to use when ordering translated fields, otherwise default organization language will be used",
required: false,
prepare: ->(locale, ctx) do
unless ctx[:current_organization].available_locales.include?(locale)
raise GraphQL::ExecutionError, "#{locale} locale is not used in the organization"
end
locale
end
end
|