From 439c4df916e6d28a61881fd7e1325205f1ac6cb6 Mon Sep 17 00:00:00 2001 From: Daniel Ferro Date: Tue, 9 Jun 2020 12:52:40 -0400 Subject: [PATCH 1/3] Added optional 'nested' attribute for eager loading. --- lib/model.d.ts | 2 +- test/include.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/model.d.ts b/lib/model.d.ts index a5b722a..b57af47 100644 --- a/lib/model.d.ts +++ b/lib/model.d.ts @@ -287,7 +287,7 @@ export interface IncludeThroughOptions extends Filterable, Projectable {} /** * Options for eager-loading associated models, also allowing for all associations to be loaded at once */ -export type Includeable = typeof Model | Association | IncludeOptions | { all: true } +export type Includeable = typeof Model | Association | IncludeOptions | { all: true; nested?: true } /** * Complex include options diff --git a/test/include.ts b/test/include.ts index caa68f5..cbc9373 100644 --- a/test/include.ts +++ b/test/include.ts @@ -19,3 +19,7 @@ MyModel.findAll({ MyModel.findAll({ include: [{ all: true }], }) + +MyModel.findAll({ + include: [{ all: true, nested: true }], +}) From 31615e64778cd06b7644bd15768ab46b24a15351 Mon Sep 17 00:00:00 2001 From: Daniel Ferro Date: Tue, 9 Jun 2020 13:14:26 -0400 Subject: [PATCH 2/3] Set 'nested' type properly. --- lib/model.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model.d.ts b/lib/model.d.ts index b57af47..705d587 100644 --- a/lib/model.d.ts +++ b/lib/model.d.ts @@ -287,7 +287,7 @@ export interface IncludeThroughOptions extends Filterable, Projectable {} /** * Options for eager-loading associated models, also allowing for all associations to be loaded at once */ -export type Includeable = typeof Model | Association | IncludeOptions | { all: true; nested?: true } +export type Includeable = typeof Model | Association | IncludeOptions | { all: true; nested?: boolean } /** * Complex include options From 29b34754af6afbf91a9ccf1b996c296b08fca6f1 Mon Sep 17 00:00:00 2001 From: Daniel Ferro Date: Tue, 9 Jun 2020 13:20:38 -0400 Subject: [PATCH 3/3] Updated type for 'all' attribute. --- lib/model.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model.d.ts b/lib/model.d.ts index 705d587..331dab6 100644 --- a/lib/model.d.ts +++ b/lib/model.d.ts @@ -287,7 +287,7 @@ export interface IncludeThroughOptions extends Filterable, Projectable {} /** * Options for eager-loading associated models, also allowing for all associations to be loaded at once */ -export type Includeable = typeof Model | Association | IncludeOptions | { all: true; nested?: boolean } +export type Includeable = typeof Model | Association | IncludeOptions | { all: boolean; nested?: boolean } /** * Complex include options