From 19c5dd47e3a032fcb19d990527b8faaa9326d97d Mon Sep 17 00:00:00 2001 From: Emily Morgan Date: Thu, 2 Nov 2023 08:14:24 +0100 Subject: [PATCH] fix: excessive depth on summarize (#1235) --- .changeset/sixty-steaks-repeat.md | 5 +++++ packages/client/src/schema/selection.ts | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/sixty-steaks-repeat.md diff --git a/.changeset/sixty-steaks-repeat.md b/.changeset/sixty-steaks-repeat.md new file mode 100644 index 000000000..a003b4c28 --- /dev/null +++ b/.changeset/sixty-steaks-repeat.md @@ -0,0 +1,5 @@ +--- +'@xata.io/client': patch +--- + +Fix excessive depth on summarize diff --git a/packages/client/src/schema/selection.ts b/packages/client/src/schema/selection.ts index f3b0abe3f..f0d0afc6d 100644 --- a/packages/client/src/schema/selection.ts +++ b/packages/client/src/schema/selection.ts @@ -95,7 +95,9 @@ export type SelectedPick; // Public: Utility type to get the value of a column at a given path -export type ValueAtColumn = Key extends '*' +export type ValueAtColumn = RecursivePath['length'] extends MAX_RECURSION + ? never + : Key extends '*' ? Values // Alias for any property : Key extends 'id' ? string // Alias for id (not in schema) @@ -113,7 +115,7 @@ export type ValueAtColumn = Key extends '*' NonNullable extends infer Item ? Item extends Record ? V extends SelectableColumn - ? { V: ValueAtColumn } + ? { V: ValueAtColumn } : never : Object[K] : never