docs: change config snippets to use defineConfig (#7546)

This commit is contained in:
Shahed Nasser
2024-05-30 16:47:28 +03:00
committed by GitHub
parent ddfd757277
commit fe96bd39b1
51 changed files with 489 additions and 718 deletions
@@ -209,22 +209,24 @@ This creates a relationship to the `Product` data model of the Product Module us
### 2. Adjust Module Configuration
To use relationships in a module, adjust its configuration object passed to the `modules` object in `medusa-config.js`:
To use relationships in a module, adjust its configuration object passed to `modules` in `medusa-config.js`:
export const configHighlights = [
["7", "isQueryable", "Enable this property to use relationships in a module."]
]
```js title="medusa-config.js" highlights={configHighlights}
const modules = {
helloModuleService: {
// ...
definition: {
isQueryable: true,
},
},
module.exports = defineConfig({
// ...
}
modules: {
helloModuleService: {
// ...
definition: {
isQueryable: true
}
}
}
})
```
Enabling the `isQueryable` property is required to use relationships in a module.
@@ -23,15 +23,18 @@ To pass options to a module, add an `options` property to the modules configu
For example:
```js title="medusa-config.js"
const modules = {
helloModuleService: {
resolve: "./dist/modules/hello",
options: {
capitalize: true,
},
},
module.exports = defineConfig({
// ...
}
modules: {
helloModuleService: {
resolve: "./modules/hello",
options: {
capitalize: true,
},
}
}
})
```
The `options` propertys value is an object. You can pass any properties you want.