Class: Types::WorkItems::Widgets::DevelopmentType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/work_items/widgets/development_type.rb

Overview

Disabling widget level authorization as it might be too granular and we already authorize the parent work item rubocop:disable Graphql/AuthorizeTypes – reason above

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#closing_merge_requestsObject



52
53
54
55
56
57
58
# File 'app/graphql/types/work_items/widgets/development_type.rb', line 52

def closing_merge_requests
  if object.closing_merge_requests.loaded?
    object.closing_merge_requests
  else
    object.closing_merge_requests.preload_merge_request_for_authorization
  end
end


44
45
46
47
48
49
50
# File 'app/graphql/types/work_items/widgets/development_type.rb', line 44

def related_branches
  return [] unless object.work_item.project

  ::Issues::RelatedBranchesService
    .new(container: object.work_item.project, current_user: current_user)
    .execute(object.work_item)
end