Open tianyingchun opened 2 years ago
Thanks for putting in the work of creating a full reproduction! That's very, very helpful to me 👍
Initial investigation looks like it may have something to do with
and could be related to the naming strategy for shortening aliases - when shortening the alias, entity names are getting truncated any maybe this is leading to naming clashes.
So I'm pretty sure I have tracked down the root cause:
There is this shorten function which is invoked if the alias name is greater than 63 chars long. The shortening algorithm it uses is creating identical aliases for multiple of the eager-loaded custom field relations. See the linked issue I just created in the TypeORM repo.
So a work-around for now is to rename your custom fields in a way that does not cause a conflict after shortening.
Describe the bug If we use
customFields with
usingrelation
witheager:true
forproductVariant
and we have any other service like belowTo Reproduce
Please the minimal repo https://github.com/tianyingchun/vendure-issue
Installation
yarn install
yarn serve
Preparing sample data maybe not required for this case
http://localhost:3001/admin-api
Issue reproduce steps
http://localhost:3001/admin-api
See errors
Analysis of above problems
/custom-fields/product-variant-custom-fields.ts
custom fields definitions as below witheager: true
supplier-stock-in-transit.service.ts
we attach nested relationssupplierStock.productVariant
This issue may cause of custom Fields with nested
relation
witheager: true
Environment (please complete the following information):
Additional context Add any other context about the problem here.