mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-02-02 14:16:38 +00:00
refactor(service): add return typing to DNSrecord conversion and comments
This commit is contained in:
parent
6e29da4a4f
commit
b2edfe784a
|
@ -2,6 +2,7 @@ import typing
|
||||||
import strawberry
|
import strawberry
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: use https://strawberry.rocks/docs/integrations/pydantic when it is stable
|
||||||
@strawberry.type
|
@strawberry.type
|
||||||
class DnsRecord:
|
class DnsRecord:
|
||||||
"""DNS record"""
|
"""DNS record"""
|
||||||
|
|
|
@ -89,9 +89,10 @@ def get_storage_usage(root: "Service") -> ServiceStorageUsage:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def service_dns_to_graphql(record: ServiceDnsRecord):
|
# TODO: This won't be needed when deriving DnsRecord via strawberry pydantic integration
|
||||||
# Do we really need 2 types for this?
|
# https://strawberry.rocks/docs/integrations/pydantic
|
||||||
# ServiceDNSRecord and DnsRecord are almost identical
|
# Remove when the link above says it got stable.
|
||||||
|
def service_dns_to_graphql(record: ServiceDnsRecord) -> DnsRecord:
|
||||||
return DnsRecord(
|
return DnsRecord(
|
||||||
record_type=record.type,
|
record_type=record.type,
|
||||||
name=record.name,
|
name=record.name,
|
||||||
|
|
Loading…
Reference in a new issue