Skip to content

Commit 5b7e6cb

Browse files
KalleVdhmlau
authored andcommitted
fix(sequelize): extend Inclusion interface with "required" property
This resolves errors such as the following when trying to use the new property with a repository call: ```ts Type '{ relation: string; scope: { where: { id: number; }; }; required: true; }' is not assignable to type 'InclusionFilter'. Object literal may only specify known properties, and 'required' does not exist in type 'Inclusion'. 53 required: true ``` Signed-off-by: KalleV <kvirtaneva@gmail.com>
1 parent 90ae407 commit 5b7e6cb

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

extensions/sequelize/src/types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
// This file is licensed under the MIT License.
44
// License text available at https://opensource.org/licenses/MIT
55

6+
declare module '@loopback/repository' {
7+
interface Inclusion {
8+
/**
9+
* Setting this option to true will result in an inner join query that
10+
* explicitly requires the specified condition for the child model.
11+
*
12+
* @see https://loopback.io/pages/en/lb4/readmes/loopback-next/extensions/sequelize/#inner-join
13+
*/
14+
required?: boolean;
15+
}
16+
}
17+
618
/**
719
* Interface defining the component's options object
820
*/

0 commit comments

Comments
 (0)