Sasha
c41ef65a2b
feat: add defaultPopulate property to collection config ( #8934 )
...
### What?
Adds `defaultPopulate` property to collection config that allows to
specify which fields to select when the collection is populated from
another document.
```ts
import type { CollectionConfig } from 'payload'
// The TSlug generic can be passed to have type safety for `defaultPopulate`.
// If avoided, the `defaultPopulate` type resolves to `SelectType`.
export const Pages: CollectionConfig<'pages'> = {
slug: 'pages',
// I need only slug, NOT the WHOLE CONTENT!
defaultPopulate: {
slug: true,
},
fields: [
{
name: 'slug',
type: 'text',
required: true,
},
],
}
```
### Why?
This is essential for example in case of links. You don't need the whole
document, which can contain large data but only the `slug`.
### How?
Implements `defaultPopulate` when populating relationships, including
inside of lexical / slate rich text fields.
2024-10-30 13:41:34 -04:00
..
2024-10-11 18:54:39 +00:00
2024-10-07 14:20:07 -04:00
2024-10-30 11:29:29 -06:00
2024-10-04 13:02:56 -06:00
2024-10-03 23:37:08 -04:00
2024-09-20 22:46:40 -04:00
2024-09-25 09:23:54 -04:00
2024-09-20 22:46:40 -04:00
2024-10-11 13:14:18 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-17 16:23:45 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-27 22:32:31 +00:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-29 21:47:18 +00:00
2024-09-24 13:29:53 -04:00
2024-09-20 22:46:40 -04:00
2024-10-24 21:19:15 -04:00
2024-10-30 12:06:03 -04:00
2024-10-03 23:37:08 -04:00
2024-08-13 12:54:33 -04:00
2024-10-24 14:47:58 -04:00
2024-09-20 22:46:40 -04:00
2024-10-29 10:03:09 -04:00
2024-08-13 12:54:33 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-24 21:19:15 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-30 11:49:54 -04:00
2024-10-09 14:26:58 -04:00
2024-09-25 11:05:18 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-08 11:40:34 -04:00
2024-07-23 13:44:44 -04:00
2024-10-30 13:41:34 -04:00
2024-10-24 15:46:30 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-09-20 22:46:40 -04:00
2024-10-08 14:45:51 -04:00
2024-10-11 10:01:21 -04:00
2024-07-11 15:59:38 -04:00
2024-05-25 15:45:05 +00:00
2024-10-18 05:38:48 +00:00
2023-09-01 14:45:41 -04:00
2024-03-07 11:33:46 -05:00
2024-10-24 14:47:58 -04:00
2024-09-20 22:46:40 -04:00
2024-09-16 17:02:08 +00:00
2024-08-13 12:54:33 -04:00
2024-08-13 12:54:33 -04:00
2024-09-16 17:02:08 +00:00
2024-10-07 14:20:07 -04:00
2024-09-16 17:02:08 +00:00
2024-10-22 23:22:20 +03:00
2024-10-11 18:54:39 +00:00
2024-10-11 18:54:39 +00:00
2024-10-11 18:54:39 +00:00
2024-03-19 11:31:50 -04:00
2024-08-19 17:31:36 -04:00
2024-10-24 21:19:15 -04:00
2024-05-01 17:35:41 -04:00
2024-08-13 12:54:33 -04:00
2024-08-19 17:31:36 -04:00
2024-08-14 08:57:04 -04:00
2024-08-14 08:57:04 -04:00
2024-10-14 20:02:26 +00:00
2024-10-24 21:19:15 -04:00
2024-04-06 15:06:04 -04:00
2024-06-17 14:25:36 -04:00
2024-08-19 17:31:36 -04:00
2024-03-14 23:53:47 -04:00
2024-08-29 21:25:50 -04:00
2024-10-24 21:19:15 -04:00