2022-08-25 17:03:56 +00:00
|
|
|
"""Services status"""
|
|
|
|
# pylint: disable=too-few-public-methods
|
|
|
|
import typing
|
|
|
|
import strawberry
|
2023-06-01 19:42:27 +00:00
|
|
|
from strawberry.types import Info
|
2022-08-25 17:03:56 +00:00
|
|
|
|
|
|
|
from selfprivacy_api.graphql.common_types.service import (
|
|
|
|
Service,
|
|
|
|
service_to_graphql_service,
|
|
|
|
)
|
|
|
|
from selfprivacy_api.services import get_all_services
|
|
|
|
|
|
|
|
|
|
|
|
@strawberry.type
|
|
|
|
class Services:
|
|
|
|
@strawberry.field
|
2023-06-01 19:42:27 +00:00
|
|
|
def all_services(self, info: Info) -> typing.List[Service]:
|
|
|
|
locale = info.context["locale"]
|
2022-08-25 17:03:56 +00:00
|
|
|
services = get_all_services()
|
2023-04-12 11:55:34 +00:00
|
|
|
return [service_to_graphql_service(service, locale) for service in services]
|