2021-07-01 17:08:38 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
class Echo < BaseMutation
|
|
|
|
graphql_name 'EchoCreate'
|
|
|
|
description <<~DOC
|
|
|
|
A mutation that does not perform any changes.
|
|
|
|
|
|
|
|
This is expected to be used for testing of endpoints, to verify
|
|
|
|
that a user has mutation access.
|
|
|
|
DOC
|
|
|
|
|
|
|
|
argument :errors,
|
2021-07-23 11:09:21 -04:00
|
|
|
type: [::GraphQL::Types::String],
|
2021-07-01 17:08:38 -04:00
|
|
|
required: false,
|
|
|
|
description: 'Errors to return to the user.'
|
|
|
|
|
|
|
|
argument :messages,
|
2021-07-23 11:09:21 -04:00
|
|
|
type: [::GraphQL::Types::String],
|
2021-07-01 17:08:38 -04:00
|
|
|
as: :echoes,
|
|
|
|
required: false,
|
|
|
|
description: 'Messages to return to the user.'
|
|
|
|
|
|
|
|
field :echoes,
|
2021-07-23 11:09:21 -04:00
|
|
|
type: [::GraphQL::Types::String],
|
2021-07-01 17:08:38 -04:00
|
|
|
null: true,
|
|
|
|
description: 'Messages returned to the user.'
|
|
|
|
|
|
|
|
def resolve(**args)
|
|
|
|
args
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|