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:
Diffstat (limited to 'app/graphql/types/snippet_type.rb')
-rw-r--r--app/graphql/types/snippet_type.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/graphql/types/snippet_type.rb b/app/graphql/types/snippet_type.rb
index b23c4f71ffa..73ca3425ded 100644
--- a/app/graphql/types/snippet_type.rb
+++ b/app/graphql/types/snippet_type.rb
@@ -27,9 +27,12 @@ module Types
authorize: :read_project,
resolve: -> (snippet, args, context) { Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, snippet.project_id).find }
+ # Author can be nil in some scenarios. For example,
+ # when the admin setting restricted visibility
+ # level is set to public
field :author, Types::UserType,
description: 'The owner of the snippet',
- null: false,
+ null: true,
resolve: -> (snippet, args, context) { Gitlab::Graphql::Loaders::BatchModelLoader.new(User, snippet.author_id).find }
field :file_name, GraphQL::STRING_TYPE,
@@ -65,6 +68,11 @@ module Types
calls_gitaly: true,
null: false
+ field :blobs, type: [Types::Snippets::BlobType],
+ description: 'Snippet blobs',
+ calls_gitaly: true,
+ null: false
+
field :ssh_url_to_repo, type: GraphQL::STRING_TYPE,
description: 'SSH URL to the snippet repository',
calls_gitaly: true,