debian-mirror-gitlab/app/graphql/resolvers/concerns/resolves_ids.rb
2021-10-27 15:23:28 +05:30

16 lines
398 B
Ruby

# frozen_string_literal: true
module ResolvesIds
extend ActiveSupport::Concern
def resolve_ids(ids, type)
Array.wrap(ids).map do |id|
next unless id.present?
# TODO: remove this line when the compatibility layer is removed
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
id = type.coerce_isolated_input(id)
id.model_id
end.compact
end
end