Sha256: d5732d16739c3f8f8ecec5284b2eda76da76e2da2f388860fefe7b68154c4508
Contents?: true
Size: 1.27 KB
Versions: 12
Compression:
Stored size: 1.27 KB
Contents
# frozen_string_literal: true module Decidim module Core class ComponentInputSort < BaseInputSort include HasLocalizedInputSort graphql_name "ComponentSort" description "A type used for sorting any component parent objects" argument :id, GraphQL::Types::String, "Sort by ID, valid values are ASC or DESC", required: false argument :weight, GraphQL::Types::String, "Sort by weight (order in the website), valid values are ASC or DESC", required: false argument :type, type: GraphQL::Types::String, description: "Sort by type of component, alphabetically, valid values are ASC or DESC", required: false, as: :manifest_name argument :name, type: GraphQL::Types::String, description: "Sort by name of the component, alphabetically, valid values are ASC or DESC", required: false, as: :name, prepare: lambda { |direction, ctx| lambda { |locale| locale = ctx[:current_organization].default_locale if locale.blank? [Arel.sql("name->? #{direction.upcase}").to_s, locale] } } end end end
Version data entries
12 entries across 12 versions & 1 rubygems