summaryrefslogtreecommitdiff
path: root/app/graphql/types/projects/branch_rule_type.rb
blob: 866cff0f439fb9e1ffdf2c2cd8c8f5fac11db0c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

module Types
  module Projects
    class BranchRuleType < BaseObject
      graphql_name 'BranchRule'
      description 'List of branch rules for a project, grouped by branch name.'
      accepts ::ProtectedBranch
      authorize :read_protected_branch

      field :name,
            type: GraphQL::Types::String,
            null: false,
            description: 'Branch name, with wildcards, for the branch rules.'

      field :branch_protection,
            type: Types::BranchRules::BranchProtectionType,
            null: false,
            description: 'Branch protections configured for this branch rule.',
            method: :itself

      field :created_at,
            Types::TimeType,
            null: false,
            description: 'Timestamp of when the branch rule was created.'

      field :updated_at,
            Types::TimeType,
            null: false,
            description: 'Timestamp of when the branch rule was last updated.'
    end
  end
end