Webtomizer / typeorm-loader

A database-aware data-loader for use with GraphQL and TypeORM.
82 stars 8 forks source link

SQLITE_ERROR: ambiguous column name #4

Open peXed opened 5 years ago

peXed commented 5 years ago

Hello!

I ran into an issue when using the loader with an TableInheritance base class.

It seems the loader loads the fields of the base-class multiple times when including more than one OneToMany relation.

I got one BaseEntity (entity and TableInheritance) like:

It gets extended by an entity named Contact (child entity).

If I now try to fetch a contact with telephonenumbers AND emails, it will throw the error, because it loads the baseentity.id twice.

SQLITE_ERROR: ambiguous column name: Q_BaseEntity.id

Querieng only one of the relations will work, because the BaseEntity id will only be loaded once.