diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 18:08:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 18:08:16 +0300 |
commit | e80e0dd64fbb04f60394cb1bb08e17dbcb22b8ce (patch) | |
tree | 9e538341b9b77e96737964813e10235dbecf47ff /app/graphql/mutations | |
parent | ef31adeb0fb9a02b2c6a4529ec4e38d7082a4b2b (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.rb | 10 |
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') |