diff options
Diffstat (limited to 'app/graphql/resolvers/alert_management/http_integrations_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/alert_management/http_integrations_resolver.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/graphql/resolvers/alert_management/http_integrations_resolver.rb b/app/graphql/resolvers/alert_management/http_integrations_resolver.rb new file mode 100644 index 00000000000..94a72bca7c7 --- /dev/null +++ b/app/graphql/resolvers/alert_management/http_integrations_resolver.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Resolvers + module AlertManagement + class HttpIntegrationsResolver < BaseResolver + alias_method :project, :synchronized_object + + type Types::AlertManagement::HttpIntegrationType.connection_type, null: true + + def resolve(**args) + http_integrations + end + + private + + def http_integrations + return [] unless Ability.allowed?(current_user, :admin_operations, project) + + ::AlertManagement::HttpIntegrationsFinder.new(project, {}).execute + end + end + end +end |