You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on an M2 Mac running the latest OS. The regular koa example works, but the typescript one throws a bunch of errors.
jtsmith@jts-MacBook-Pro koa-ts % npm start
> [email protected] start
> npm run migrate && rm -rf dist && tsc && node dist/app.js
> [email protected] migrate
> knex migrate:latest
Using environment: development
Already up to date
api.ts:21:22 - error TS2769: No overload matches this call.
Overload 1 of 2, '(this: QueryBuilder<...>, graph: PartialModelGraph<Person, Person & GraphParameters>, options?: InsertGraphOptions | undefined): QueryBuilder<...>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelGraph<Person, Person & GraphParameters>'.
Overload 2 of 2, '(this: QueryBuilder<...>, graph: PartialModelGraph<Person, Person & GraphParameters>[], options?: InsertGraphOptions | undefined): QueryBuilder<...>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelGraph<Person, Person & GraphParameters>[]'.
21 .insertGraph(ctx.request.body)
~~~~~~~~~~~~~~~~
api.ts:97:75 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'PartialModelObject<Person>'.
97 const numUpdated = await Person.query().findById(ctx.params.id).patch(ctx.request.body)
~~~~~~~~~~~~~~~~
api.ts:121:78 - error TS2769: No overload matches this call.
Overload 1 of 3, '(insert: PartialModelObject<Person>): QueryBuilder<Person, Person>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelObject<Person>'.
Overload 2 of 3, '(insert: PartialModelObject<Person>[]): QueryBuilder<Person, Person[]>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelObject<Person>[]'.
121 const child = await Person.relatedQuery('children').for(personId).insert(ctx.request.body)
~~~~~~~~~~~~~~~~
api.ts:170:72 - error TS2769: No overload matches this call.
Overload 1 of 3, '(insert: PartialModelObject<Animal>): QueryBuilder<Animal, Animal>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelObject<Animal>'.
Overload 2 of 3, '(insert: PartialModelObject<Animal>[]): QueryBuilder<Animal, Animal[]>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelObject<Animal>[]'.
170 const pet = await Person.relatedQuery('pets').for(personId).insert(ctx.request.body)
~~~~~~~~~~~~~~~~
api.ts:202:46 - error TS2769: No overload matches this call.
Overload 1 of 3, '(insert: PartialModelObject<Movie>): QueryBuilder<Movie, Movie>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelObject<Movie>'.
Overload 2 of 3, '(insert: PartialModelObject<Movie>[]): QueryBuilder<Movie, Movie[]>', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'PartialModelObject<Movie>[]'.
202 const movie = await Movie.query().insert(ctx.request.body)
~~~~~~~~~~~~~~~~
Found 5 errors.
The text was updated successfully, but these errors were encountered:
Since I'm installing this just to learn about objection I'm afraid I can't offer any insights as to why it doesn't work. But the regular koa example worked by just following the instructions.
I'm on an M2 Mac running the latest OS. The regular koa example works, but the typescript one throws a bunch of errors.
The text was updated successfully, but these errors were encountered: