fix(utils): error message when isQueryable is possibly not enabled. (#8096)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-07-11 18:54:43 +02:00
1 parent 79ec2bcfe2
commit 85c15dbb25
1 file changed
+16 -2
@@ -142,10 +142,24 @@ export function defineLink(
)! )!
if (!serviceAInfo) { if (!serviceAInfo) {
throw new Error(`Service ${serviceAObj.module} was not found`) throw new Error(`Service ${serviceAObj.module} was not found. If this is your module, make sure you set isQueryable to true in medusa-config.js:
${serviceAObj.module}: {
// ...
definition: {
isQueryable: true
}
}`)
} }
if (!serviceBInfo) { if (!serviceBInfo) {
throw new Error(`Service ${serviceBObj.module} was not found`) throw new Error(`Service ${serviceBObj.module} was not found. If this is your module, make sure you set isQueryable to true in medusa-config.js:
${serviceBObj.module}: {
// ...
definition: {
isQueryable: true
}
}`)
} }
const serviceAKeyEntity = serviceAInfo.linkableKeys?.[serviceAObj.key] const serviceAKeyEntity = serviceAInfo.linkableKeys?.[serviceAObj.key]