Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Duncalfe <lduncalfe@eml.cc>2019-07-04 06:33:14 +0300
committerLuke Duncalfe <lduncalfe@eml.cc>2019-07-10 03:13:48 +0300
commit073c8b25ea36b6b96eab05eb675e8726b1d5318e (patch)
tree5f83a17cf6e461106d8ddf8f1b84f743a09547d6 /app/graphql/gitlab_schema.rb
parent254f78f5dc36d4aef26d1ab2a924e4fa916221c6 (diff)
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
Diffstat (limited to 'app/graphql/gitlab_schema.rb')
-rw-r--r--app/graphql/gitlab_schema.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/graphql/gitlab_schema.rb b/app/graphql/gitlab_schema.rb
index 152ebb930e2..7edd14e48f7 100644
--- a/app/graphql/gitlab_schema.rb
+++ b/app/graphql/gitlab_schema.rb
@@ -66,6 +66,8 @@ class GitlabSchema < GraphQL::Schema
if gid.model_class < ApplicationRecord
Gitlab::Graphql::Loaders::BatchModelLoader.new(gid.model_class, gid.model_id).find
+ elsif gid.model_class.respond_to?(:lazy_find)
+ gid.model_class.lazy_find(gid.model_id)
else
gid.find
end