Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5a68e0fb
Commit
5a68e0fb
authored
Oct 23, 2020
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose issue updated by on GraphQL
Add updatedBy field on IssueType
parent
6382d3dc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
3 deletions
+56
-3
app/graphql/types/issue_type.rb
app/graphql/types/issue_type.rb
+7
-0
changelogs/unreleased/issue_233479-add_updated_by_for_issue_type.yml
...unreleased/issue_233479-add_updated_by_for_issue_type.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+10
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+28
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+2
-0
spec/graphql/types/issue_type_spec.rb
spec/graphql/types/issue_type_spec.rb
+1
-1
spec/requests/api/graphql/issue/issue_spec.rb
spec/requests/api/graphql/issue/issue_spec.rb
+3
-2
No files found.
app/graphql/types/issue_type.rb
View file @
5a68e0fb
...
...
@@ -41,6 +41,9 @@ module Types
field
:assignees
,
Types
::
UserType
.
connection_type
,
null:
true
,
description:
'Assignees of the issue'
field
:updated_by
,
Types
::
UserType
,
null:
true
,
description:
'User that last updated the issue'
field
:labels
,
Types
::
LabelType
.
connection_type
,
null:
true
,
description:
'Labels of the issue'
field
:milestone
,
Types
::
MilestoneType
,
null:
true
,
...
...
@@ -114,6 +117,10 @@ module Types
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
User
,
object
.
author_id
).
find
end
def
updated_by
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
User
,
object
.
updated_by_id
).
find
end
def
milestone
Gitlab
::
Graphql
::
Loaders
::
BatchModelLoader
.
new
(
Milestone
,
object
.
milestone_id
).
find
end
...
...
changelogs/unreleased/issue_233479-add_updated_by_for_issue_type.yml
0 → 100644
View file @
5a68e0fb
---
title
:
Expose issue updated by on GraphQL
merge_request
:
46015
author
:
type
:
added
doc/api/graphql/reference/gitlab_schema.graphql
View file @
5a68e0fb
...
...
@@ -7214,6 +7214,11 @@ type EpicIssue implements CurrentUserTodos & Noteable {
"""
updatedAt
:
Time
!
"""
User
that
last
updated
the
issue
"""
updatedBy
:
User
"""
Number
of
upvotes
the
issue
has
received
"""
...
...
@@ -9467,6 +9472,11 @@ type Issue implements CurrentUserTodos & Noteable {
"""
updatedAt
:
Time
!
"""
User
that
last
updated
the
issue
"""
updatedBy
:
User
"""
Number
of
upvotes
the
issue
has
received
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
5a68e0fb
...
...
@@ -19865,6 +19865,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "updatedBy",
"description": "User that last updated the issue",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "upvotes",
"description": "Number of upvotes the issue has received",
...
...
@@ -25765,6 +25779,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "updatedBy",
"description": "User that last updated the issue",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "upvotes",
"description": "Number of upvotes the issue has received",
doc/api/graphql/reference/index.md
View file @
5a68e0fb
...
...
@@ -1149,6 +1149,7 @@ Relationship between an epic and an issue.
|
`totalTimeSpent`
| Int! | Total time reported as spent on the issue |
|
`type`
| IssueType | Type of the issue |
|
`updatedAt`
| Time! | Timestamp of when the issue was last updated |
|
`updatedBy`
| User | User that last updated the issue |
|
`upvotes`
| Int! | Number of upvotes the issue has received |
|
`userNotesCount`
| Int! | Number of user notes of the issue |
|
`userPermissions`
| IssuePermissions! | Permissions for the current user on the resource |
...
...
@@ -1342,6 +1343,7 @@ Represents a recorded measurement (object count) for the Admins.
|
`totalTimeSpent`
| Int! | Total time reported as spent on the issue |
|
`type`
| IssueType | Type of the issue |
|
`updatedAt`
| Time! | Timestamp of when the issue was last updated |
|
`updatedBy`
| User | User that last updated the issue |
|
`upvotes`
| Int! | Number of upvotes the issue has received |
|
`userNotesCount`
| Int! | Number of user notes of the issue |
|
`userPermissions`
| IssuePermissions! | Permissions for the current user on the resource |
...
...
spec/graphql/types/issue_type_spec.rb
View file @
5a68e0fb
...
...
@@ -14,7 +14,7 @@ RSpec.describe GitlabSchema.types['Issue'] do
specify
{
expect
(
described_class
.
interfaces
).
to
include
(
Types
::
CurrentUserTodos
)
}
it
'has specific fields'
do
fields
=
%i[id iid title description state reference author assignees participants labels milestone due_date
fields
=
%i[id iid title description state reference author assignees
updated_by
participants labels milestone due_date
confidential discussion_locked upvotes downvotes user_notes_count web_path web_url relative_position
subscribed time_estimate total_time_spent human_time_estimate human_total_time_spent closed_at created_at updated_at task_completion_status
designs design_collection alert_management_alert severity current_user_todos]
...
...
spec/requests/api/graphql/issue/issue_spec.rb
View file @
5a68e0fb
...
...
@@ -71,14 +71,15 @@ RSpec.describe 'Query.issue(id)' do
end
context
'selecting multiple fields'
do
let
(
:issue_fields
)
{
%w(title description)
}
let
(
:issue_fields
)
{
[
'title'
,
'description'
,
'updatedBy { username }'
]
}
it
'returns the Issue with the specified fields'
do
post_graphql
(
query
,
current_user:
current_user
)
expect
(
issue_data
.
keys
).
to
eq
(
%w(title description)
)
expect
(
issue_data
.
keys
).
to
eq
(
%w(title description
updatedBy
)
)
expect
(
issue_data
[
'title'
]).
to
eq
(
issue
.
title
)
expect
(
issue_data
[
'description'
]).
to
eq
(
issue
.
description
)
expect
(
issue_data
[
'updatedBy'
][
'username'
]).
to
eq
(
issue
.
author
.
username
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment