2021-12-11 22:18:48 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Mixin for all resolver classes for type `Types::GroupType.connection_type`.
|
|
|
|
module ResolvesGroups
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
include LooksAhead
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
def resolve_with_lookahead(...)
|
|
|
|
apply_lookahead(resolve_groups(...))
|
2021-12-11 22:18:48 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# The resolver should implement this method.
|
|
|
|
def resolve_groups(**args)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def preloads
|
|
|
|
{
|
|
|
|
container_repositories_count: [:container_repositories],
|
|
|
|
custom_emoji: [:custom_emoji],
|
|
|
|
full_path: [:route],
|
|
|
|
path: [:route],
|
2023-03-04 22:38:38 +05:30
|
|
|
web_url: [:route],
|
2021-12-11 22:18:48 +05:30
|
|
|
dependency_proxy_blob_count: [:dependency_proxy_blobs],
|
|
|
|
dependency_proxy_blobs: [:dependency_proxy_blobs],
|
|
|
|
dependency_proxy_image_count: [:dependency_proxy_manifests],
|
|
|
|
dependency_proxy_image_ttl_policy: [:dependency_proxy_image_ttl_policy],
|
|
|
|
dependency_proxy_setting: [:dependency_proxy_setting]
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|