debian-mirror-gitlab/app/graphql/mutations/boards/create.rb
2021-02-22 17:27:13 +05:30

33 lines
778 B
Ruby

# frozen_string_literal: true
module Mutations
module Boards
class Create < ::Mutations::BaseMutation
include Mutations::ResolvesResourceParent
graphql_name 'CreateBoard'
include Mutations::Boards::CommonMutationArguments
field :board,
Types::BoardType,
null: true,
description: 'The board after mutation.'
authorize :admin_board
def resolve(args)
board_parent = authorized_resource_parent_find!(args)
response = ::Boards::CreateService.new(board_parent, current_user, args).execute
{
board: response.payload,
errors: response.errors
}
end
end
end
end
Mutations::Boards::Create.prepend_if_ee('::EE::Mutations::Boards::Create')