debian-mirror-gitlab/app/graphql/resolvers/achievements/achievements_resolver.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
629 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# frozen_string_literal: true
module Resolvers
module Achievements
class AchievementsResolver < BaseResolver
include LooksAhead
type ::Types::Achievements::AchievementType.connection_type, null: true
alias_method :namespace, :object
def resolve_with_lookahead
return ::Achievements::Achievement.none if Feature.disabled?(:achievements, namespace)
apply_lookahead(namespace.achievements)
end
private
def preloads
{
user_achievements: [{ user_achievements: [:user, :awarded_by_user, :revoked_by_user] }]
}
end
end
end
end