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
e226b06b
Commit
e226b06b
authored
Nov 21, 2019
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add up/down votes for GraphQL epic query
and changelog
parent
63534f6e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
1 deletion
+71
-1
changelogs/unreleased/11506-add-additional-attributes-and-arguments-for-the-graphql-epic-query.yml
...l-attributes-and-arguments-for-the-graphql-epic-query.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
+36
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+2
-0
ee/app/graphql/types/epic_type.rb
ee/app/graphql/types/epic_type.rb
+3
-0
ee/spec/graphql/types/epic_type_spec.rb
ee/spec/graphql/types/epic_type_spec.rb
+1
-1
ee/spec/requests/api/graphql/group/epics_spec.rb
ee/spec/requests/api/graphql/group/epics_spec.rb
+14
-0
No files found.
changelogs/unreleased/11506-add-additional-attributes-and-arguments-for-the-graphql-epic-query.yml
0 → 100644
View file @
e226b06b
---
title
:
Add upvote/downvotes attributes to GraphQL Epic query
merge_request
:
14311
author
:
type
:
added
doc/api/graphql/reference/gitlab_schema.graphql
View file @
e226b06b
...
...
@@ -1230,6 +1230,11 @@ type Epic implements Noteable {
"""
last
:
Int
):
DiscussionConnection
!
"""
Number
of
downvotes
the
epic
has
received
"""
downvotes
:
Int
!
dueDate
:
Time
dueDateFixed
:
Time
dueDateFromMilestones
:
Time
...
...
@@ -1360,6 +1365,11 @@ type Epic implements Noteable {
title
:
String
updatedAt
:
Time
"""
Number
of
upvotes
the
epic
has
received
"""
upvotes
:
Int
!
"""
Permissions
for
the
current
user
on
the
resource
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
e226b06b
...
...
@@ -3603,6 +3603,24 @@
"isDeprecated"
:
false
,
"deprecationReason"
:
null
},
{
"name"
:
"downvotes"
,
"description"
:
"Number of downvotes the epic has received"
,
"args"
:
[
],
"type"
:
{
"kind"
:
"NON_NULL"
,
"name"
:
null
,
"ofType"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"Int"
,
"ofType"
:
null
}
},
"isDeprecated"
:
false
,
"deprecationReason"
:
null
},
{
"name"
:
"dueDate"
,
"description"
:
null
,
...
...
@@ -4154,6 +4172,24 @@
"isDeprecated"
:
false
,
"deprecationReason"
:
null
},
{
"name"
:
"upvotes"
,
"description"
:
"Number of upvotes the epic has received"
,
"args"
:
[
],
"type"
:
{
"kind"
:
"NON_NULL"
,
"name"
:
null
,
"ofType"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"Int"
,
"ofType"
:
null
}
},
"isDeprecated"
:
false
,
"deprecationReason"
:
null
},
{
"name"
:
"userPermissions"
,
"description"
:
"Permissions for the current user on the resource"
,
...
...
doc/api/graphql/reference/index.md
View file @
e226b06b
...
...
@@ -211,6 +211,8 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
|
`dueDateIsFixed`
| Boolean | |
|
`dueDateFixed`
| Time | |
|
`dueDateFromMilestones`
| Time | |
|
`upvotes`
| Int! | Number of upvotes the epic has received |
|
`downvotes`
| Int! | Number of downvotes the epic has received |
|
`closedAt`
| Time | |
|
`createdAt`
| Time | |
|
`updatedAt`
| Time | |
...
...
ee/app/graphql/types/epic_type.rb
View file @
e226b06b
...
...
@@ -38,6 +38,9 @@ module Types
field
:due_date_fixed
,
Types
::
TimeType
,
null:
true
,
authorize: :admin_epic
# rubocop:disable Graphql/Descriptions
field
:due_date_from_milestones
,
Types
::
TimeType
,
null:
true
,
authorize: :admin_epic
# rubocop:disable Graphql/Descriptions
field
:upvotes
,
GraphQL
::
INT_TYPE
,
null:
false
,
description:
'Number of upvotes the epic has received'
field
:downvotes
,
GraphQL
::
INT_TYPE
,
null:
false
,
description:
'Number of downvotes the epic has received'
field
:closed_at
,
Types
::
TimeType
,
null:
true
# rubocop:disable Graphql/Descriptions
field
:created_at
,
Types
::
TimeType
,
null:
true
# rubocop:disable Graphql/Descriptions
field
:updated_at
,
Types
::
TimeType
,
null:
true
# rubocop:disable Graphql/Descriptions
...
...
ee/spec/graphql/types/epic_type_spec.rb
View file @
e226b06b
...
...
@@ -11,7 +11,7 @@ describe GitlabSchema.types['Epic'] do
closed_at created_at updated_at children has_children has_issues
web_path web_url relation_path reference issues user_permissions
notes discussions relative_position subscribed participants
descendant_counts
descendant_counts
upvotes downvotes
]
end
...
...
ee/spec/requests/api/graphql/group/epics_spec.rb
View file @
e226b06b
...
...
@@ -24,6 +24,8 @@ describe 'Epics through GroupQuery' do
id
iid
title
upvotes
downvotes
userPermissions {
adminEpic
}
...
...
@@ -70,6 +72,18 @@ describe 'Epics through GroupQuery' do
expect_array_response
([
epic2
.
to_global_id
.
to_s
,
epic
.
to_global_id
.
to_s
])
end
it
'has upvote/downvote information'
do
create
(
:award_emoji
,
name:
'thumbsup'
,
awardable:
epic
,
user:
user
)
create
(
:award_emoji
,
name:
'thumbsdown'
,
awardable:
epic2
,
user:
user
)
post_graphql
(
query
,
current_user:
user
)
expect
(
epic_node_array
).
to
contain_exactly
(
a_hash_including
(
'upvotes'
=>
1
,
'downvotes'
=>
0
),
a_hash_including
(
'upvotes'
=>
0
,
'downvotes'
=>
1
)
)
end
describe
'can admin epics'
do
context
'when permission is absent'
do
it
'returns false for adminEpic'
do
...
...
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