gitlab-org--gitlab-foss/lib/gitlab/global_id.rb
Luke Duncalfe 073c8b25ea GraphQL support for Notes created in discussions
A new `discussion_id` argument on the `createNote` mutation allows
people to create a note within that discussion.

The ability to lazy-load Discussions has been added, so
GraphQL.object_from_id can treat Discussions the same as AR objects and
batch load them.

https://gitlab.com/gitlab-org/gitlab-ce/issues/62826
https://gitlab.com/gitlab-org/gitlab-ee/issues/9489
2019-07-10 12:13:48 +12:00

14 lines
342 B
Ruby

# frozen_string_literal: true
module Gitlab
module GlobalId
def self.build(object = nil, model_name: nil, id: nil, params: nil)
if object
model_name ||= object.class.name
id ||= object.id
end
::URI::GID.build(app: GlobalID.app, model_name: model_name, model_id: id, params: params)
end
end
end