Skip to content

Commit dd57382

Browse files
committed
fixes filter type extraction
1 parent 78c36f0 commit dd57382

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

graphene_mongo/fields.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,15 @@ def is_filterable(k):
9393
return False
9494
return True
9595

96-
def get_type(v):
97-
if isinstance(v.type, Structure):
98-
return v.type.of_type()
99-
return v.type()
96+
def get_filter_type(_type):
97+
"""
98+
Returns the scalar type.
99+
"""
100+
if isinstance(_type, Structure):
101+
return get_filter_type(_type.of_type)
102+
return _type()
100103

101-
return {k: get_type(v) for k, v in items if is_filterable(k)}
104+
return {k: get_filter_type(v.type) for k, v in items if is_filterable(k)}
102105

103106
@property
104107
def field_args(self):

0 commit comments

Comments
 (0)