[go: up one dir, main page]

Skip to content

GraphQL: Add protected field to BranchType

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Currently in REST we can query if a branch is protected. In GraphQL, we can find this out as part of a merge request:

The closest thing I can find is under MergeRequestType app/graphql/types/merge_request_type.rb, you can query if the branch is protected. But BranchType doesn't list protected as a field.

field :source_branch_protected, GraphQL::Types::Boolean, null: false, calls_gitaly: true,
      description: 'Indicates if the source branch is protected.'

Looks like it queries app/models/protected_branch.rb but the service takes in a single project and ref. I wonder if we can do it in bulk.

We should add this field to BranchType so a consumer can query many branches.

Edited by 🤖 GitLab Bot 🤖