Forum Discussion

arthur_'s avatar
arthur_
Guide
7 years ago

Select direct child nodes

Hi,

 

I am trying to select all direct child nodes relative to the current position in hierarchy (using coreNode.id) in CategoryPage with the following query:

 

 

SELECT * FROM nodes WHERE ancestors.id ='category:${coreNode.id}'

 

It does select nodes, but some of those that are visible in hierarchy are not selected by the query, as well as it pulls in nodes that are not direct children of the coreNode, but nested deeper (as far as I understand, used selector looks for any match).

 

How can we extract all direct children nodes in CategoryPage relative to where you are currently in it?