gitlab-org--gitlab-foss/app/graphql/resolvers/echo_resolver.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
456 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Resolvers
class EchoResolver < BaseResolver
type ::GraphQL::Types::String, null: false
description 'Testing endpoint to validate the API with'
argument :text,
type: GraphQL::Types::String,
required: true,
description: 'Text to echo back.'
def resolve(text:)
username = current_user&.username
"#{username.inspect} says: #{text}"
end
end
end