Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SpinyCucumber committed Jan 1, 2022
1 parent ce66169 commit 24cc880
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions graphene_mongo/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,13 @@ def is_filterable(k):
),
):
return False
if getattr(converted, "type", None) and getattr(converted.type, "_of_type", None) and issubclass(
(get_type(converted.type.of_type)), graphene.Union):

# Fix for https://github.com/graphql-python/graphene-mongo/issues/162
if getattr(converted, "type", None) and getattr(converted.type, "_of_type", None) and not issubclass(
(get_type(converted.type.of_type)), graphene.Scalar):
return False
if isinstance(converted, (graphene.List)) and issubclass(
getattr(converted, "_of_type", None), graphene.Union
if isinstance(converted, (graphene.List)) and not issubclass(
getattr(converted, "_of_type", None), graphene.Scalar
):
return False
return True
Expand Down

0 comments on commit 24cc880

Please sign in to comment.