Commit 051b354b authored by charlieablett's avatar charlieablett

Backfill GraphQL descriptions

- Tree, blob, submodule types
- Regenerate schema & docs
parent 6024c4be
......@@ -10,10 +10,13 @@ module Types
graphql_name 'Blob'
field :web_url, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :lfs_oid, GraphQL::STRING_TYPE, null: true, resolve: -> (blob, args, ctx) do # rubocop:disable Graphql/Descriptions
Gitlab::Graphql::Loaders::BatchLfsOidLoader.new(blob.repository, blob.id).find
end
field :web_url, GraphQL::STRING_TYPE, null: true,
description: 'Web URL of the blob'
field :lfs_oid, GraphQL::STRING_TYPE, null: true,
description: 'LFS ID of the blob',
resolve: -> (blob, args, ctx) do
Gitlab::Graphql::Loaders::BatchLfsOidLoader.new(blob.repository, blob.id).find
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
......
......@@ -4,12 +4,18 @@ module Types
module EntryType
include Types::BaseInterface
field :id, GraphQL::ID_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :sha, GraphQL::STRING_TYPE, null: false, description: "Last commit sha for entry", method: :id
field :name, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :type, Tree::TypeEnum, null: false # rubocop:disable Graphql/Descriptions
field :path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :flat_path, GraphQL::STRING_TYPE, null: false # rubocop:disable Graphql/Descriptions
field :id, GraphQL::ID_TYPE, null: false,
description: 'ID of the entry'
field :sha, GraphQL::STRING_TYPE, null: false,
description: 'Last commit sha for the entry', method: :id
field :name, GraphQL::STRING_TYPE, null: false,
description: 'Name of the entry'
field :type, Tree::TypeEnum, null: false,
description: 'Type of tree entry'
field :path, GraphQL::STRING_TYPE, null: false,
description: 'Path of the entry'
field :flat_path, GraphQL::STRING_TYPE, null: false,
description: 'Flat path of the entry'
end
end
end
......@@ -8,8 +8,10 @@ module Types
graphql_name 'Submodule'
field :web_url, type: GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :tree_url, type: GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :web_url, type: GraphQL::STRING_TYPE, null: true,
description: 'Web URL for the sub-module'
field :tree_url, type: GraphQL::STRING_TYPE, null: true,
description: 'Tree URL for the sub-module'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
......@@ -11,7 +11,8 @@ module Types
graphql_name 'TreeEntry'
description 'Represents a directory'
field :web_url, GraphQL::STRING_TYPE, null: true # rubocop:disable Graphql/Descriptions
field :web_url, GraphQL::STRING_TYPE, null: true,
description: 'Web URL for the tree entry (directory)'
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
......@@ -11,19 +11,23 @@ module Types
null: true, complexity: 10, calls_gitaly: true, resolver: Resolvers::LastCommitResolver,
description: 'Last commit for the tree'
field :trees, Types::Tree::TreeEntryType.connection_type, null: false, resolve: -> (obj, args, ctx) do # rubocop:disable Graphql/Descriptions
Gitlab::Graphql::Representation::TreeEntry.decorate(obj.trees, obj.repository)
end
field :trees, Types::Tree::TreeEntryType.connection_type, null: false,
description: 'Trees of the tree',
resolve: -> (obj, args, ctx) do
Gitlab::Graphql::Representation::TreeEntry.decorate(obj.trees, obj.repository)
end
# rubocop:disable Graphql/Descriptions
field :submodules, Types::Tree::SubmoduleType.connection_type, null: false, calls_gitaly: true, resolve: -> (obj, args, ctx) do
Gitlab::Graphql::Representation::SubmoduleTreeEntry.decorate(obj.submodules, obj)
end
# rubocop:enable Graphql/Descriptions
field :submodules, Types::Tree::SubmoduleType.connection_type, null: false,
description: 'Sub-modules of the tree',
calls_gitaly: true, resolve: -> (obj, args, ctx) do
Gitlab::Graphql::Representation::SubmoduleTreeEntry.decorate(obj.submodules, obj)
end
field :blobs, Types::Tree::BlobType.connection_type, null: false, calls_gitaly: true, resolve: -> (obj, args, ctx) do # rubocop:disable Graphql/Descriptions
Gitlab::Graphql::Representation::TreeEntry.decorate(obj.blobs, obj.repository)
end
field :blobs, Types::Tree::BlobType.connection_type, null: false,
description: 'Blobs of the tree',
calls_gitaly: true, resolve: -> (obj, args, ctx) do
Gitlab::Graphql::Representation::TreeEntry.decorate(obj.blobs, obj.repository)
end
# rubocop: enable Graphql/AuthorizeTypes
end
end
......
......@@ -71,17 +71,44 @@ type AwardEmoji {
}
type Blob implements Entry {
"""
Flat path of the entry
"""
flatPath: String!
"""
ID of the entry
"""
id: ID!
"""
LFS ID of the blob
"""
lfsOid: String
"""
Name of the entry
"""
name: String!
"""
Path of the entry
"""
path: String!
"""
Last commit sha for entry
Last commit sha for the entry
"""
sha: String!
"""
Type of tree entry
"""
type: EntryType!
"""
Web URL of the blob
"""
webUrl: String
}
......@@ -1290,15 +1317,34 @@ type DiscussionEdge {
}
interface Entry {
"""
Flat path of the entry
"""
flatPath: String!
"""
ID of the entry
"""
id: ID!
"""
Name of the entry
"""
name: String!
"""
Path of the entry
"""
path: String!
"""
Last commit sha for entry
Last commit sha for the entry
"""
sha: String!
"""
Type of tree entry
"""
type: EntryType!
}
......@@ -5855,17 +5901,44 @@ type SnippetPermissions {
}
type Submodule implements Entry {
"""
Flat path of the entry
"""
flatPath: String!
"""
ID of the entry
"""
id: ID!
"""
Name of the entry
"""
name: String!
"""
Path of the entry
"""
path: String!
"""
Last commit sha for entry
Last commit sha for the entry
"""
sha: String!
"""
Tree URL for the sub-module
"""
treeUrl: String
"""
Type of tree entry
"""
type: EntryType!
"""
Web URL for the sub-module
"""
webUrl: String
}
......@@ -6254,6 +6327,9 @@ type ToggleAwardEmojiPayload {
}
type Tree {
"""
Blobs of the tree
"""
blobs(
"""
Returns the elements in the list that come after the specified cursor.
......@@ -6280,6 +6356,10 @@ type Tree {
Last commit for the tree
"""
lastCommit: Commit
"""
Sub-modules of the tree
"""
submodules(
"""
Returns the elements in the list that come after the specified cursor.
......@@ -6301,6 +6381,10 @@ type Tree {
"""
last: Int
): SubmoduleConnection!
"""
Trees of the tree
"""
trees(
"""
Returns the elements in the list that come after the specified cursor.
......@@ -6328,16 +6412,39 @@ type Tree {
Represents a directory
"""
type TreeEntry implements Entry {
"""
Flat path of the entry
"""
flatPath: String!
"""
ID of the entry
"""
id: ID!
"""
Name of the entry
"""
name: String!
"""
Path of the entry
"""
path: String!
"""
Last commit sha for entry
Last commit sha for the entry
"""
sha: String!
"""
Type of tree entry
"""
type: EntryType!
"""
Web URL for the tree entry (directory)
"""
webUrl: String
}
......
......@@ -11428,7 +11428,7 @@
"fields": [
{
"name": "blobs",
"description": null,
"description": "Blobs of the tree",
"args": [
{
"name": "after",
......@@ -11499,7 +11499,7 @@
},
{
"name": "submodules",
"description": null,
"description": "Sub-modules of the tree",
"args": [
{
"name": "after",
......@@ -11556,7 +11556,7 @@
},
{
"name": "trees",
"description": null,
"description": "Trees of the tree",
"args": [
{
"name": "after",
......@@ -12687,7 +12687,7 @@
"fields": [
{
"name": "flatPath",
"description": null,
"description": "Flat path of the entry",
"args": [
],
......@@ -12705,7 +12705,7 @@
},
{
"name": "id",
"description": null,
"description": "ID of the entry",
"args": [
],
......@@ -12723,7 +12723,7 @@
},
{
"name": "name",
"description": null,
"description": "Name of the entry",
"args": [
],
......@@ -12741,7 +12741,7 @@
},
{
"name": "path",
"description": null,
"description": "Path of the entry",
"args": [
],
......@@ -12759,7 +12759,7 @@
},
{
"name": "sha",
"description": "Last commit sha for entry",
"description": "Last commit sha for the entry",
"args": [
],
......@@ -12777,7 +12777,7 @@
},
{
"name": "type",
"description": null,
"description": "Type of tree entry",
"args": [
],
......@@ -12795,7 +12795,7 @@
},
{
"name": "webUrl",
"description": null,
"description": "Web URL for the tree entry (directory)",
"args": [
],
......@@ -12826,7 +12826,7 @@
"fields": [
{
"name": "flatPath",
"description": null,
"description": "Flat path of the entry",
"args": [
],
......@@ -12844,7 +12844,7 @@
},
{
"name": "id",
"description": null,
"description": "ID of the entry",
"args": [
],
......@@ -12862,7 +12862,7 @@
},
{
"name": "name",
"description": null,
"description": "Name of the entry",
"args": [
],
......@@ -12880,7 +12880,7 @@
},
{
"name": "path",
"description": null,
"description": "Path of the entry",
"args": [
],
......@@ -12898,7 +12898,7 @@
},
{
"name": "sha",
"description": "Last commit sha for entry",
"description": "Last commit sha for the entry",
"args": [
],
......@@ -12916,7 +12916,7 @@
},
{
"name": "type",
"description": null,
"description": "Type of tree entry",
"args": [
],
......@@ -13102,7 +13102,7 @@
"fields": [
{
"name": "flatPath",
"description": null,
"description": "Flat path of the entry",
"args": [
],
......@@ -13120,7 +13120,7 @@
},
{
"name": "id",
"description": null,
"description": "ID of the entry",
"args": [
],
......@@ -13138,7 +13138,7 @@
},
{
"name": "name",
"description": null,
"description": "Name of the entry",
"args": [
],
......@@ -13156,7 +13156,7 @@
},
{
"name": "path",
"description": null,
"description": "Path of the entry",
"args": [
],
......@@ -13174,7 +13174,7 @@
},
{
"name": "sha",
"description": "Last commit sha for entry",
"description": "Last commit sha for the entry",
"args": [
],
......@@ -13192,7 +13192,7 @@
},
{
"name": "treeUrl",
"description": null,
"description": "Tree URL for the sub-module",
"args": [
],
......@@ -13206,7 +13206,7 @@
},
{
"name": "type",
"description": null,
"description": "Type of tree entry",
"args": [
],
......@@ -13224,7 +13224,7 @@
},
{
"name": "webUrl",
"description": null,
"description": "Web URL for the sub-module",
"args": [
],
......@@ -13367,7 +13367,7 @@
"fields": [
{
"name": "flatPath",
"description": null,
"description": "Flat path of the entry",
"args": [
],
......@@ -13385,7 +13385,7 @@
},
{
"name": "id",
"description": null,
"description": "ID of the entry",
"args": [
],
......@@ -13403,7 +13403,7 @@
},
{
"name": "lfsOid",
"description": null,
"description": "LFS ID of the blob",
"args": [
],
......@@ -13417,7 +13417,7 @@
},
{
"name": "name",
"description": null,
"description": "Name of the entry",
"args": [
],
......@@ -13435,7 +13435,7 @@
},
{
"name": "path",
"description": null,
"description": "Path of the entry",
"args": [
],
......@@ -13453,7 +13453,7 @@
},
{
"name": "sha",
"description": "Last commit sha for entry",
"description": "Last commit sha for the entry",
"args": [
],
......@@ -13471,7 +13471,7 @@
},
{
"name": "type",
"description": null,
"description": "Type of tree entry",
"args": [
],
......@@ -13489,7 +13489,7 @@
},
{
"name": "webUrl",
"description": null,
"description": "Web URL of the blob",
"args": [
],
......
......@@ -35,14 +35,14 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `sha` | String! | Last commit sha for entry |
| `name` | String! | |
| `type` | EntryType! | |
| `path` | String! | |
| `flatPath` | String! | |
| `webUrl` | String | |
| `lfsOid` | String | |
| `id` | ID! | ID of the entry |
| `sha` | String! | Last commit sha for the entry |
| `name` | String! | Name of the entry |
| `type` | EntryType! | Type of tree entry |
| `path` | String! | Path of the entry |
| `flatPath` | String! | Flat path of the entry |
| `webUrl` | String | Web URL of the blob |
| `lfsOid` | String | LFS ID of the blob |
### Commit
......@@ -856,14 +856,14 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `sha` | String! | Last commit sha for entry |
| `name` | String! | |
| `type` | EntryType! | |
| `path` | String! | |
| `flatPath` | String! | |
| `webUrl` | String | |
| `treeUrl` | String | |
| `id` | ID! | ID of the entry |
| `sha` | String! | Last commit sha for the entry |
| `name` | String! | Name of the entry |
| `type` | EntryType! | Type of tree entry |
| `path` | String! | Path of the entry |
| `flatPath` | String! | Flat path of the entry |
| `webUrl` | String | Web URL for the sub-module |
| `treeUrl` | String | Tree URL for the sub-module |
### TaskCompletionStatus
......@@ -938,13 +938,13 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `sha` | String! | Last commit sha for entry |
| `name` | String! | |
| `type` | EntryType! | |
| `path` | String! | |
| `flatPath` | String! | |
| `webUrl` | String | |
| `id` | ID! | ID of the entry |
| `sha` | String! | Last commit sha for the entry |
| `name` | String! | Name of the entry |
| `type` | EntryType! | Type of tree entry |
| `path` | String! | Path of the entry |
| `flatPath` | String! | Flat path of the entry |
| `webUrl` | String | Web URL for the tree entry (directory) |
### UpdateEpicPayload
......
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