selfprivacy-rest-api/selfprivacy_api/graphql/queries/services.py

19 lines
480 B
Python
Raw Normal View History

2022-08-12 21:29:18 +00:00
"""Services status"""
# pylint: disable=too-few-public-methods
import typing
import strawberry
2022-08-12 22:12:28 +00:00
from selfprivacy_api.graphql.common_types.service import (
Service,
service_to_graphql_service,
2022-08-12 21:29:18 +00:00
)
2022-08-12 22:12:28 +00:00
from selfprivacy_api.services import get_all_services
2022-08-12 21:29:18 +00:00
@strawberry.type
class Services:
@strawberry.field
2022-08-17 20:58:56 +00:00
def all_services(self) -> typing.List[Service]:
2022-08-12 21:29:18 +00:00
services = get_all_services()
return [service_to_graphql_service(service) for service in services]