organization_updates.rb 630 B

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