Commit affbcb92 authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch...

Merge branch '208431-follow-up-from-add-mutation-concern-to-resolve-a-single-issuable' into 'master'

Fix MergeRequestsResolver

Closes #208431

See merge request gitlab-org/gitlab!27783
parents f32119b2 f9ebec2d
......@@ -15,7 +15,8 @@ module Resolvers
alias_method :project, :object
def resolve(**args)
return unless project.present?
project = object.respond_to?(:sync) ? object.sync : object
return MergeRequest.none if project.nil?
args[:iids] ||= [args[:iid]].compact
......
---
title: Amend GraphQL merge requests resolver to check for project presence
merge_request: 27783
author:
type: fixed
......@@ -59,6 +59,12 @@ describe Mutations::ResolvesIssuable do
expect(result).to be_nil
end
it 'returns nil if parent path is empty' do
result = mutation.resolve_issuable(type: type, parent_path: "", iid: issuable.iid)
expect(result).to be_nil
end
end
end
......
......@@ -52,6 +52,12 @@ describe Resolvers::MergeRequestsResolver do
expect(result).to be_empty
end
it 'resolves an unknown project to be empty' do
result = batch_sync { resolve_mr(nil, iid: iid_1) }
expect(result.compact).to be_empty
end
end
def resolve_mr(project, args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment