mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-24 13:01:28 +00:00
21 lines
574 B
Python
21 lines
574 B
Python
"""Services status"""
|
|
# pylint: disable=too-few-public-methods
|
|
import typing
|
|
import strawberry
|
|
from strawberry.types import Info
|
|
|
|
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
|
|
def all_services(self, info: Info) -> typing.List[Service]:
|
|
locale = info.context["locale"]
|
|
services = get_all_services()
|
|
return [service_to_graphql_service(service, locale) for service in services]
|