You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine as long as I query a table directly; however, I get inconsistent results when I query many-to-many relationships. Taking the attached schema, I get correct results if I query the Customer table, but when I query Customer via the CustomerPart table, I get this instead:
const getCustomer = async () => {
const { data: customerPartSet } = await client.models.CustomerPart.list({
selectionSet: [
'id',
'customerDetails.*',
'experience',
'customerId',
'customer.*',
'customer.verbiageReqReq.*',
'customer.verbiageOptReq.*',
'customer.verbiageReqOpt.*',
'customer.verbiageOptOpt.*',
'customer.orders.*',
],
});
const cps = customerPartSet[0].customer;
const verbiageReqReq = cps.verbiageReqReq; // should be Verbiage[] and it is!
const verbiageOptReq = cps.verbiageOptReq; // should be (Verbiage | null)[], but is (never[] | null)[]
const verbiageReqOpt = cps.verbiageReqOpt; // should be Verbiage[] | null, but is never[][] | null
const verbiageOptOpt = cps.verbiageOptOpt; // should be (Verbiage | null)[] | null, but is (never[] | null)[] | null
};
Hi @MKlaeui 👋 thanks for raising this issue. I was able to reproduce this particular issue on the latest version of @aws-amplify/data-schema (1.17.1). However, at first I had 1.15.0 installed which did not reproduce the issue and the types seemed correct. I'll mark this as a bug for the team to investigate and fix. In the meantime, if you want to downgrade to @aws-amplify/data-schema@1.15.0 that might unblock you until we release a fix.
Thank you for bringing up this issue! We just released a fix for this issue in the latest version of the package (@aws-amplify/data-schema version 1.17.2). Please run npm update @aws-amplify/data-schema@latest to upgrade the package in your project.
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Environment information
Data packages
Description
Thanks for addressing the issue here #2809
This works fine as long as I query a table directly; however, I get inconsistent results when I query many-to-many relationships. Taking the attached schema, I get correct results if I query the Customer table, but when I query Customer via the CustomerPart table, I get this instead:
resource.txt
The text was updated successfully, but these errors were encountered: