Querying deeply nested component data - blocks with children

I would like to either use the REST API or builder.get() option to query results to display on a blog home page. For example, I’d like to find all posts with the “featured” field marked as “true”.

This field is contained in a custom component called “PostDetails” that is nested within another custom component called “Layouts”. Here’s the basic structure for each of the blog pages I wish to query:

Layout (custom component)
   Header (symbol)
   PostDetails (custom component I'd like to query)
   Footer (symbol)

This is the data structure that builder provides, when I drill down to find the “featured” field:

data.blocks.0.children.1.component.options.featured

I tried following this Builder post, to apply my structure (and variations thereof) and the response comes back as “undefined”:

const builderDataResponse = await builder.get('blog', {
	query: {
		data: {
			blocks: {
				children: {
					component: {
						options: {
							featured: "true"
						}
					}
				}
			}
		}
	}
}).promise();

I’ve also tried variations on the REST API theme, like so and that keeps returning “{“results”:}”:

https://cdn.builder.io/api/v3/content/blog?apiKey=9c03b50b10da46b088d2dd4aedb8cd93&query.data.blocks.children.component.options.featured=true

I think I’m getting stuck on the “children” part of the query, but that’s just speculative. Has anyone done this sort of query successfully before? Thanks in advance for any help and thoughts!

Is anyone able to drill down to any kind of meaningful data using the REST API right now? I see my full data object on this link:

https://cdn.builder.io/api/v3/content/blog?apiKey=9c03b50b10da46b088d2dd4aedb8cd93

But have not had any success drilling down from there.

Hello @AmyS,

Unfortunately, this type of query is currently not supported using the content API, and you will need to filter it with custom code after fetching the data.

Best regards,