Welcome to mirror list, hosted at ThFree Co, Russian Federation.

topic_type.rb « projects « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bde6d79ddbf52648e0fcb9c6ded52ff55b495fce (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
    # rubocop: disable Graphql/AuthorizeTypes
    class TopicType < BaseObject
      graphql_name 'Topic'

      field :id, GraphQL::Types::ID, null: false,
            description: 'ID of the topic.'

      field :name, GraphQL::Types::String, null: false,
            description: 'Name of the topic.'

      field :title, GraphQL::Types::String, null: false,
            method: :title_or_name,
            description: 'Title of the topic.'

      field :description, GraphQL::Types::String, null: true,
            description: 'Description of the topic.'

      field :avatar_url, GraphQL::Types::String, null: true,
            description: 'URL to avatar image file of the topic.'

      markdown_field :description_html, null: true

      def avatar_url
        object.avatar_url(only_path: false)
      end
    end
    # rubocop: enable Graphql/AuthorizeTypes
  end
end