BuilderIO / BuilderIO/builder

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

Open
#4,000 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.8k
Forks
1.2k
Avg merge
1d 6h
Merged PRs (30d)
17

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Content API documentation page and review the getAll example that uses the limit option. Update the page to explain the options: { noTargeting: true } setting and when it is needed to retrieve all entries for a model, then verify the example is clear and accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.