2022-05-07 20:08:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module SavedReplies
|
|
|
|
class Base < BaseMutation
|
|
|
|
field :saved_reply, Types::SavedReplyType,
|
|
|
|
null: true,
|
2022-06-21 17:19:12 +05:30
|
|
|
description: 'Saved reply after mutation.'
|
2022-05-07 20:08:51 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def present_result(result)
|
|
|
|
if result.success?
|
|
|
|
{
|
|
|
|
saved_reply: result[:saved_reply],
|
|
|
|
errors: []
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
saved_reply: nil,
|
|
|
|
errors: result.message
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def feature_enabled?
|
2022-07-16 23:28:13 +05:30
|
|
|
Feature.enabled?(:saved_replies, current_user)
|
2022-05-07 20:08:51 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def find_object(id)
|
|
|
|
GitlabSchema.find_by_gid(id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|