Skip to content

Commit

Permalink
refactor: improve Loaded type for entities with private properties
Browse files Browse the repository at this point in the history
Closes #2652
  • Loading branch information
B4nan committed Jan 21, 2022
1 parent f5141b5 commit 5ec7393
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ type Defined<T> = Exclude<T, undefined>;
// For each property on T check if it is included in prefix of keys to load L:
// 1. It yes, mark the collection or reference loaded and resolve its inner type recursively (passing suffix).
// 2. If no, just return it as-is (scalars will be included, loadables too but not loaded).
export type Loaded<T, L extends string = never> = {
export type Loaded<T, L extends string = never> = T & {
[K in keyof T]: K extends Prefix<L>
? LoadedLoadable<Defined<T[K]>, Loaded<ExtractType<Defined<T[K]>>, Suffix<L>>>
: T[K]
Expand Down

0 comments on commit 5ec7393

Please sign in to comment.