radar/twist-v2

View on GitHub
backend/lib/twist/web/graphql/mutations/notes/close.rb

Summary

Maintainability
A
35 mins
Test Coverage
module Twist
  module Web
    module GraphQL
      module Mutations
        module Notes
          class Close < BaseMutation
            argument :id, ID, required: true

            type Types::Note

            def resolve(id:)
              close = Transactions::Notes::Close.new(
                note_repo: context[:note_repo],
              )
              close.(id: id).success
            end
          end
        end
      end
    end
  end
end