Skip to content

Commit

Permalink
fix(utils): error message when isQueryable is possibly not enabled. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Jul 11, 2024
1 parent 79ec2bc commit 85c15db
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/core/utils/src/modules-sdk/define-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,24 @@ export function defineLink(
)!

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) {
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]
Expand Down

0 comments on commit 85c15db

Please sign in to comment.