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
64c0c4b1
Commit
64c0c4b1
authored
Jul 15, 2020
by
Thomas Randolph
Committed by
Imre Farkas
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose blob mode in GraphQL for repository files
parent
2e1e1406
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
1 deletion
+29
-1
app/assets/javascripts/repository/queries/getFiles.query.graphql
...ets/javascripts/repository/queries/getFiles.query.graphql
+1
-0
app/graphql/types/tree/blob_type.rb
app/graphql/types/tree/blob_type.rb
+2
-0
changelogs/unreleased/symlink-icon-graphql-file-mode.yml
changelogs/unreleased/symlink-icon-graphql-file-mode.yml
+5
-0
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
+14
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
spec/graphql/types/tree/blob_type_spec.rb
spec/graphql/types/tree/blob_type_spec.rb
+1
-1
No files found.
app/assets/javascripts/repository/queries/getFiles.query.graphql
View file @
64c0c4b1
...
...
@@ -45,6 +45,7 @@ query getFiles(
edges
{
node
{
...
TreeEntry
mode
webUrl
lfsOid
}
...
...
app/graphql/types/tree/blob_type.rb
View file @
64c0c4b1
...
...
@@ -17,6 +17,8 @@ module Types
resolve:
->
(
blob
,
args
,
ctx
)
do
Gitlab
::
Graphql
::
Loaders
::
BatchLfsOidLoader
.
new
(
blob
.
repository
,
blob
.
id
).
find
end
field
:mode
,
GraphQL
::
STRING_TYPE
,
null:
true
,
description:
'Blob mode in numeric format'
# rubocop: enable Graphql/AuthorizeTypes
end
end
...
...
changelogs/unreleased/symlink-icon-graphql-file-mode.yml
0 → 100644
View file @
64c0c4b1
---
title
:
Expose blob mode in GraphQL for repository files
merge_request
:
36488
author
:
type
:
other
doc/api/graphql/reference/gitlab_schema.graphql
View file @
64c0c4b1
...
...
@@ -793,6 +793,11 @@ type Blob implements Entry {
"""
lfsOid
:
String
"""
Blob
mode
in
numeric
format
"""
mode
:
String
"""
Name
of
the
entry
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
64c0c4b1
...
...
@@ -2056,6 +2056,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "mode",
"description": "Blob mode in numeric format",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "name",
"description": "Name of the entry",
doc/api/graphql/reference/index.md
View file @
64c0c4b1
...
...
@@ -160,6 +160,7 @@ Autogenerated return type of AwardEmojiToggle
|
`flatPath`
| String! | Flat path of the entry |
|
`id`
| ID! | ID of the entry |
|
`lfsOid`
| String | LFS ID of the blob |
|
`mode`
| String | Blob mode in numeric format |
|
`name`
| String! | Name of the entry |
|
`path`
| String! | Path of the entry |
|
`sha`
| String! | Last commit sha for the entry |
...
...
spec/graphql/types/tree/blob_type_spec.rb
View file @
64c0c4b1
...
...
@@ -5,5 +5,5 @@ require 'spec_helper'
RSpec
.
describe
Types
::
Tree
::
BlobType
do
specify
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'Blob'
)
}
specify
{
expect
(
described_class
).
to
have_graphql_fields
(
:id
,
:sha
,
:name
,
:type
,
:path
,
:flat_path
,
:web_url
,
:lfs_oid
)
}
specify
{
expect
(
described_class
).
to
have_graphql_fields
(
:id
,
:sha
,
:name
,
:type
,
:path
,
:flat_path
,
:web_url
,
:lfs_oid
,
:mode
)
}
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