summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/boards
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/graphql/mutations/boards
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
downloadgitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/graphql/mutations/boards')
-rw-r--r--app/graphql/mutations/boards/common_mutation_arguments.rb8
-rw-r--r--app/graphql/mutations/boards/create.rb2
-rw-r--r--app/graphql/mutations/boards/destroy.rb4
-rw-r--r--app/graphql/mutations/boards/issues/issue_move_list.rb18
-rw-r--r--app/graphql/mutations/boards/lists/base_create.rb2
-rw-r--r--app/graphql/mutations/boards/lists/base_update.rb4
-rw-r--r--app/graphql/mutations/boards/lists/destroy.rb2
-rw-r--r--app/graphql/mutations/boards/update.rb4
8 files changed, 25 insertions, 19 deletions
diff --git a/app/graphql/mutations/boards/common_mutation_arguments.rb b/app/graphql/mutations/boards/common_mutation_arguments.rb
index c4f8d299318..aedb7c9c725 100644
--- a/app/graphql/mutations/boards/common_mutation_arguments.rb
+++ b/app/graphql/mutations/boards/common_mutation_arguments.rb
@@ -7,15 +7,15 @@ module Mutations
included do
argument :name,
- GraphQL::STRING_TYPE,
+ GraphQL::Types::String,
required: false,
- description: 'The board name.'
+ description: 'Board name.'
argument :hide_backlog_list,
- GraphQL::BOOLEAN_TYPE,
+ GraphQL::Types::Boolean,
required: false,
description: copy_field_description(Types::BoardType, :hide_backlog_list)
argument :hide_closed_list,
- GraphQL::BOOLEAN_TYPE,
+ GraphQL::Types::Boolean,
required: false,
description: copy_field_description(Types::BoardType, :hide_closed_list)
end
diff --git a/app/graphql/mutations/boards/create.rb b/app/graphql/mutations/boards/create.rb
index 44fc22cf883..080bf7c6e79 100644
--- a/app/graphql/mutations/boards/create.rb
+++ b/app/graphql/mutations/boards/create.rb
@@ -12,7 +12,7 @@ module Mutations
field :board,
Types::BoardType,
null: true,
- description: 'The board after mutation.'
+ description: 'Board after mutation.'
authorize :admin_issue_board
diff --git a/app/graphql/mutations/boards/destroy.rb b/app/graphql/mutations/boards/destroy.rb
index 4a0068edee2..61e0c95f8d3 100644
--- a/app/graphql/mutations/boards/destroy.rb
+++ b/app/graphql/mutations/boards/destroy.rb
@@ -8,11 +8,11 @@ module Mutations
field :board,
Types::BoardType,
null: true,
- description: 'The board after mutation.'
+ description: 'Board after mutation.'
argument :id,
::Types::GlobalIDType[::Board],
required: true,
- description: 'The global ID of the board to destroy.'
+ description: 'Global ID of the board to destroy.'
authorize :admin_issue_board
diff --git a/app/graphql/mutations/boards/issues/issue_move_list.rb b/app/graphql/mutations/boards/issues/issue_move_list.rb
index b73657ea0c8..14fe9714f99 100644
--- a/app/graphql/mutations/boards/issues/issue_move_list.rb
+++ b/app/graphql/mutations/boards/issues/issue_move_list.rb
@@ -6,19 +6,19 @@ module Mutations
class IssueMoveList < Mutations::Issues::Base
graphql_name 'IssueMoveList'
BoardGID = ::Types::GlobalIDType[::Board]
- ListID = ::GraphQL::ID_TYPE
- IssueID = ::GraphQL::ID_TYPE
+ ListID = ::GraphQL::Types::ID
+ IssueID = ::GraphQL::Types::ID
argument :board_id, BoardGID,
required: true,
loads: Types::BoardType,
description: 'Global ID of the board that the issue is in.'
- argument :project_path, GraphQL::ID_TYPE,
+ argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Project the issue to mutate is in.'
- argument :iid, GraphQL::STRING_TYPE,
+ argument :iid, GraphQL::Types::String,
required: true,
description: 'IID of the issue to mutate.'
@@ -56,11 +56,11 @@ module Mutations
issue = authorized_find!(project_path: project_path, iid: iid)
move_params = { id: issue.id, board_id: board.id }.merge(move_arguments(args))
- move_issue(board, issue, move_params)
+ result = move_issue(board, issue, move_params)
{
issue: issue.reset,
- errors: issue.errors.full_messages
+ errors: error_for(result)
}
end
@@ -79,6 +79,12 @@ module Mutations
def move_arguments(args)
args.slice(:from_list_id, :to_list_id, :move_after_id, :move_before_id)
end
+
+ def error_for(result)
+ return [] unless result.error?
+
+ [result.message]
+ end
end
end
end
diff --git a/app/graphql/mutations/boards/lists/base_create.rb b/app/graphql/mutations/boards/lists/base_create.rb
index a21c7feece3..a2d849848e0 100644
--- a/app/graphql/mutations/boards/lists/base_create.rb
+++ b/app/graphql/mutations/boards/lists/base_create.rb
@@ -4,7 +4,7 @@ module Mutations
module Boards
module Lists
class BaseCreate < BaseMutation
- argument :backlog, GraphQL::BOOLEAN_TYPE,
+ argument :backlog, GraphQL::Types::Boolean,
required: false,
description: 'Create the backlog list.'
diff --git a/app/graphql/mutations/boards/lists/base_update.rb b/app/graphql/mutations/boards/lists/base_update.rb
index b06cb3b1e32..7962d9c85d4 100644
--- a/app/graphql/mutations/boards/lists/base_update.rb
+++ b/app/graphql/mutations/boards/lists/base_update.rb
@@ -4,11 +4,11 @@ module Mutations
module Boards
module Lists
class BaseUpdate < BaseMutation
- argument :position, GraphQL::INT_TYPE,
+ argument :position, GraphQL::Types::Int,
required: false,
description: 'Position of list within the board.'
- argument :collapsed, GraphQL::BOOLEAN_TYPE,
+ argument :collapsed, GraphQL::Types::Boolean,
required: false,
description: 'Indicates if the list is collapsed for this user.'
diff --git a/app/graphql/mutations/boards/lists/destroy.rb b/app/graphql/mutations/boards/lists/destroy.rb
index a50b5f73455..4ffb95abe64 100644
--- a/app/graphql/mutations/boards/lists/destroy.rb
+++ b/app/graphql/mutations/boards/lists/destroy.rb
@@ -9,7 +9,7 @@ module Mutations
field :list,
Types::BoardListType,
null: true,
- description: 'The list after mutation.'
+ description: 'List after mutation.'
argument :list_id, ::Types::GlobalIDType[::List],
required: true,
diff --git a/app/graphql/mutations/boards/update.rb b/app/graphql/mutations/boards/update.rb
index f1a1d57306b..40ab5a5ba7d 100644
--- a/app/graphql/mutations/boards/update.rb
+++ b/app/graphql/mutations/boards/update.rb
@@ -10,12 +10,12 @@ module Mutations
argument :id,
::Types::GlobalIDType[::Board],
required: true,
- description: 'The board global ID.'
+ description: 'Board global ID.'
field :board,
Types::BoardType,
null: true,
- description: 'The board after mutation.'
+ description: 'Board after mutation.'
authorize :admin_issue_board