Skip to content

Documentation - Content API section does not talk about how to get all pages. #4000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
georgesunnytHDS opened this issue Apr 2, 2025 · 1 comment

Comments

@georgesunnytHDS
Copy link

georgesunnytHDS commented Apr 2, 2025

The documentation for content api does not talk about how to get all the content for a particular data model. For example, on this page
https://www.builder.io/c/docs/content-api#code-limit-code , the example given by builder suggests that it would fetch all the entries for 'my-mode-name' with the limit 10.

import { builder } from "@builder.io/react";

// replace model with your model name
const entries = await builder.getAll('my-model-name', {
  limit: 10
})

But this would only get all the entries for that model if options: { noTargeting: true }, is included like this below,

import { builder } from "@builder.io/react";

// replace model with your model name
const entries = await builder.getAll('my-model-name', {
  options: { noTargeting: true },
  limit: 10
})

Nothing in this page https://www.builder.io/c/docs/content-api talks about options: { noTargeting: true }. I think it would be critical to add documentation regarding this to the page to save developer time and avoid confusion.

I also noticed that this was brought up once 4 years ago https://forum.builder.io/t/why-does-builder-getall-not-return-all-results/419 when another developer had the same confusion.

@steve8708
Copy link
Contributor

this is great feedback @georgesunnytHDS - thanks for sharing. i've forwarded this to our docs team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants