summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/todos
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 07:33:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 07:33:21 +0000
commit36a59d088eca61b834191dacea009677a96c052f (patch)
treee4f33972dab5d8ef79e3944a9f403035fceea43f /app/graphql/mutations/todos
parenta1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff)
downloadgitlab-ce-36a59d088eca61b834191dacea009677a96c052f.tar.gz
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'app/graphql/mutations/todos')
-rw-r--r--app/graphql/mutations/todos/base.rb3
-rw-r--r--app/graphql/mutations/todos/create.rb3
-rw-r--r--app/graphql/mutations/todos/mark_all_done.rb2
-rw-r--r--app/graphql/mutations/todos/restore_many.rb3
4 files changed, 2 insertions, 9 deletions
diff --git a/app/graphql/mutations/todos/base.rb b/app/graphql/mutations/todos/base.rb
index 4dab3bbc3f4..9a94c5d1e6d 100644
--- a/app/graphql/mutations/todos/base.rb
+++ b/app/graphql/mutations/todos/base.rb
@@ -6,9 +6,6 @@ module Mutations
private
def find_object(id:)
- # TODO: remove this line when the compatibility layer is removed
- # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
- id = ::Types::GlobalIDType[::Todo].coerce_isolated_input(id)
GitlabSchema.find_by_gid(id)
end
end
diff --git a/app/graphql/mutations/todos/create.rb b/app/graphql/mutations/todos/create.rb
index ccc3d0b61e4..489d2f490ff 100644
--- a/app/graphql/mutations/todos/create.rb
+++ b/app/graphql/mutations/todos/create.rb
@@ -17,8 +17,7 @@ module Mutations
description: 'To-do item created.'
def resolve(target_id:)
- id = ::Types::GlobalIDType[Todoable].coerce_isolated_input(target_id)
- target = authorized_find!(id)
+ target = authorized_find!(target_id)
todo = TodoService.new.mark_todo(target, current_user)&.first
errors = errors_on_object(todo) if todo
diff --git a/app/graphql/mutations/todos/mark_all_done.rb b/app/graphql/mutations/todos/mark_all_done.rb
index 67a822c1067..fe4023515a4 100644
--- a/app/graphql/mutations/todos/mark_all_done.rb
+++ b/app/graphql/mutations/todos/mark_all_done.rb
@@ -39,7 +39,7 @@ module Mutations
if args[:target_id].present?
target = Gitlab::Graphql::Lazy.force(
- GitlabSchema.find_by_gid(TodoableID.coerce_isolated_input(args[:target_id]))
+ GitlabSchema.find_by_gid(args[:target_id])
)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, "Resource not available: #{args[:target_id]}" if target.nil?
diff --git a/app/graphql/mutations/todos/restore_many.rb b/app/graphql/mutations/todos/restore_many.rb
index 3453645000b..fe0ad6df65b 100644
--- a/app/graphql/mutations/todos/restore_many.rb
+++ b/app/graphql/mutations/todos/restore_many.rb
@@ -33,9 +33,6 @@ module Mutations
def model_ids_of(ids)
ids.map do |gid|
- # TODO: remove this line when the compatibility layer is removed
- # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
- gid = ::Types::GlobalIDType[::Todo].coerce_isolated_input(gid)
gid.model_id.to_i
end.compact
end