diff options
Diffstat (limited to 'app/graphql')
-rw-r--r-- | app/graphql/resolvers/issues_resolver.rb | 2 | ||||
-rw-r--r-- | app/graphql/types/issuable_sort_enum.rb | 10 | ||||
-rw-r--r-- | app/graphql/types/issue_sort_enum.rb | 10 |
3 files changed, 21 insertions, 1 deletions
diff --git a/app/graphql/resolvers/issues_resolver.rb b/app/graphql/resolvers/issues_resolver.rb index 850df2885aa..1fbc61cd950 100644 --- a/app/graphql/resolvers/issues_resolver.rb +++ b/app/graphql/resolvers/issues_resolver.rb @@ -35,7 +35,7 @@ module Resolvers description: 'Issues closed after this date' argument :search, GraphQL::STRING_TYPE, # rubocop:disable Graphql/Descriptions required: false - argument :sort, Types::SortEnum, + argument :sort, Types::IssueSortEnum, description: 'Sort issues by this criteria', required: false, default_value: 'created_desc' diff --git a/app/graphql/types/issuable_sort_enum.rb b/app/graphql/types/issuable_sort_enum.rb new file mode 100644 index 00000000000..932e90c2d22 --- /dev/null +++ b/app/graphql/types/issuable_sort_enum.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Types + # rubocop: disable Graphql/AuthorizeTypes + class IssuableSortEnum < SortEnum + graphql_name 'IssuableSort' + description 'Values for sorting issuables' + end + # rubocop: enable Graphql/AuthorizeTypes +end diff --git a/app/graphql/types/issue_sort_enum.rb b/app/graphql/types/issue_sort_enum.rb new file mode 100644 index 00000000000..ad919b55481 --- /dev/null +++ b/app/graphql/types/issue_sort_enum.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Types + # rubocop: disable Graphql/AuthorizeTypes + class IssueSortEnum < IssuableSortEnum + graphql_name 'IssueSort' + description 'Values for sorting issues' + end + # rubocop: enable Graphql/AuthorizeTypes +end |