summaryrefslogtreecommitdiff
path: root/app/graphql/mutations/notes/base.rb
blob: d6c8121eee78921286eaa025d591daecc3140ddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Mutations
  module Notes
    class Base < BaseMutation
      field :note,
            Types::Notes::NoteType,
            null: true,
            description: 'Note after mutation.'

      private

      def find_object(id:)
        # 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)
      end
    end
  end
end