diff options
Diffstat (limited to 'app/graphql/types/notes/note_type.rb')
-rw-r--r-- | app/graphql/types/notes/note_type.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/graphql/types/notes/note_type.rb b/app/graphql/types/notes/note_type.rb index eef5ce40bde..05629ea9223 100644 --- a/app/graphql/types/notes/note_type.rb +++ b/app/graphql/types/notes/note_type.rb @@ -77,6 +77,14 @@ module Types def author Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find end + + # We now support also SyntheticNote notes as a NoteType, but SyntheticNote does not have a real note ID, + # as SyntheticNote is generated dynamically from a ResourceEvent instance. + def id + return super unless object.is_a?(SyntheticNote) + + ::Gitlab::GlobalId.build(object, model_name: object.class.to_s, id: object.discussion_id) + end end end end |