diff options
Diffstat (limited to 'app/graphql/types/sha_format_enum.rb')
-rw-r--r-- | app/graphql/types/sha_format_enum.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/graphql/types/sha_format_enum.rb b/app/graphql/types/sha_format_enum.rb new file mode 100644 index 00000000000..2e0e5bb85f3 --- /dev/null +++ b/app/graphql/types/sha_format_enum.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Types + class ShaFormatEnum < BaseEnum + graphql_name 'ShaFormat' + description 'How to format SHA strings.' + + FORMATS_DESCRIPTION = { + short: 'Abbreviated format. Short SHAs are typically eight characters long.', + long: 'Unabbreviated format.' + }.freeze + + FORMATS_DESCRIPTION.each do |format, description| + value format.to_s.upcase, + description: description, + value: format.to_s + end + end +end |