diff --git a/app/graphql/types/work_item_type.rb b/app/graphql/types/work_item_type.rb index 18b9bfd1c9aecda50d8ff46f27736a685fe0c838..37eaf330ec8ffce308a576a450fd98304bc6d1d6 100644 --- a/app/graphql/types/work_item_type.rb +++ b/app/graphql/types/work_item_type.rb @@ -6,6 +6,8 @@ class WorkItemType < BaseObject authorize :read_work_item + field :confidential, GraphQL::Types::Boolean, null: false, + description: 'Indicates the work item is confidential.' field :description, GraphQL::Types::String, null: true, description: 'Description of the work item.' field :id, Types::GlobalIDType[::WorkItem], null: false, diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 8451834da84cd04481ff35d73fcfd93f9bdeb57a..a467158ae710224bd7705c41b344201c25a2b03c 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -18530,6 +18530,7 @@ Represents vulnerability letter grades with associated projects. | Name | Type | Description | | ---- | ---- | ----------- | +| <a id="workitemconfidential"></a>`confidential` | [`Boolean!`](#boolean) | Indicates the work item is confidential. | | <a id="workitemdescription"></a>`description` | [`String`](#string) | Description of the work item. | | <a id="workitemdescriptionhtml"></a>`descriptionHtml` | [`String`](#string) | The GitLab Flavored Markdown rendering of `description`. | | <a id="workitemid"></a>`id` | [`WorkItemID!`](#workitemid) | Global ID of the work item. | diff --git a/spec/graphql/types/work_item_type_spec.rb b/spec/graphql/types/work_item_type_spec.rb index 7ed58786b5be992e132c4baed4194691ff16da7a..153934c374c3449d1bd8a283673d5ed09321442c 100644 --- a/spec/graphql/types/work_item_type_spec.rb +++ b/spec/graphql/types/work_item_type_spec.rb @@ -11,6 +11,7 @@ it 'has specific fields' do fields = %i[ + confidential description description_html id diff --git a/spec/requests/api/graphql/work_item_spec.rb b/spec/requests/api/graphql/work_item_spec.rb index f17d2ebbb7e1dd1bfcbeda4d9a19014543e4568b..fea27d51cc5b9ed98bfabefac6686a387f407c8d 100644 --- a/spec/requests/api/graphql/work_item_spec.rb +++ b/spec/requests/api/graphql/work_item_spec.rb @@ -41,6 +41,7 @@ 'lockVersion' => work_item.lock_version, 'state' => "OPEN", 'title' => work_item.title, + 'confidential' => work_item.confidential, 'workItemType' => hash_including('id' => work_item.work_item_type.to_gid.to_s), 'userPermissions' => { 'readWorkItem' => true, 'updateWorkItem' => true, 'deleteWorkItem' => false } )