Allow empty list in SQLAlchemyConnectionField.

Custom resolve()'s empty list return value should take precedence over SQLAlchemyConnectionField default query.
This commit is contained in:
Michael Elsdörfer 2016-03-06 16:01:50 +03:30
parent 70b6cbdf22
commit 653e67de97

View File

@ -17,7 +17,7 @@ class SQLAlchemyConnectionField(ConnectionField):
return self.type._meta.model
def get_query(self, resolved_query, args, info):
return resolved_query or get_query(self.model, info)
return resolved_query if resolved_query is not None else get_query(self.model, info)
def from_list(self, connection_type, resolved, args, info):
query = self.get_query(resolved, args, info)