debian-mirror-gitlab/app/graphql/resolvers/topics_resolver.rb

20 lines
498 B
Ruby
Raw Normal View History

2021-12-11 22:18:48 +05:30
# frozen_string_literal: true
module Resolvers
class TopicsResolver < BaseResolver
type Types::Projects::TopicType, null: true
argument :search, GraphQL::Types::String,
required: false,
description: 'Search query for topic name.'
def resolve(**args)
if args[:search].present?
::Projects::Topic.search(args[:search]).order_by_total_projects_count
else
::Projects::Topic.order_by_total_projects_count
end
end
end
end