Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: excessive depth on summarize #1235

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading