summaryrefslogtreecommitdiff
path: root/app/graphql/resolvers/echo_resolver.rb
blob: 8076e1784ce0f06a9599816f68885424806d3e5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module Resolvers
  class EchoResolver < BaseResolver
    argument    :text, GraphQL::STRING_TYPE, required: true
    description 'Testing endpoint to validate the API with'

    def resolve(**args)
      username = context[:current_user]&.username

      "#{username.inspect} says: #{args[:text]}"
    end
  end
end