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

package_details_resolver.rb « resolvers « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dcf4430e55fdcd85ae9675d47ff5201080199f27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Resolvers
  # No return types defined because they can be different.
  # rubocop: disable Graphql/ResolverType
  class PackageDetailsResolver < BaseResolver
    argument :id, ::Types::GlobalIDType[::Packages::Package],
      required: true,
      description: 'The global ID of the package.'

    def resolve(id:)
      # TODO: remove this line when the compatibility layer is removed
      # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
      id = ::Types::GlobalIDType[::Packages::Package].coerce_isolated_input(id)
      GitlabSchema.find_by_gid(id)
    end
  end
end