diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/graphql/types/commit_type.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/graphql/types/commit_type.rb')
-rw-r--r-- | app/graphql/types/commit_type.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/graphql/types/commit_type.rb b/app/graphql/types/commit_type.rb index c24b47f08ef..37d19b4148b 100644 --- a/app/graphql/types/commit_type.rb +++ b/app/graphql/types/commit_type.rb @@ -12,6 +12,8 @@ module Types description: 'ID (global ID) of the commit' field :sha, type: GraphQL::STRING_TYPE, null: false, description: 'SHA1 ID of the commit' + field :short_id, type: GraphQL::STRING_TYPE, null: false, + description: 'Short SHA1 ID of the commit' field :title, type: GraphQL::STRING_TYPE, null: true, calls_gitaly: true, description: 'Title of the commit message' markdown_field :title_html, null: true @@ -31,10 +33,7 @@ module Types field :author_name, type: GraphQL::STRING_TYPE, null: true, description: 'Commit authors name' field :author_gravatar, type: GraphQL::STRING_TYPE, null: true, - description: 'Commit authors gravatar', - resolve: -> (commit, args, context) do - GravatarService.new.execute(commit.author_email, 40) - end + description: 'Commit authors gravatar' # models/commit lazy loads the author by email field :author, type: Types::UserType, null: true, @@ -44,5 +43,9 @@ module Types null: true, description: 'Pipelines of the commit ordered latest first', resolver: Resolvers::CommitPipelinesResolver + + def author_gravatar + GravatarService.new.execute(object.author_email, 40) + end end end |