summaryrefslogtreecommitdiff
path: root/app/graphql/functions/echo.rb
blob: e5bf109b8d70640ca10e427877e6f9876051edda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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