summaryrefslogtreecommitdiff
path: root/app/graphql/types/tree/blob_type.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/tree/blob_type.rb')
-rw-r--r--app/graphql/types/tree/blob_type.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/graphql/types/tree/blob_type.rb b/app/graphql/types/tree/blob_type.rb
index cc6bf7b4f00..a7b90d2533b 100644
--- a/app/graphql/types/tree/blob_type.rb
+++ b/app/graphql/types/tree/blob_type.rb
@@ -15,13 +15,14 @@ module Types
field :web_path, GraphQL::STRING_TYPE, null: true,
description: 'Web path 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
+ description: 'LFS ID of the blob'
field :mode, GraphQL::STRING_TYPE, null: true,
description: 'Blob mode in numeric format'
- # rubocop: enable Graphql/AuthorizeTypes
+
+ def lfs_oid
+ Gitlab::Graphql::Loaders::BatchLfsOidLoader.new(object.repository, object.id).find
+ end
end
+ # rubocop: enable Graphql/AuthorizeTypes
end
end