radar/twist-v2

View on GitHub
backend/lib/twist/web/graphql/mutations/branches/update.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Twist
  module Web
    module GraphQL
      module Mutations
        module Branches
          class Update < BaseMutation
            argument :book_permalink, String, required: true
            argument :branch_name, String, required: true

            type Types::Branch

            def resolve(book_permalink:, branch_name:)
              update_branch = Transactions::Branches::Update.new
              update_branch.(
                current_user: context[:current_user],
                book_permalink: book_permalink,
                branch_name: branch_name,
              ).success
            end
          end
        end
      end
    end
  end
end