debian-mirror-gitlab/app/graphql/resolvers/concerns/time_frame_arguments.rb
2023-07-09 08:55:56 +05:30

17 lines
419 B
Ruby

# frozen_string_literal: true
module TimeFrameArguments
extend ActiveSupport::Concern
included do
argument :timeframe, Types::TimeframeInputType,
required: false,
description: 'List items overlapping the given timeframe.'
end
def transform_timeframe_parameters(args)
return {} unless args[:timeframe]
args[:timeframe].to_h.transform_keys { |k| :"#{k}_date" }
end
end