diff options
Diffstat (limited to 'app/assets/javascripts/alert_management/graphql/queries')
4 files changed, 44 insertions, 12 deletions
diff --git a/app/assets/javascripts/alert_management/graphql/queries/details.query.graphql b/app/assets/javascripts/alert_management/graphql/queries/details.query.graphql index 7c77715fad2..c02b8accdd1 100644 --- a/app/assets/javascripts/alert_management/graphql/queries/details.query.graphql +++ b/app/assets/javascripts/alert_management/graphql/queries/details.query.graphql @@ -1,4 +1,4 @@ -#import "../fragments/detailItem.fragment.graphql" +#import "../fragments/detail_item.fragment.graphql" query alertDetails($fullPath: ID!, $alertId: String) { project(fullPath: $fullPath) { diff --git a/app/assets/javascripts/alert_management/graphql/queries/getAlerts.query.graphql b/app/assets/javascripts/alert_management/graphql/queries/getAlerts.query.graphql deleted file mode 100644 index 54b66389d5b..00000000000 --- a/app/assets/javascripts/alert_management/graphql/queries/getAlerts.query.graphql +++ /dev/null @@ -1,11 +0,0 @@ -#import "../fragments/listItem.fragment.graphql" - -query getAlerts($projectPath: ID!, $statuses: [AlertManagementStatus!]) { - project(fullPath: $projectPath) { - alertManagementAlerts(statuses: $statuses) { - nodes { - ...AlertListItem - } - } - } -} diff --git a/app/assets/javascripts/alert_management/graphql/queries/get_alerts.query.graphql b/app/assets/javascripts/alert_management/graphql/queries/get_alerts.query.graphql new file mode 100644 index 00000000000..1d3c3c83cc1 --- /dev/null +++ b/app/assets/javascripts/alert_management/graphql/queries/get_alerts.query.graphql @@ -0,0 +1,32 @@ +#import "../fragments/list_item.fragment.graphql" + +query getAlerts( + $projectPath: ID!, + $statuses: [AlertManagementStatus!], + $sort: AlertManagementAlertSort, + $firstPageSize: Int, + $lastPageSize: Int, + $prevPageCursor: String = "" + $nextPageCursor: String = "" +) { + project(fullPath: $projectPath, ) { + alertManagementAlerts( + statuses: $statuses, + sort: $sort, + first: $firstPageSize + last: $lastPageSize, + after: $nextPageCursor, + before: $prevPageCursor + ) { + nodes { + ...AlertListItem + }, + pageInfo { + hasNextPage + endCursor + hasPreviousPage + startCursor + } + } + } +} diff --git a/app/assets/javascripts/alert_management/graphql/queries/get_count_by_status.query.graphql b/app/assets/javascripts/alert_management/graphql/queries/get_count_by_status.query.graphql new file mode 100644 index 00000000000..1143050200c --- /dev/null +++ b/app/assets/javascripts/alert_management/graphql/queries/get_count_by_status.query.graphql @@ -0,0 +1,11 @@ +query getAlertsCount($projectPath: ID!) { + project(fullPath: $projectPath) { + alertManagementAlertStatusCounts { + all + open + acknowledged + resolved + triggered + } + } +} |