debian-mirror-gitlab/app/graphql/resolvers/packages_resolver.rb
2021-03-11 19:13:27 +05:30

19 lines
380 B
Ruby

# frozen_string_literal: true
module Resolvers
class PackagesResolver < BaseResolver
type Types::Packages::PackageType.connection_type, null: true
def resolve(**args)
return unless packages_available?
::Packages::PackagesFinder.new(object).execute
end
private
def packages_available?
::Gitlab.config.packages.enabled
end
end
end