Friday, 22 March 2024

Sitecore GraphQL query - children

I thought I'd put up a friendly reminder for those who know, or some useful information for those who don't: using children in your GraphQL will (by default) only return 10 items, however the children keyword in Sitecore GraphQL is in fact a function! With this information you can find that you can filter and paginate your list of child items.

While the vast majority of examples you find are something like this:

You can actually write it as:

There really don't seem to be that many examples around which use these features of children (though there are many showing similar parameters for search), so hope this helps someone!

No comments:

Post a Comment