Welcome to mirror list, hosted at ThFree Co, Russian Federation.

echo_resolver.rb « resolvers « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2ce55544254e0ab5d899f9b43e067a51444c6536 (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 # rubocop:disable Graphql/Descriptions
    description 'Testing endpoint to validate the API with'

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

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