Open bougwal opened 2 years ago
I'm having the same issue:
const defaultNetwork = await this.networkRepository.findOne({order: {created_at: "ASC"}});
I get the error:
[Nest] 304561 - 11/24/2022, 4:18:48 AM ERROR [ExceptionsHandler] You must provide selection conditions in order to find a single row.
any simple workaround? please? or i just have to downgrade typeorm?
@albjeremias A simple workaround would be to add below
where: {
id: Not(IsNull()),
},
This condition would always be true on primary key.
although you have to add it in every findOne statements.
Is args.userId
undefined or null, by chance?
In my case it was wrong syntax, the correct syntax is
const dummy = await this.dummyRepository.findOne({ where: { id } });
In previous versions it used to work without where
key, but now it's required.
It also works like this.
const result = await this.repo.findOne({ where:{} })
Issue Description
TypeORM v 0.3.7
where
property errors when used withGraphQL ^16.5.0
andMySQL ^2.18.1
requiring selection condition while it is provided.Expected Behavior
Actual Behavior
Compile time error:
You must provide selection conditions in order to find a single row.
My Environment
Additional Context
Relevant Database Driver(s)
mysql
Are you willing to resolve this issue by submitting a Pull Request?
Note: I downgraded to
^0.2.37
with the same resolver function above and I got the results I expect correctly