debian-mirror-gitlab/app/graphql/resolvers/concerns/search_arguments.rb
2021-11-18 22:05:49 +05:30

18 lines
519 B
Ruby

# frozen_string_literal: true
module SearchArguments
extend ActiveSupport::Concern
included do
argument :search, GraphQL::Types::String,
required: false,
description: 'Search query for title or description.'
end
def validate_anonymous_search_access!
return if current_user.present? || Feature.disabled?(:disable_anonymous_search, type: :ops)
raise ::Gitlab::Graphql::Errors::ArgumentError,
"User must be authenticated to include the `search` argument."
end
end