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

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

module Resolvers
  class RecentBoardsResolver < BaseResolver
    type Types::BoardType, null: true

    def resolve
      parent = object.respond_to?(:sync) ? object.sync : object
      return Board.none unless parent

      recent_visits =
        ::Boards::VisitsFinder.new(parent, current_user).latest(Board::RECENT_BOARDS_SIZE)

      recent_visits&.map(&:board) || []
    end
  end
end