This commit is contained in:
Inex Code 2022-06-24 21:18:21 +03:00
parent 80e5550f7d
commit 45c3e3003d
2 changed files with 13 additions and 5 deletions

View file

@ -4,7 +4,7 @@ import subprocess
import typing
import strawberry
from selfprivacy_api.graphql.queries.common import Alert
from selfprivacy_api.graphql.queries.common import Alert, Severity
from selfprivacy_api.graphql.queries.providers import DnsProvider, ServerProvider
from selfprivacy_api.utils import ReadUserData
@ -150,9 +150,14 @@ class System:
Base system type which represents common system status
"""
status: Alert
status: Alert = strawberry.field(resolver=lambda: Alert(
severity=Severity.INFO,
title="Test message",
message="Test message",
timestamp=None
))
domain: SystemDomainInfo = strawberry.field(resolver=get_system_domain_info)
settings: SystemSettings
info: SystemInfo
settings: SystemSettings = SystemSettings()
info: SystemInfo = SystemInfo()
provider: SystemProviderInfo = strawberry.field(resolver=get_system_provider_info)
busy: bool = False

View file

@ -11,7 +11,10 @@ from selfprivacy_api.graphql.queries.system import System
class Query:
"""Root schema for queries"""
system: System
@strawberry.field
def system(self) -> System:
"""System queries"""
return System()
@strawberry.field
def api(self) -> Api: