Merge pull request #127 from miracle2k/patch-1

Allow empty list in SQLAlchemyConnectionField.
This commit is contained in:
Syrus Akbary 2016-03-06 10:06:20 -08:00
commit b5f343b3a3

View File

@ -17,7 +17,7 @@ class SQLAlchemyConnectionField(ConnectionField):
return self.type._meta.model return self.type._meta.model
def get_query(self, resolved_query, args, info): 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): def from_list(self, connection_type, resolved, args, info):
query = self.get_query(resolved, args, info) query = self.get_query(resolved, args, info)