gatsbyjs/gatsby-source-wordpress-experimental

Can't filter or sort child pages using wpChildren

Closed this issue · 1 comments

On pages (or hierarchal post types) you can't filter or sort wpChildren. This is essential for us as we need to be able to display page hierarchy.

image

However in the wordpress admin graphiql UI, we can filter/sort children
image

Is this easily fixed, or is there a working alternative to what I'm trying to achieve? Thanks!

This isn't currently possible. The best way to achieve this is to query top level nodes and filter there. So instead of querying wpPage.wpChildren you would query allWpPage([filter by the parent id]).

In the future, nested field filters will be possible but aren't currently. I'm closing this to consolidate with #60 since that chunk of work should be done at the same time