Why does builder.getAll not return all results?

You may notice that builder.getAll() doesn’t always return all of your content.

This is because, by default, Builder.io applies targeting rules - so if you are for instance trying to do builder.getAll('page') you may get no results, or just the pages that match the current URL

To change this behavior and fetch everything, use the noTargeting option:

// This will return all pages, regardless of current url
builder.getAll('page', { options: { noTargeting: true }})
4 Likes

It might be nice to have this in the core README.

Or, alternatively, the API Explorer could have a tab to switch from the HTTP API to the SDK API.

Either would improve the visibility of this (very important!) option.

1 Like