diff options
author | Luke Duncalfe <lduncalfe@eml.cc> | 2019-07-04 15:33:14 +1200 |
---|---|---|
committer | Luke Duncalfe <lduncalfe@eml.cc> | 2019-07-10 12:13:48 +1200 |
commit | 073c8b25ea36b6b96eab05eb675e8726b1d5318e (patch) | |
tree | 5f83a17cf6e461106d8ddf8f1b84f743a09547d6 /lib | |
parent | 254f78f5dc36d4aef26d1ab2a924e4fa916221c6 (diff) | |
download | gitlab-ce-073c8b25ea36b6b96eab05eb675e8726b1d5318e.tar.gz |
GraphQL support for Notes created in discussions62826-graphql-note-mutations
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/global_id.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/global_id.rb b/lib/gitlab/global_id.rb new file mode 100644 index 00000000000..cc82b6c5897 --- /dev/null +++ b/lib/gitlab/global_id.rb @@ -0,0 +1,14 @@ +# 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 |