blob: fe0b1893a232b8e7a33f01b9beee381e1c00e65e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# frozen_string_literal: true
module Resolvers
class EchoResolver < BaseResolver
description 'Testing endpoint to validate the API with'
argument :text, GraphQL::STRING_TYPE, required: true,
description: 'Text to echo back'
def resolve(**args)
username = context[:current_user]&.username
"#{username.inspect} says: #{args[:text]}"
end
end
end
|