debian-mirror-gitlab/app/graphql/types/projects/service_type.rb

30 lines
929 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
module Types
module Projects
module ServiceType
include Types::BaseInterface
graphql_name 'Service'
2020-06-23 00:09:42 +05:30
# TODO: Add all the fields that we want to expose for the project services integrations
2020-04-22 19:07:51 +05:30
# https://gitlab.com/gitlab-org/gitlab/-/issues/213088
field :type, GraphQL::STRING_TYPE, null: true,
2021-03-11 19:13:27 +05:30
description: 'Class name of the service.'
2020-04-22 19:07:51 +05:30
field :active, GraphQL::BOOLEAN_TYPE, null: true,
2021-03-11 19:13:27 +05:30
description: 'Indicates if the service is active.'
2020-04-22 19:07:51 +05:30
definition_methods do
def resolve_type(object, context)
if object.is_a?(::JiraService)
Types::Projects::Services::JiraServiceType
else
Types::Projects::Services::BaseServiceType
end
end
end
orphan_types Types::Projects::Services::BaseServiceType, Types::Projects::Services::JiraServiceType
end
end
end