We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
findOne throws an error if where clauses are not included yet FindOneOptions does not enforce this
Due to this change https://github.com/typeorm/typeorm/blob/master/src/entity-manager/EntityManager.ts#L1116-L1120 it would only make sense to have FindOneOptions also enforce the where clause. Otherwise, this part of the code should be reverted.
This error is only thrown at runtime, making it difficult to track down when FindOneOptions might be adjusted to be fixed for this.
Create a query using FindOne without a where clause, typescript compiler will not pick this up due to the optional where parameter
| Dependency | Version | | Node.js version | v16.17.0 | | Typescript version | 4.8.4 | | TypeORM version | 0.3.11 |
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue description
findOne throws an error if where clauses are not included yet FindOneOptions does not enforce this
Expected Behavior
Due to this change https://github.com/typeorm/typeorm/blob/master/src/entity-manager/EntityManager.ts#L1116-L1120 it would only make sense to have FindOneOptions also enforce the where clause. Otherwise, this part of the code should be reverted.
Actual Behavior
This error is only thrown at runtime, making it difficult to track down when FindOneOptions might be adjusted to be fixed for this.
Steps to reproduce
Create a query using FindOne without a where clause, typescript compiler will not pick this up due to the optional where parameter
My Environment
| Dependency | Version |
| Node.js version | v16.17.0 |
| Typescript version | 4.8.4 |
| TypeORM version | 0.3.11 |
The text was updated successfully, but these errors were encountered: