Commit 606a59ff authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch 'sy-allow-more-shifts-per-request' into 'master'

Expose enough shifts records to fill an on-call schedule

See merge request gitlab-org/gitlab!55801
parents c5a0b656 32f5c0f7
......@@ -3,6 +3,8 @@
module Types
module IncidentManagement
class OncallRotationType < BaseObject
MAX_SHIFTS_FOR_TIMEFRAME = 350
graphql_name 'IncidentManagementOncallRotation'
description 'Describes an incident management on-call rotation'
......@@ -52,6 +54,7 @@ module Types
::Types::IncidentManagement::OncallShiftType.connection_type,
null: true,
description: 'Blocks of time for which a participant is on-call within a given time frame. Time frame cannot exceed one month.',
max_page_size: MAX_SHIFTS_FOR_TIMEFRAME,
resolver: ::Resolvers::IncidentManagement::OncallShiftsResolver
end
end
......
......@@ -22,4 +22,9 @@ RSpec.describe GitlabSchema.types['IncidentManagementOncallRotation'] do
expect(described_class).to have_graphql_fields(*expected_fields)
end
it 'returns enough records to cover 2 weeks of hour-long shifts' do
expect(described_class::MAX_SHIFTS_FOR_TIMEFRAME).to be > 14 * 24 # 14 days * 24 hours
expect(described_class).to have_graphql_field(:shifts, max_page_size: described_class::MAX_SHIFTS_FOR_TIMEFRAME)
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