Welcome to mirror list, hosted at ThFree Co, Russian Federation.

resolves_ids.rb « concerns « resolvers « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8bf2a6b2ac9f7ef7d3df114ec47b20b4d2290f40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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