Commit d2486ae4 authored by syasonik's avatar syasonik

Hide N+1 query behind intended feature flag

parent 6dfdecb0
......@@ -88,6 +88,12 @@ module Types
[Types::UserType],
null: true,
description: 'Assignees of the alert'
def assignees
return User.none unless Feature.enabled?(:alert_assignee, object.project)
object.assignees
end
end
end
end
......@@ -137,5 +137,18 @@ describe 'getting Alert Management Alerts' do
end
end
end
context 'with alert_assignee flag disabled' do
before do
stub_feature_flags(alert_assignee: false)
project.add_developer(current_user)
post_graphql(query, current_user: current_user)
end
it 'excludes assignees' do
expect(alerts.first['assignees']).to be_empty
end
end
end
end
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