diff --git a/ee/app/graphql/types/incident_management/oncall_rotation_type.rb b/ee/app/graphql/types/incident_management/oncall_rotation_type.rb index 6bbdd3c9b51a84744bc1060d817361a1574b5548..581e2c56ae77ebbcdbe9029843a4fbb55d6235ac 100644 --- a/ee/app/graphql/types/incident_management/oncall_rotation_type.rb +++ b/ee/app/graphql/types/incident_management/oncall_rotation_type.rb @@ -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 @@ class OncallRotationType < BaseObject ::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 diff --git a/ee/spec/graphql/types/incident_management/oncall_rotation_type_spec.rb b/ee/spec/graphql/types/incident_management/oncall_rotation_type_spec.rb index 3de32356db1d37c552d1d05f21d9cc3a545968ea..857cdb72b70107830e4a271d19ada8d2e0872c04 100644 --- a/ee/spec/graphql/types/incident_management/oncall_rotation_type_spec.rb +++ b/ee/spec/graphql/types/incident_management/oncall_rotation_type_spec.rb @@ -22,4 +22,9 @@ 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