mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-05 23:54:19 +00:00
resolve circular import
This commit is contained in:
parent
9b25bc0d53
commit
766edc657a
|
@ -2,9 +2,18 @@
|
|||
# pylint: disable=too-few-public-methods
|
||||
import typing
|
||||
import strawberry
|
||||
from selfprivacy_api.graphql.queries.api import ApiDevice, ApiRecoveryKeyStatus
|
||||
|
||||
from selfprivacy_api.graphql.queries.system import System
|
||||
from selfprivacy_api.graphql.queries.api import Api
|
||||
|
||||
from selfprivacy_api.resolvers.api import get_api_version, get_devices, get_recovery_key_status
|
||||
|
||||
@strawberry.type
|
||||
class Api:
|
||||
"""API access status"""
|
||||
version: str = strawberry.field(resolver=get_api_version)
|
||||
devices: typing.List[ApiDevice] = strawberry.field(resolver=get_devices)
|
||||
recovery_key: ApiRecoveryKeyStatus = strawberry.field(resolver=get_recovery_key_status)
|
||||
|
||||
@strawberry.type
|
||||
class Query:
|
||||
|
|
|
@ -4,7 +4,6 @@ import datetime
|
|||
import typing
|
||||
import strawberry
|
||||
|
||||
from selfprivacy_api.resolvers.api import get_api_version, get_devices, get_recovery_key_status
|
||||
|
||||
@strawberry.type
|
||||
class ApiDevice:
|
||||
|
@ -21,10 +20,3 @@ class ApiRecoveryKeyStatus:
|
|||
creation_date: typing.Optional[datetime.datetime]
|
||||
expiration_date: typing.Optional[datetime.datetime]
|
||||
uses_left: typing.Optional[int]
|
||||
|
||||
@strawberry.type
|
||||
class Api:
|
||||
"""API access status"""
|
||||
version: str = strawberry.field(resolver=get_api_version)
|
||||
devices: typing.List[ApiDevice] = strawberry.field(resolver=get_devices)
|
||||
recovery_key: ApiRecoveryKeyStatus = strawberry.field(resolver=get_recovery_key_status)
|
||||
|
|
Loading…
Reference in a new issue