fix: allow to set maxDepth: 0 for join fields, improve join field JSDoc (#10336)
Allows to set `maxDepth: 0` for join fields and improves JSDoc about `maxDepth`, adds tests to confirm that https://github.com/payloadcms/payload/issues/10243 is not an issue, but just happens because the default `maxDepth` is `1`.
This commit is contained in:
@@ -168,6 +168,45 @@ export default buildConfigWithDefaults({
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
slug: 'depth-joins-1',
|
||||
fields: [
|
||||
{
|
||||
name: 'rel',
|
||||
type: 'relationship',
|
||||
relationTo: 'depth-joins-2',
|
||||
},
|
||||
{
|
||||
name: 'joins',
|
||||
type: 'join',
|
||||
collection: 'depth-joins-3',
|
||||
on: 'rel',
|
||||
maxDepth: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
slug: 'depth-joins-2',
|
||||
fields: [
|
||||
{
|
||||
name: 'joins',
|
||||
type: 'join',
|
||||
collection: 'depth-joins-1',
|
||||
on: 'rel',
|
||||
maxDepth: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
slug: 'depth-joins-3',
|
||||
fields: [
|
||||
{
|
||||
name: 'rel',
|
||||
type: 'relationship',
|
||||
relationTo: 'depth-joins-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
localization: {
|
||||
locales: ['en', 'es'],
|
||||
|
||||
Reference in New Issue
Block a user