2020-07-28 23:09:34 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
2021-04-17 20:07:23 +05:30
|
|
|
class ProjectPackagesResolver < BaseResolver
|
2021-03-11 19:13:27 +05:30
|
|
|
type Types::Packages::PackageType.connection_type, null: true
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
def resolve(**args)
|
|
|
|
return unless packages_available?
|
|
|
|
|
|
|
|
::Packages::PackagesFinder.new(object).execute
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def packages_available?
|
|
|
|
::Gitlab.config.packages.enabled
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|