### What?
Adds `populate` property to Local API and REST API operations that can
be used to specify `select` for a specific collection when it's
populated
```ts
const result = await payload.findByID({
populate: {
// type safe if you have generated types
posts: {
text: true,
},
},
collection: 'pages',
depth: 1,
id: aboutPage.id,
})
result.relatedPost // only has text and id properties
```
```ts
fetch('https://localhost:3000/api/pages?populate[posts][text]=true') // highlight-line
.then((res) => res.json())
.then((data) => console.log(data))
```
It also overrides
[`defaultPopulate`](https://github.com/payloadcms/payload/pull/8934)
Ensures `defaultPopulate` doesn't affect GraphQL.
### How?
Implements the property for all operations that have the `depth`
argument.
Payload Slate Rich Text Editor
Slate Rich Text Editor for Payload.
Installation
npm install @payloadcms/richtext-slate
Usage
import { buildConfig } from 'payload'
import { slateEditor } from '@payloadcms/richtext-slate'
export default buildConfig({
editor: slateEditor({}),
// ...rest of config
})
More detailed usage can be found in the Payload Docs.