Commit 5e107b66 authored by Sean Arnold's avatar Sean Arnold

Fix specs and update docs

- Add changelog
parent e0139d61
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Types module Types
class IssueStatusCountsType < BaseObject class IssueStatusCountsType < BaseObject
graphql_name 'IssueStatusCountsType' graphql_name 'IssueStatusCountsType'
description "Represents total number of issues for the represented categories" description "Represents total number of issues for the represented statuses"
authorize :read_issue authorize :read_issue
......
---
title: Add status counts to Issues in GraphQL
merge_request: 38263
author:
type: added
...@@ -7253,7 +7253,7 @@ enum IssueState { ...@@ -7253,7 +7253,7 @@ enum IssueState {
} }
""" """
Represents total number of issues for the represented categories Represents total number of issues for the represented statuses
""" """
type IssueStatusCountsType { type IssueStatusCountsType {
""" """
...@@ -10357,11 +10357,6 @@ type Project { ...@@ -10357,11 +10357,6 @@ type Project {
""" """
search: String search: String
"""
Sort issues by this criteria
"""
sort: IssueSort = created_desc
""" """
Current state of this issue Current state of this issue
""" """
......
...@@ -15727,16 +15727,6 @@ ...@@ -15727,16 +15727,6 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "sort",
"description": "Sort issues by this criteria",
"type": {
"kind": "ENUM",
"name": "IssueSort",
"ofType": null
},
"defaultValue": "created_desc"
},
{ {
"name": "types", "name": "types",
"description": "Filter issues by the given issue types", "description": "Filter issues by the given issue types",
...@@ -15755,6 +15745,16 @@ ...@@ -15755,6 +15745,16 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "sort",
"description": "Sort issues by this criteria",
"type": {
"kind": "ENUM",
"name": "IssueSort",
"ofType": null
},
"defaultValue": "created_desc"
},
{ {
"name": "iterationId", "name": "iterationId",
"description": "Iterations applied to the issue", "description": "Iterations applied to the issue",
...@@ -20004,7 +20004,7 @@ ...@@ -20004,7 +20004,7 @@
{ {
"kind": "OBJECT", "kind": "OBJECT",
"name": "IssueStatusCountsType", "name": "IssueStatusCountsType",
"description": "Represents total number of issues for the represented categories", "description": "Represents total number of issues for the represented statuses",
"fields": [ "fields": [
{ {
"name": "all", "name": "all",
...@@ -30657,16 +30657,6 @@ ...@@ -30657,16 +30657,6 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "sort",
"description": "Sort issues by this criteria",
"type": {
"kind": "ENUM",
"name": "IssueSort",
"ofType": null
},
"defaultValue": "created_desc"
},
{ {
"name": "types", "name": "types",
"description": "Filter issues by the given issue types", "description": "Filter issues by the given issue types",
...@@ -30685,6 +30675,16 @@ ...@@ -30685,6 +30675,16 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "sort",
"description": "Sort issues by this criteria",
"type": {
"kind": "ENUM",
"name": "IssueSort",
"ofType": null
},
"defaultValue": "created_desc"
},
{ {
"name": "iterationId", "name": "iterationId",
"description": "Iterations applied to the issue", "description": "Iterations applied to the issue",
...@@ -30868,16 +30868,6 @@ ...@@ -30868,16 +30868,6 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "sort",
"description": "Sort issues by this criteria",
"type": {
"kind": "ENUM",
"name": "IssueSort",
"ofType": null
},
"defaultValue": "created_desc"
},
{ {
"name": "types", "name": "types",
"description": "Filter issues by the given issue types", "description": "Filter issues by the given issue types",
...@@ -31065,16 +31055,6 @@ ...@@ -31065,16 +31055,6 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "sort",
"description": "Sort issues by this criteria",
"type": {
"kind": "ENUM",
"name": "IssueSort",
"ofType": null
},
"defaultValue": "created_desc"
},
{ {
"name": "types", "name": "types",
"description": "Filter issues by the given issue types", "description": "Filter issues by the given issue types",
...@@ -31093,6 +31073,16 @@ ...@@ -31093,6 +31073,16 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "sort",
"description": "Sort issues by this criteria",
"type": {
"kind": "ENUM",
"name": "IssueSort",
"ofType": null
},
"defaultValue": "created_desc"
},
{ {
"name": "iterationId", "name": "iterationId",
"description": "Iterations applied to the issue", "description": "Iterations applied to the issue",
...@@ -1106,7 +1106,7 @@ Autogenerated return type of IssueSetWeight ...@@ -1106,7 +1106,7 @@ Autogenerated return type of IssueSetWeight
## IssueStatusCountsType ## IssueStatusCountsType
Represents total number of issues for the represented categories Represents total number of issues for the represented statuses
| Name | Type | Description | | Name | Type | Description |
| --- | ---- | ---------- | | --- | ---- | ---------- |
......
...@@ -8,8 +8,8 @@ RSpec.describe 'getting Issue counts by status' do ...@@ -8,8 +8,8 @@ RSpec.describe 'getting Issue counts by status' do
let_it_be(:current_user) { create(:user) } let_it_be(:current_user) { create(:user) }
let_it_be(:issue_opened) { create(:issue, project: project) } let_it_be(:issue_opened) { create(:issue, project: project) }
let_it_be(:issue_closed) { create(:issue, :closed, project: project) } let_it_be(:issue_closed) { create(:issue, :closed, project: project) }
# let_it_be(:other_project_issue) { create(:issue) } let_it_be(:other_project_issue) { create(:issue) }
let(:params) { { } } let(:params) { {} }
let(:fields) do let(:fields) do
<<~QUERY <<~QUERY
...@@ -48,11 +48,11 @@ RSpec.describe 'getting Issue counts by status' do ...@@ -48,11 +48,11 @@ RSpec.describe 'getting Issue counts by status' do
it_behaves_like 'a working graphql query' it_behaves_like 'a working graphql query'
it 'returns the correct counts for each status' do it 'returns the correct counts for each status' do
expect(issue_counts).to eq( expect(issue_counts).to eq(
'all' => 3, 'all' => 2,
'opened' => 1, 'opened' => 1,
'closed' => 1, 'closed' => 1,
'merged' => 0 # merged is not relevant for issues 'merged' => 0 # merged is not relevant for issues
) # but is included in the issuable type ) # but is included in the return type (Gitlab::IssuablesCountForState)
end end
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