-
Notifications
You must be signed in to change notification settings - Fork 643
Missing typings and some fixes #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing typings and some fixes #487
Conversation
typings/objection/index.d.ts
Outdated
| // Non-query methods: | ||
|
|
||
| context(queryContext: object): this; | ||
| context(): object; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't object as a return value pretty useless? You cannot access any property through it without first casting it to any or some other type. This should return QueryContext type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes they are pretty useless, I just took the same type out that was passed in in existing context(queryContext: object): this; declaration. Is there any problems if I change both of them to QueryContext type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object as an argument is ok since any object can be downcasted to object. The argument shouldn't be QueryContext because QueryContext type contains some properties that are added by objection and should never be passed to context or mergeContext methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, now I get it. I'll just fix the new API declaration.
a8fbd5d to
3a97f94
Compare
No description provided.