From 653e67de97e2e0045051032548d919321ae400dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Elsd=C3=B6rfer?= Date: Sun, 6 Mar 2016 16:01:50 +0330 Subject: [PATCH] Allow empty list in SQLAlchemyConnectionField. Custom resolve()'s empty list return value should take precedence over SQLAlchemyConnectionField default query. --- graphene/contrib/sqlalchemy/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene/contrib/sqlalchemy/fields.py b/graphene/contrib/sqlalchemy/fields.py index 03209c38..99d045c4 100644 --- a/graphene/contrib/sqlalchemy/fields.py +++ b/graphene/contrib/sqlalchemy/fields.py @@ -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)