2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
class EchoResolver < BaseResolver
|
|
|
|
description 'Testing endpoint to validate the API with'
|
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
argument :text, GraphQL::STRING_TYPE, required: true,
|
|
|
|
description: 'Text to echo back'
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
def resolve(**args)
|
|
|
|
username = context[:current_user]&.username
|
|
|
|
|
|
|
|
"#{username.inspect} says: #{args[:text]}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|