Skip to content

Do the hooks support recursion? #975

Discussion options

You must be logged in to vote

Hey @MichaelAllenWarner thank you for your query. This is a known problem with recursive children and GraphQL in general which is unfortunate becuase GQty doesn't make it easier because you cannot use a custom query.

https://stackoverflow.com/questions/44746923/how-to-model-recursive-data-structures-in-graphql

The same issue happens with menus where you have a hierarchy of menu items and each menu can have sub-menus etc. Currently WPGraphQL offers a way to query those using parentIDs (See image bellow)

I recon the same idea can be used for innerBlocks where you have a parent block id to refer to. We plan to have future iterations in order to unlock this within WPGraphQL however currently…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MichaelAllenWarner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants