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

19 lines
480 B
Python
Raw Normal View History

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