Skip to content

Commit

Permalink
fix: excessive depth on summarize (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
eemmiillyy authored Nov 2, 2023
1 parent d282d18 commit 19c5dd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-steaks-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xata.io/client': patch
---

Fix excessive depth on summarize
6 changes: 4 additions & 2 deletions packages/client/src/schema/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export type SelectedPick<O extends XataRecord, Key extends SelectableColumnWithO
>;

// Public: Utility type to get the value of a column at a given path
export type ValueAtColumn<Object, Key> = Key extends '*'
export type ValueAtColumn<Object, Key, RecursivePath extends any[] = []> = RecursivePath['length'] extends MAX_RECURSION
? never
: Key extends '*'
? Values<Object> // Alias for any property
: Key extends 'id'
? string // Alias for id (not in schema)
Expand All @@ -113,7 +115,7 @@ export type ValueAtColumn<Object, Key> = Key extends '*'
NonNullable<Object[K]> extends infer Item
? Item extends Record<string, any>
? V extends SelectableColumn<Item>
? { V: ValueAtColumn<Item, V> }
? { V: ValueAtColumn<Item, V, [...RecursivePath, Item]> }
: never
: Object[K]
: never
Expand Down

0 comments on commit 19c5dd4

Please sign in to comment.