Commit 76cae36c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'fix-wrong-scope-in-approved-by' into 'master'

Fix wrong scope for approvedBy in MR GraphQL API

See merge request gitlab-org/gitlab!43705
parents 10885013 cf41faae
......@@ -40,7 +40,7 @@ module ResolvesMergeRequests
author: [:author],
merged_at: [:metrics],
commit_count: [:metrics],
approved_by: [:approver_users],
approved_by: [:approved_by_users],
milestone: [:milestone],
head_pipeline: [:merge_request_diff, { head_pipeline: [:merge_request] }]
}
......
......@@ -174,10 +174,6 @@ module Types
def commit_count
object&.metrics&.commits_count
end
def approvers
object.approver_users
end
end
end
Types::MergeRequestType.prepend_if_ee('::EE::Types::MergeRequestType')
---
title: Fix approvedBy filed in MR GraphQL API
merge_request: 43705
author:
type: fixed
......@@ -16,7 +16,7 @@ module EE
description: 'Users who approved the merge request'
def approved_by
object.approver_users
object.approved_by_users
end
end
end
......
......@@ -39,7 +39,7 @@ RSpec.describe 'getting merge request listings (EE) nested in a project' do
let(:requested_fields) { query_graphql_field(:approved_by, nil, query_graphql_field(:nodes, nil, [:username])) }
it 'exposes approver username' do
merge_request_a.approver_users << current_user
merge_request_a.approved_by_users << current_user
execute_query
......
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