summaryrefslogtreecommitdiff
path: root/app/graphql/resolvers/echo_resolver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/resolvers/echo_resolver.rb')
-rw-r--r--app/graphql/resolvers/echo_resolver.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/graphql/resolvers/echo_resolver.rb b/app/graphql/resolvers/echo_resolver.rb
new file mode 100644
index 00000000000..8076e1784ce
--- /dev/null
+++ b/app/graphql/resolvers/echo_resolver.rb
@@ -0,0 +1,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