unsubscribe.rb 522 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class Mention::Unsubscribe < Mention::Base
  4. description 'Unsubscribe from updates to an object.'
  5. argument :object_id, GraphQL::Types::ID, description: 'Object to unsubscribe from'
  6. field :success, Boolean, description: 'Was the mutation successful?'
  7. def resolve(object_id:)
  8. object = fetch_object(object_id)
  9. { success: ::Mention.unsubscribe!(object, context.current_user) }
  10. end
  11. end
  12. end