diff options
Diffstat (limited to 'app/graphql/types/branch_rules/branch_protection_type.rb')
-rw-r--r-- | app/graphql/types/branch_rules/branch_protection_type.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/graphql/types/branch_rules/branch_protection_type.rb b/app/graphql/types/branch_rules/branch_protection_type.rb new file mode 100644 index 00000000000..4177a6f92a1 --- /dev/null +++ b/app/graphql/types/branch_rules/branch_protection_type.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Types + module BranchRules + class BranchProtectionType < BaseObject + graphql_name 'BranchProtection' + description 'Branch protection details for a branch rule.' + accepts ::ProtectedBranch + authorize :read_protected_branch + + field :merge_access_levels, + type: Types::BranchProtections::MergeAccessLevelType.connection_type, + null: true, + description: 'Details about who can merge when this branch is the source branch.' + + field :push_access_levels, + type: Types::BranchProtections::PushAccessLevelType.connection_type, + null: true, + description: 'Details about who can push when this branch is the source branch.' + + field :allow_force_push, + type: GraphQL::Types::Boolean, + null: false, + description: 'Toggle force push to the branch for users with write access.' + end + end +end + +Types::BranchRules::BranchProtectionType.prepend_mod_with('Types::BranchRules::BranchProtectionType') |