diff --git a/neomodel/async_/match.py b/neomodel/async_/match.py index b34938c6..8f103c4f 100644 --- a/neomodel/async_/match.py +++ b/neomodel/async_/match.py @@ -1499,10 +1499,9 @@ async def resolve_subgraph(self) -> list: raise RuntimeError( "Nothing to resolve. Make sure to include relations in the result using fetch_relations() or filter()." ) - all_nodes = qbuilder._execute(dict_output=True) other_nodes = {} root_node = None - async for row in all_nodes: + async for row in qbuilder._execute(dict_output=True): for name, node in row.items(): if node.__class__ is self.source and "_" not in name: root_node = node diff --git a/neomodel/sync_/match.py b/neomodel/sync_/match.py index 73715cc8..1bdfe660 100644 --- a/neomodel/sync_/match.py +++ b/neomodel/sync_/match.py @@ -1499,10 +1499,9 @@ def resolve_subgraph(self) -> list: raise RuntimeError( "Nothing to resolve. Make sure to include relations in the result using fetch_relations() or filter()." ) - all_nodes = qbuilder._execute(dict_output=True) other_nodes = {} root_node = None - for row in all_nodes: + for row in qbuilder._execute(dict_output=True): for name, node in row.items(): if node.__class__ is self.source and "_" not in name: root_node = node diff --git a/test/async_/test_match_api.py b/test/async_/test_match_api.py index ab4bb9cf..bed4f877 100644 --- a/test/async_/test_match_api.py +++ b/test/async_/test_match_api.py @@ -1048,12 +1048,10 @@ async def test_mix_functions(): "parents", ) .fetch_relations( - "lives_in", Optional("children__has_latest_course"), ) .subquery( - filtered_nodeset.order_by("name") - .fetch_relations("has_course") + Student.nodes.fetch_relations("has_course") .intermediate_transform( {"rel": RelationNameResolver("has_course")}, ordering=[ diff --git a/test/sync_/test_match_api.py b/test/sync_/test_match_api.py index 139ad3b4..0ba00b38 100644 --- a/test/sync_/test_match_api.py +++ b/test/sync_/test_match_api.py @@ -1034,12 +1034,10 @@ def test_mix_functions(): "parents", ) .fetch_relations( - "lives_in", Optional("children__has_latest_course"), ) .subquery( - filtered_nodeset.order_by("name") - .fetch_relations("has_course") + Student.nodes.fetch_relations("has_course") .intermediate_transform( {"rel": RelationNameResolver("has_course")}, ordering=[