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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 18:08:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 18:08:16 +0300
commite80e0dd64fbb04f60394cb1bb08e17dbcb22b8ce (patch)
tree9e538341b9b77e96737964813e10235dbecf47ff /app/graphql/mutations
parentef31adeb0fb9a02b2c6a4529ec4e38d7082a4b2b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/mutations')
-rw-r--r--app/graphql/mutations/concerns/mutations/resolves_issuable.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/graphql/mutations/concerns/mutations/resolves_issuable.rb b/app/graphql/mutations/concerns/mutations/resolves_issuable.rb
index 3a4db5ae18d..d63cc27a450 100644
--- a/app/graphql/mutations/concerns/mutations/resolves_issuable.rb
+++ b/app/graphql/mutations/concerns/mutations/resolves_issuable.rb
@@ -6,19 +6,25 @@ module Mutations
include Mutations::ResolvesProject
def resolve_issuable(type:, parent_path:, iid:)
- parent = resolve_issuable_parent(parent_path)
+ parent = resolve_issuable_parent(type, parent_path)
issuable_resolver(type, parent, context).resolve(iid: iid.to_s)
end
+ private
+
def issuable_resolver(type, parent, context)
resolver_class = "Resolvers::#{type.to_s.classify.pluralize}Resolver".constantize
resolver_class.single.new(object: parent, context: context, field: nil)
end
- def resolve_issuable_parent(parent_path)
+ def resolve_issuable_parent(type, parent_path)
+ return unless type == :issue || type == :merge_request
+
resolve_project(full_path: parent_path)
end
end
end
+
+Mutations::ResolvesIssuable.prepend_if_ee('::EE::Mutations::ResolvesIssuable')