1# frozen_string_literal: true 2 3module Resolvers 4 class EchoResolver < BaseResolver 5 type ::GraphQL::Types::String, null: false 6 description 'Testing endpoint to validate the API with' 7 8 argument :text, 9 type: GraphQL::Types::String, 10 required: true, 11 description: 'Text to echo back.' 12 13 def resolve(text:) 14 username = current_user&.username 15 16 "#{username.inspect} says: #{text}" 17 end 18 end 19end 20