debian-mirror-gitlab/app/graphql/mutations/boards/create.rb

34 lines
778 B
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
module Mutations
module Boards
class Create < ::Mutations::BaseMutation
2021-01-29 00:20:46 +05:30
include Mutations::ResolvesResourceParent
2021-01-03 14:25:43 +05:30
graphql_name 'CreateBoard'
2021-02-22 17:27:13 +05:30
include Mutations::Boards::CommonMutationArguments
2021-01-03 14:25:43 +05:30
field :board,
Types::BoardType,
null: true,
description: 'The board after mutation.'
authorize :admin_board
def resolve(args)
2021-01-29 00:20:46 +05:30
board_parent = authorized_resource_parent_find!(args)
2021-02-22 17:27:13 +05:30
2021-01-03 14:25:43 +05:30
response = ::Boards::CreateService.new(board_parent, current_user, args).execute
{
board: response.payload,
errors: response.errors
}
end
end
end
end
2021-02-22 17:27:13 +05:30
Mutations::Boards::Create.prepend_if_ee('::EE::Mutations::Boards::Create')