feat: join field with polymorphic relationships (#9990)

### What?
The join field had a limitation imposed that prevents it from targeting
polymorphic relationship fields. With this change we can support any
relationship fields.

### Why?
Improves the functionality of join field.

### How?
Extended the database adapters and removed the config sanitization that
would throw an error when polymorphic relationships were used.

Fixes #
This commit is contained in:
Dan Ribbens
2024-12-19 17:34:52 -05:00
committed by GitHub
parent 07be617963
commit d03658de01
19 changed files with 330 additions and 40 deletions

View File

@@ -115,6 +115,30 @@ export const Categories: CollectionConfig = {
collection: 'posts',
on: 'blocks.category',
},
{
name: 'polymorphic',
type: 'join',
collection: postsSlug,
on: 'polymorphic',
},
{
name: 'polymorphics',
type: 'join',
collection: postsSlug,
on: 'polymorphics',
},
{
name: 'localizedPolymorphic',
type: 'join',
collection: postsSlug,
on: 'localizedPolymorphic',
},
{
name: 'localizedPolymorphics',
type: 'join',
collection: postsSlug,
on: 'localizedPolymorphics',
},
{
name: 'singulars',
type: 'join',