diff options
Diffstat (limited to 'app/graphql/types/ci/status_action_type.rb')
-rw-r--r-- | app/graphql/types/ci/status_action_type.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/graphql/types/ci/status_action_type.rb b/app/graphql/types/ci/status_action_type.rb new file mode 100644 index 00000000000..08cbb6d3b59 --- /dev/null +++ b/app/graphql/types/ci/status_action_type.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +module Types + module Ci + # rubocop: disable Graphql/AuthorizeTypes + class StatusActionType < BaseObject + graphql_name 'StatusAction' + + field :button_title, GraphQL::STRING_TYPE, null: true, + description: 'Title for the button, for example: Retry this job' + field :icon, GraphQL::STRING_TYPE, null: true, + description: 'Icon used in the action button' + field :method, GraphQL::STRING_TYPE, null: true, + description: 'Method for the action, for example: :post', + resolver_method: :action_method + field :path, GraphQL::STRING_TYPE, null: true, + description: 'Path for the action' + field :title, GraphQL::STRING_TYPE, null: true, + description: 'Title for the action, for example: Retry' + + def action_method + object[:method] + end + end + end +end |