typeorm icon indicating copy to clipboard operation
typeorm copied to clipboard

View Entity: findOne returns when passing the relations

Open macleysousa opened this issue 1 year ago • 2 comments

Issue description

The findOne method is giving an error when the relationships are passed

Expected Behavior

It should return the first element with and past relationship

Actual Behavior

returns an error

Steps to reproduce

this.view.findOne({ where: { empresaId, id }, relations: ['itens'] });

My Environment

Dependency Version
Operating System Windows 10
Node.js version v18.10.0
Typescript version 0.3.17
TypeORM version 5.2.2

Additional Context

No response

Relevant Database Driver(s)

  • [ ] aurora-mysql
  • [ ] aurora-postgres
  • [ ] better-sqlite3
  • [ ] cockroachdb
  • [ ] cordova
  • [ ] expo
  • [ ] mongodb
  • [X] mysql
  • [ ] nativescript
  • [ ] oracle
  • [ ] postgres
  • [ ] react-native
  • [ ] sap
  • [ ] spanner
  • [ ] sqlite
  • [ ] sqlite-abstract
  • [ ] sqljs
  • [ ] sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, but I don't know how to start. I would need guidance.

macleysousa avatar Sep 01 '23 18:09 macleysousa

What is the error?

synic avatar Apr 01 '24 20:04 synic

What is the error?

image

using findOne causes this error but using find works

macleysousa avatar Apr 03 '24 11:04 macleysousa