We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be51468 commit b6d6dabCopy full SHA for b6d6dab
api/types/type_geo.py
@@ -1,5 +1,6 @@
1
from typing import Optional
2
3
+import strawberry
4
import strawberry_django
5
from strawberry import auto
6
@@ -13,4 +14,10 @@ class TypeGeo(BaseType):
13
14
name: auto
15
code: auto
16
type: auto
- parent_id: Optional["TypeGeo"]
17
+
18
+ @strawberry.field(description="Parent geography")
19
+ def parent_id(self) -> Optional["TypeGeo"]:
20
+ """Get parent geography."""
21
+ if self.parent_id: # type: ignore
22
+ return TypeGeo.from_django(self.parent_id) # type: ignore
23
+ return None
0 commit comments