Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2019-06-10 11:05:16 +0300
committerPhil Hughes <me@iamphill.com>2019-06-10 11:05:44 +0300
commit522c01972c7f46dbe8a2cd7569784fa255997c91 (patch)
treeab726ad68410c1c69d12bf8dc2aa527f2a05bd20 /app/graphql/types
parent25420de654b5581ccf6254be769a5e031446eced (diff)
Add LFS blob ID to GraphQL blob type
Diffstat (limited to 'app/graphql/types')
-rw-r--r--app/graphql/types/tree/blob_type.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/graphql/types/tree/blob_type.rb b/app/graphql/types/tree/blob_type.rb
index f2b7d5df2b2..ba191b59132 100644
--- a/app/graphql/types/tree/blob_type.rb
+++ b/app/graphql/types/tree/blob_type.rb
@@ -9,6 +9,9 @@ module Types
graphql_name 'Blob'
field :web_url, GraphQL::STRING_TYPE, null: true
+ field :lfs_oid, GraphQL::STRING_TYPE, null: true, resolve: -> (blob, args, ctx) do
+ Gitlab::Graphql::Loaders::BatchCommitLoader.new(blob.repository, blob.id).find
+ end
end
end
end