Skip to content

Commit 9bf3c08

Browse files
committed
add geography schema
1 parent 29afcf8 commit 9bf3c08

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

api/schema/geography_schema.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Schema definitions for geographies."""
2+
3+
import strawberry
4+
import strawberry_django
5+
6+
from api.models import Geography
7+
from api.types.type_geo import TypeGeo
8+
9+
10+
@strawberry.type(name="Query")
11+
class Query:
12+
"""Queries for geographies."""
13+
14+
geographies: list[TypeGeo] = strawberry_django.field()
15+
geography: TypeGeo = strawberry_django.field()

api/schema/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import api.schema.collaborative_schema
1212
import api.schema.dataset_schema
1313
import api.schema.dataspace_schema
14+
import api.schema.geography_schema
1415
import api.schema.metadata_schema
1516
import api.schema.organization_data_schema
1617
import api.schema.organization_schema
@@ -62,6 +63,7 @@ def tags(self, info: Info) -> List[TypeTag]:
6263
api.schema.access_model_schema.Query,
6364
api.schema.sdg_schema.Query,
6465
api.schema.sector_schema.Query,
66+
api.schema.geography_schema.Query,
6567
api.schema.resource_chart_schema.Query,
6668
api.schema.stats_schema.Query,
6769
api.schema.usecase_schema.Query,

0 commit comments

Comments
 (0)