You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: join field support relationships inside arrays (#9773)
### What?
Allow the join field to have a configuration `on` relationships inside
of an array, ie `on: 'myArray.myRelationship'`.
### Why?
This is a more powerful and expressive way to use the join field and not
be limited by usage of array data. For example, if you have a roles
array for multinant sites, you could add a join field on the sites to
show who the admins are.
### How?
This fixes the traverseFields function to allow the configuration to
pass sanitization. In addition, the function for querying the drizzle
tables needed to be ehanced.
Additional changes from #9995:
- Significantly improves traverseFields and the 'join' case with a raw
query injection pattern, right now it's internal but we could expose it
at some point, for example for querying vectors.
- Fixes potential issues with not passed locale to traverseFields (it
was undefined always)
- Adds an empty array fallback for joins with localized relationships
Fixes #
#9643
---------
Co-authored-by: Because789 <thomas@because789.ch>
Co-authored-by: Sasha <64744993+r1tsuu@users.noreply.github.com>
|**`name`**\*| To be used as the property name when retrieved from the database. [More](/docs/fields/overview#field-names)|
127
127
|**`collection`**\*| The `slug`s having the relationship field. |
128
-
|**`on`**\*| The name of the relationship or upload field that relates to the collection document. Use dot notation for nested paths, like 'myGroup.relationName'. |
129
-
|**`where`**\*| A `Where` query to hide related documents from appearing. Will be merged with any `where` specified in the request. |
128
+
|**`on`**\*| The name of the relationship or upload field that relates to the collection document. Use dot notation for nested paths, like 'myGroup.relationName'. |
129
+
|**`where`**| A `Where` query to hide related documents from appearing. Will be merged with any `where` specified in the request. |
130
130
|**`maxDepth`**| Default is 1, Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached. [Max Depth](/docs/getting-started/concepts#field-level-max-depth). |
131
131
|**`label`**| Text used as a field label in the Admin Panel or an object with keys for each language. |
132
132
|**`hooks`**| Provide Field Hooks to control logic for this field. [More details](../hooks/fields). |
0 commit comments