2019-09-30 21:07:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Notes
|
|
|
|
class Base < BaseMutation
|
2022-05-07 20:08:51 +05:30
|
|
|
QUICK_ACTION_ONLY_WARNING = <<~NB
|
|
|
|
If the body of the Note contains only quick actions,
|
|
|
|
the Note will be destroyed during an update, and no Note will be
|
|
|
|
returned.
|
|
|
|
NB
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
field :note,
|
|
|
|
Types::Notes::NoteType,
|
|
|
|
null: true,
|
2021-10-27 15:23:28 +05:30
|
|
|
description: 'Note after mutation.'
|
2019-09-30 21:07:59 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def find_object(id:)
|
2021-01-03 14:25:43 +05:30
|
|
|
# TODO: remove explicit coercion once compatibility layer has been removed
|
|
|
|
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
|
|
|
|
id = ::Types::GlobalIDType[::Note].coerce_isolated_input(id)
|
|
|
|
GitlabSchema.find_by_gid(id)
|
2019-09-30 21:07:59 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|