diff --git a/packages/datasource-customizer/src/decorators/computed/types.ts b/packages/datasource-customizer/src/decorators/computed/types.ts index d8dd01c0a1..8b22adde2d 100644 --- a/packages/datasource-customizer/src/decorators/computed/types.ts +++ b/packages/datasource-customizer/src/decorators/computed/types.ts @@ -8,7 +8,7 @@ export interface ComputedDefinition< N extends TCollectionName = TCollectionName, > { readonly columnType: ColumnType; - readonly dependencies: TFieldName[]; + readonly dependencies: [TFieldName, ...TFieldName[]]; readonly defaultValue?: unknown; readonly enumValues?: string[]; diff --git a/packages/datasource-customizer/src/plugins/add-external-relation.ts b/packages/datasource-customizer/src/plugins/add-external-relation.ts index f3a1bcb116..d6a483acee 100644 --- a/packages/datasource-customizer/src/plugins/add-external-relation.ts +++ b/packages/datasource-customizer/src/plugins/add-external-relation.ts @@ -13,7 +13,10 @@ export default async function addExternalRelation< collectionCustomizer: CollectionCustomizer, options: { name: string } & OneToManyEmbeddedDefinition, ): Promise { - const primaryKeys = SchemaUtils.getPrimaryKeys(collectionCustomizer.schema) as TFieldName[]; + const primaryKeys = SchemaUtils.getPrimaryKeys(collectionCustomizer.schema) as [ + TFieldName, + ...TFieldName[], + ]; collectionCustomizer.addField(options.name, { dependencies: options.dependencies ?? primaryKeys, diff --git a/packages/datasource-customizer/src/types.ts b/packages/datasource-customizer/src/types.ts index 9e49a26e10..ee7a8b3aef 100644 --- a/packages/datasource-customizer/src/types.ts +++ b/packages/datasource-customizer/src/types.ts @@ -10,7 +10,7 @@ export type OneToManyEmbeddedDefinition< N extends TCollectionName = TCollectionName, > = { schema: Record; - dependencies?: TFieldName[]; + dependencies?: [TFieldName, ...TFieldName[]]; listRecords( record: TRow, context: CollectionCustomizationContext,