ticket_updates.rb 557 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Subscriptions
  3. class TicketUpdates < BaseSubscription
  4. description 'Updates to ticket records'
  5. argument :ticket_id, GraphQL::Types::ID, description: 'Ticket identifier'
  6. field :ticket, Gql::Types::TicketType, description: 'Updated ticket'
  7. def authorized?(ticket_id:)
  8. Gql::ZammadSchema.authorized_object_from_id ticket_id, type: ::Ticket, user: context.current_user
  9. end
  10. def update(ticket_id:)
  11. { ticket: object }
  12. end
  13. end
  14. end