Commit 774ad9ba authored by Jonas Wälter's avatar Jonas Wälter Committed by Patrick Bajao

GraphQL: Add Project.topics and deprecate Project.tag_list

parent 5b38c607
......@@ -30,8 +30,12 @@ module Types
markdown_field :description_html, null: true
field :tag_list, GraphQL::STRING_TYPE, null: true,
deprecated: { reason: 'Use `topics`', milestone: '13.12' },
description: 'List of project topics (not Git tags).'
field :topics, [GraphQL::STRING_TYPE], null: true,
description: 'List of project topics.'
field :ssh_url_to_repo, GraphQL::STRING_TYPE, null: true,
description: 'URL to connect to the project via SSH.'
field :http_url_to_repo, GraphQL::STRING_TYPE, null: true,
......
---
title: Add GraphQL field 'Project.topics' and deprecate 'Project.tag_list'
merge_request: 61250
author: Jonas Wälter @wwwjon
type: deprecated
......@@ -10756,8 +10756,9 @@ Represents vulnerability finding of a security report on the pipeline.
| <a id="projectstarcount"></a>`starCount` | [`Int!`](#int) | Number of times the project has been starred. |
| <a id="projectstatistics"></a>`statistics` | [`ProjectStatistics`](#projectstatistics) | Statistics of the project. |
| <a id="projectsuggestioncommitmessage"></a>`suggestionCommitMessage` | [`String`](#string) | The commit message used to apply merge request suggestions. |
| <a id="projecttaglist"></a>`tagList` | [`String`](#string) | List of project topics (not Git tags). |
| <a id="projecttaglist"></a>`tagList` **{warning-solid}** | [`String`](#string) | **Deprecated** in 13.12. Use `topics`. |
| <a id="projectterraformstates"></a>`terraformStates` | [`TerraformStateConnection`](#terraformstateconnection) | Terraform states associated with the project. (see [Connections](#connections)) |
| <a id="projecttopics"></a>`topics` | [`[String!]`](#string) | List of project topics. |
| <a id="projectuserpermissions"></a>`userPermissions` | [`ProjectPermissions!`](#projectpermissions) | Permissions for the current user on the resource. |
| <a id="projectvisibility"></a>`visibility` | [`String`](#string) | Visibility of the project. |
| <a id="projectvulnerabilityscanners"></a>`vulnerabilityScanners` | [`VulnerabilityScannerConnection`](#vulnerabilityscannerconnection) | Vulnerability scanners reported on the project vulnerabilities. (see [Connections](#connections)) |
......
......@@ -14,7 +14,7 @@ RSpec.describe GitlabSchema.types['Project'] do
it 'has the expected fields' do
expected_fields = %w[
user_permissions id full_path path name_with_namespace
name description description_html tag_list ssh_url_to_repo
name description description_html tag_list topics ssh_url_to_repo
http_url_to_repo web_url star_count forks_count
created_at last_activity_at archived visibility
container_registry_enabled shared_runners_enabled
......
......@@ -57,6 +57,22 @@ RSpec.describe 'getting project information' do
end
end
context 'topics' do
it 'includes empty topics array if no topics set' do
post_graphql(query, current_user: current_user)
expect(graphql_data_at(:project, :topics)).to match([])
end
it 'includes topics array' do
project.update!(tag_list: 'topic1, topic2, topic3')
post_graphql(query, current_user: current_user)
expect(graphql_data_at(:project, :topics)).to match(%w[topic1 topic2 topic3])
end
end
it 'includes inherited members in project_members' do
group_member = create(:group_member, group: group)
project_member = create(:project_member, project: project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment