Module: Mutations::Assignable

Extended by:
ActiveSupport::Concern
Included in:
Issues::SetAssignees, MergeRequests::SetAssignees
Defined in:
app/graphql/mutations/concerns/mutations/assignable.rb

Instance Method Summary collapse

Instance Method Details

#resolve(project_path:, iid:, assignee_usernames:, operation_mode:) ⇒ Object


20
21
22
23
24
25
26
27
28
29
30
# File 'app/graphql/mutations/concerns/mutations/assignable.rb', line 20

def resolve(project_path:, iid:, assignee_usernames:, operation_mode:)
  resource = authorized_find!(project_path: project_path, iid: iid)
  users = new_assignees(resource, assignee_usernames)

  assign!(resource, users, operation_mode)

  {
    resource.class.name.underscore.to_sym => resource,
    errors: errors_on_object(resource)
  }
end