Sequelize-typescript: scope include all

Created on 7 Jan 2018  路  3Comments  路  Source: RobinBuschmann/sequelize-typescript

Hi, I want to include all fields in scope. I tried this :
@Scopes({ full: { include: [{ all: true }] } })

But I get this error:

Argument of type '{ full: { include: { all: boolean; }[]; }; }' is not assignable to parameter of type 'IDefineScopeOptions'.
Property 'full' is incompatible with index signature.
Type '{ include: { all: boolean; }[]; }' is not assignable to type 'Function | IScopeFindOptions | undefined'.
Type '{ include: { all: boolean; }[]; }' is not assignable to type 'IScopeFindOptions'.
Types of property 'include' are incompatible.
Type '{ all: boolean; }[]' is not assignable to type '(ModelClassGetter | IScopeIncludeOptions)[] | undefined'.
Type '{ all: boolean; }[]' is not assignable to type '(ModelClassGetter | IScopeIncludeOptions)[]'.
Type '{ all: boolean; }' is not assignable to type 'ModelClassGetter | IScopeIncludeOptions'.
Object literal may only specify known properties, and 'all' does not exist in type 'ModelClassGetter | IScopeIncludeOptions'.

bug

Most helpful comment

Hey @fareshan, thanks for reporting this issue. all: boolean |聽string is missing in the sequelize-typescript typings. This need to be fixed.. until then you can omit the tsc error with [{all: true} as any]

All 3 comments

Hey @fareshan, thanks for reporting this issue. all: boolean |聽string is missing in the sequelize-typescript typings. This need to be fixed.. until then you can omit the tsc error with [{all: true} as any]

OK , thanks

Hi @cavalor ,
This was fixed in the last version. And I no more need to add the 'as any'

Was this page helpful?
0 / 5 - 0 ratings