summaryrefslogtreecommitdiff
path: root/app/graphql
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2019-06-10 09:05:16 +0100
committerPhil Hughes <me@iamphill.com>2019-06-10 09:05:44 +0100
commit522c01972c7f46dbe8a2cd7569784fa255997c91 (patch)
treeab726ad68410c1c69d12bf8dc2aa527f2a05bd20 /app/graphql
parent25420de654b5581ccf6254be769a5e031446eced (diff)
downloadgitlab-ce-522c01972c7f46dbe8a2cd7569784fa255997c91.tar.gz
Add LFS blob ID to GraphQL blob type
Diffstat (limited to 'app/graphql')
-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