Class: Mutations::Ci::PipelineDestroy

Inherits:
Base
  • Object
show all
Defined in:
app/graphql/mutations/ci/pipeline_destroy.rb

Constant Summary

Constants inherited from BaseMutation

BaseMutation::ERROR_MESSAGE

Instance Method Summary collapse

Methods inherited from BaseMutation

#api_user?, #current_user, #errors_on_object, #ready?

Instance Method Details

#resolve(id:) ⇒ Object


10
11
12
13
14
15
16
17
18
19
# File 'app/graphql/mutations/ci/pipeline_destroy.rb', line 10

def resolve(id:)
  pipeline = authorized_find!(id: id)
  project = pipeline.project

  result =  ::Ci::DestroyPipelineService.new(project, current_user).execute(pipeline)
  {
    success: result.success?,
    errors: result.errors
  }
end