refactor(service): add return typing to DNSrecord conversion and comments
continuous-integration/drone/push Build is passing Details

rebuild-when-moving
Houkime 2024-03-18 11:44:53 +00:00
parent 6e29da4a4f
commit b2edfe784a
2 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import typing
import strawberry
# TODO: use https://strawberry.rocks/docs/integrations/pydantic when it is stable
@strawberry.type
class DnsRecord:
"""DNS record"""

View File

@ -89,9 +89,10 @@ def get_storage_usage(root: "Service") -> ServiceStorageUsage:
)
def service_dns_to_graphql(record: ServiceDnsRecord):
# Do we really need 2 types for this?
# ServiceDNSRecord and DnsRecord are almost identical
# TODO: This won't be needed when deriving DnsRecord via strawberry pydantic integration
# https://strawberry.rocks/docs/integrations/pydantic
# Remove when the link above says it got stable.
def service_dns_to_graphql(record: ServiceDnsRecord) -> DnsRecord:
return DnsRecord(
record_type=record.type,
name=record.name,