Commit fc4cf4e2 authored by David O'Regan's avatar David O'Regan Committed by Vitali Tatarintev

Add assignee usernames

Add GraphQL resolver property
for assignee usernames as
a array for filtering
parent 7d27bb49
...@@ -24,6 +24,9 @@ module IssueResolverArguments ...@@ -24,6 +24,9 @@ module IssueResolverArguments
argument :assignee_username, GraphQL::STRING_TYPE, argument :assignee_username, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'Username of a user assigned to the issue' description: 'Username of a user assigned to the issue'
argument :assignee_usernames, [GraphQL::STRING_TYPE],
required: false,
description: 'Usernames of users assigned to the issue'
argument :assignee_id, GraphQL::STRING_TYPE, argument :assignee_id, GraphQL::STRING_TYPE,
required: false, required: false,
description: 'ID of a user assigned to the issues, "none" and "any" values supported' description: 'ID of a user assigned to the issues, "none" and "any" values supported'
......
---
title: Add assignee usernames to issue resolver
merge_request: 43294
author:
type: changed
...@@ -7363,6 +7363,11 @@ type Group { ...@@ -7363,6 +7363,11 @@ type Group {
""" """
assigneeUsername: String assigneeUsername: String
"""
Usernames of users assigned to the issue
"""
assigneeUsernames: [String!]
""" """
Username of the author of the issue Username of the author of the issue
""" """
...@@ -12930,6 +12935,11 @@ type Project { ...@@ -12930,6 +12935,11 @@ type Project {
""" """
assigneeUsername: String assigneeUsername: String
"""
Usernames of users assigned to the issue
"""
assigneeUsernames: [String!]
""" """
Username of the author of the issue Username of the author of the issue
""" """
...@@ -13025,6 +13035,11 @@ type Project { ...@@ -13025,6 +13035,11 @@ type Project {
""" """
assigneeUsername: String assigneeUsername: String
"""
Usernames of users assigned to the issue
"""
assigneeUsernames: [String!]
""" """
Username of the author of the issue Username of the author of the issue
""" """
...@@ -13110,6 +13125,11 @@ type Project { ...@@ -13110,6 +13125,11 @@ type Project {
""" """
assigneeUsername: String assigneeUsername: String
"""
Usernames of users assigned to the issue
"""
assigneeUsernames: [String!]
""" """
Username of the author of the issue Username of the author of the issue
""" """
......
...@@ -20370,6 +20370,24 @@ ...@@ -20370,6 +20370,24 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "assigneeUsernames",
"description": "Usernames of users assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
{ {
"name": "assigneeId", "name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported", "description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
...@@ -38127,6 +38145,24 @@ ...@@ -38127,6 +38145,24 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "assigneeUsernames",
"description": "Usernames of users assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
{ {
"name": "assigneeId", "name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported", "description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
...@@ -38348,6 +38384,24 @@ ...@@ -38348,6 +38384,24 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "assigneeUsernames",
"description": "Usernames of users assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
{ {
"name": "assigneeId", "name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported", "description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
...@@ -38535,6 +38589,24 @@ ...@@ -38535,6 +38589,24 @@
}, },
"defaultValue": null "defaultValue": null
}, },
{
"name": "assigneeUsernames",
"description": "Usernames of users assigned to the issue",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null
},
{ {
"name": "assigneeId", "name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported", "description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
...@@ -46,6 +46,13 @@ RSpec.describe Resolvers::IssuesResolver do ...@@ -46,6 +46,13 @@ RSpec.describe Resolvers::IssuesResolver do
expect(resolve_issues(assignee_username: assignee.username)).to contain_exactly(issue2) expect(resolve_issues(assignee_username: assignee.username)).to contain_exactly(issue2)
end end
it 'filters by two assignees' do
assignee2 = create(:user)
issue2.update!(assignees: [assignee, assignee2])
expect(resolve_issues(assignee_id: [assignee.id, assignee2.id])).to contain_exactly(issue2)
end
it 'filters by assignee_id' do it 'filters by assignee_id' do
expect(resolve_issues(assignee_id: assignee.id)).to contain_exactly(issue2) expect(resolve_issues(assignee_id: assignee.id)).to contain_exactly(issue2)
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