From 073c8b25ea36b6b96eab05eb675e8726b1d5318e Mon Sep 17 00:00:00 2001 From: Luke Duncalfe Date: Thu, 4 Jul 2019 15:33:14 +1200 Subject: 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 --- app/graphql/gitlab_schema.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/graphql/gitlab_schema.rb') 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 -- cgit v1.2.1