Sha256: a7176118ae3725761d77134b24a2fbe3aa837f95267cd03efabf7db3189015a2
Contents?: true
Size: 644 Bytes
Versions: 50
Compression:
Stored size: 644 Bytes
Contents
# frozen_string_literal: true module Decidim module Core class BaseInputSort < GraphQL::Schema::InputObject # Overwrite the prepare method to allow 2 possible values only def prepare arguments.each do |key, value| next if key.to_s == "locale" next if value.respond_to?(:call) raise GraphQL::ExecutionError, "Invalid order value for #{key.inspect}, only ASC or DESC are valids (received #{value.inspect})" unless valid_order?(value) end super end private def valid_order?(order) %w(asc desc).include? order.downcase end end end end
Version data entries
50 entries across 50 versions & 1 rubygems