Sha256: 76724666503775cd62235f6fb21f56b909abf21e22023d134a97c53796a5ff9c
Contents?: true
Size: 560 Bytes
Versions: 10
Compression:
Stored size: 560 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 == "locale" raise GraphQL::ExecutionError, "Invalid order value for #{key}, only ASC or DESC are valids" 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
10 entries across 10 versions & 1 rubygems