Skip to content

Commit c433dbf

Browse files
authored
Merge pull request #405 from nodestream-proj/feature/list-types
Add Mappings for Descrbing List Types
2 parents 9884b7c + 0836147 commit c433dbf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

nodestream/schema/printers/graphql_schema_printer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252
PropertyType.INTEGER: "BigInt",
5353
PropertyType.BOOLEAN: "Boolean",
5454
PropertyType.FLOAT: "Float",
55+
PropertyType.LIST_OF_BOOLEANS: "[Boolean]",
56+
PropertyType.LIST_OF_STRINGS: "[String]",
57+
PropertyType.LIST_OF_INTEGERS: "[BigInt]",
58+
PropertyType.LIST_OF_FLOATS: "[Float]",
59+
PropertyType.LIST_OF_DATETIMES: "[DateTime]",
5560
}
5661

5762

nodestream/schema/state.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ class PropertyType(str, Enum):
3232
INTEGER = "INTEGER"
3333
FLOAT = "FLOAT"
3434

35+
# This is definitely not ideal to describe types this way but it works for now.
36+
LIST_OF_STRINGS = "LIST_OF_STRINGS"
37+
LIST_OF_BOOLEANS = "LIST_OF_BOOLEANS"
38+
LIST_OF_DATETIMES = "LIST_OF_DATETIMES"
39+
LIST_OF_INTEGERS = "LIST_OF_INTEGERS"
40+
LIST_OF_FLOATS = "LIST_OF_FLOATS"
41+
3542

3643
@dataclass(slots=True)
3744
class PropertyMetadata(LoadsFromYaml, SavesToYaml):

0 commit comments

Comments
 (0)