Commit cf41faae authored by Adam Hegyi's avatar Adam Hegyi

Fix wrong scope for approvedBy in MR GraphQL API

parent 3df1baec
...@@ -40,7 +40,7 @@ module ResolvesMergeRequests ...@@ -40,7 +40,7 @@ module ResolvesMergeRequests
author: [:author], author: [:author],
merged_at: [:metrics], merged_at: [:metrics],
commit_count: [:metrics], commit_count: [:metrics],
approved_by: [:approver_users], approved_by: [:approved_by_users],
milestone: [:milestone], milestone: [:milestone],
head_pipeline: [:merge_request_diff, { head_pipeline: [:merge_request] }] head_pipeline: [:merge_request_diff, { head_pipeline: [:merge_request] }]
} }
......
...@@ -174,10 +174,6 @@ module Types ...@@ -174,10 +174,6 @@ module Types
def commit_count def commit_count
object&.metrics&.commits_count object&.metrics&.commits_count
end end
def approvers
object.approver_users
end
end end
end end
Types::MergeRequestType.prepend_if_ee('::EE::Types::MergeRequestType') 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 ...@@ -16,7 +16,7 @@ module EE
description: 'Users who approved the merge request' description: 'Users who approved the merge request'
def approved_by def approved_by
object.approver_users object.approved_by_users
end end
end end
end end
......
...@@ -39,7 +39,7 @@ RSpec.describe 'getting merge request listings (EE) nested in a project' do ...@@ -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])) } let(:requested_fields) { query_graphql_field(:approved_by, nil, query_graphql_field(:nodes, nil, [:username])) }
it 'exposes approver username' do it 'exposes approver username' do
merge_request_a.approver_users << current_user merge_request_a.approved_by_users << current_user
execute_query 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