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
83784472
Commit
83784472
authored
Aug 26, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose approved flag in MR GraphQL type
parent
0efddbd5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
1 deletion
+35
-1
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+5
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+18
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
ee/app/graphql/ee/types/merge_request_type.rb
ee/app/graphql/ee/types/merge_request_type.rb
+2
-0
ee/changelogs/unreleased/233942-expose-approved-boolean-flag-for-merge-requests-in-graphql.yml
...e-approved-boolean-flag-for-merge-requests-in-graphql.yml
+5
-0
spec/graphql/types/merge_request_type_spec.rb
spec/graphql/types/merge_request_type_spec.rb
+4
-1
No files found.
doc/api/graphql/reference/gitlab_schema.graphql
View file @
83784472
...
...
@@ -8497,6 +8497,11 @@ type MergeRequest implements Noteable {
"""
allowCollaboration
:
Boolean
"""
Indicates
if
the
merge
request
has
all
the
required
approvals
.
Returns
true
if
no
required
approvals
are
configured
.
"""
approved
:
Boolean
!
"""
Users
who
approved
the
merge
request
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
83784472
...
...
@@ -23670,6 +23670,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "approved",
"description": "Indicates if the merge request has all the required approvals. Returns true if no required approvals are configured.",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "approvedBy",
"description": "Users who approved the merge request",
doc/api/graphql/reference/index.md
View file @
83784472
...
...
@@ -1309,6 +1309,7 @@ Autogenerated return type of MarkAsSpamSnippet
| Name | Type | Description |
| --- | ---- | ---------- |
|
`allowCollaboration`
| Boolean | Indicates if members of the target project can push to the fork |
|
`approved`
| Boolean! | Indicates if the merge request has all the required approvals. Returns true if no required approvals are configured. |
|
`author`
| User | User who created this merge request |
|
`commitCount`
| Int | Number of commits in the merge request |
|
`createdAt`
| Time! | Timestamp of when the merge request was created |
...
...
ee/app/graphql/ee/types/merge_request_type.rb
View file @
83784472
...
...
@@ -6,6 +6,8 @@ module EE
extend
ActiveSupport
::
Concern
prepended
do
field
:approved
,
GraphQL
::
BOOLEAN_TYPE
,
method: :approved?
,
null:
false
,
description:
'Indicates if the merge request has all the required approvals. Returns true if no required approvals are configured.'
field
:approved_by
,
::
Types
::
UserType
.
connection_type
,
null:
true
,
description:
'Users who approved the merge request'
...
...
ee/changelogs/unreleased/233942-expose-approved-boolean-flag-for-merge-requests-in-graphql.yml
0 → 100644
View file @
83784472
---
title
:
Expose approved flag in Merge Request GraphQL API
merge_request
:
40505
author
:
type
:
added
spec/graphql/types/merge_request_type_spec.rb
View file @
83784472
...
...
@@ -27,7 +27,10 @@ RSpec.describe GitlabSchema.types['MergeRequest'] do
total_time_spent reference author merged_at commit_count
]
expected_fields
<<
'approved_by'
if
Gitlab
.
ee?
if
Gitlab
.
ee?
expected_fields
<<
'approved'
expected_fields
<<
'approved_by'
end
expect
(
described_class
).
to
have_graphql_fields
(
*
expected_fields
)
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