2018-09-11 15:08:34 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-23 03:55:14 -04:00
|
|
|
module Functions
|
|
|
|
class Echo < BaseFunction
|
|
|
|
argument :text, GraphQL::STRING_TYPE
|
|
|
|
|
|
|
|
description "Testing endpoint to validate the API with"
|
|
|
|
|
|
|
|
def call(obj, args, ctx)
|
|
|
|
username = ctx[:current_user]&.username
|
|
|
|
|
|
|
|
"#{username.inspect} says: #{args[:text]}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|