import { TypeList } from "docs-ui"

# modules-sdk

## Classes

- [Link](../../modules_sdk/classes/modules_sdk.Link/page.mdx)
- [Query](../../modules_sdk/classes/modules_sdk.Query/page.mdx)
- [RemoteQuery](../../modules_sdk/classes/modules_sdk.RemoteQuery/page.mdx)

## Enumerations

- [MODULE\_SCOPE](../../modules_sdk/enums/modules_sdk.MODULE_SCOPE/page.mdx)

## Functions

- [convertRecordsToLinkDefinition](page.mdx#convertrecordstolinkdefinition)
- [createQuery](page.mdx#createquery)
- [linkingErrorMessage](page.mdx#linkingerrormessage)
- [loadModuleProvider](page.mdx#loadmoduleprovider)
- [loadModules](page.mdx#loadmodules)
- [MedusaApp](page.mdx#medusaapp)
- [MedusaAppGetLinksExecutionPlanner](page.mdx#medusaappgetlinksexecutionplanner)
- [MedusaAppMigrateDown](page.mdx#medusaappmigratedown)
- [MedusaAppMigrateGenerate](page.mdx#medusaappmigrategenerate)
- [MedusaAppMigrateUp](page.mdx#medusaappmigrateup)
- [moduleLoader](page.mdx#moduleloader)
- [moduleProviderLoader](page.mdx#moduleproviderloader)
- [registerMedusaLinkModule](page.mdx#registermedusalinkmodule)
- [registerMedusaModule](page.mdx#registermedusamodule)

## Type Aliases

- [DeleteEntityInput](../../modules_sdk/types/modules_sdk.DeleteEntityInput/page.mdx)
- [GenerateMigrations](../../modules_sdk/types/modules_sdk.GenerateMigrations/page.mdx)
- [GetLinkExecutionPlanner](../../modules_sdk/types/modules_sdk.GetLinkExecutionPlanner/page.mdx)
- [LinkModuleBootstrapOptions](../../modules_sdk/types/modules_sdk.LinkModuleBootstrapOptions/page.mdx)
- [MedusaAppOptions](../../modules_sdk/types/modules_sdk.MedusaAppOptions/page.mdx)
- [MedusaAppOutput](../../modules_sdk/types/modules_sdk.MedusaAppOutput/page.mdx)
- [MedusaModuleConfig](../../modules_sdk/types/modules_sdk.MedusaModuleConfig/page.mdx)
- [MigrationOptions](../../modules_sdk/types/modules_sdk.MigrationOptions/page.mdx)
- [ModuleBootstrapOptions](../../modules_sdk/types/modules_sdk.ModuleBootstrapOptions/page.mdx)
- [RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx)
- [RestoreEntityInput](../../modules_sdk/types/modules_sdk.RestoreEntityInput/page.mdx)
- [RevertMigrationFn](../../modules_sdk/types/modules_sdk.RevertMigrationFn/page.mdx)
- [RunMigrationFn](../../modules_sdk/types/modules_sdk.RunMigrationFn/page.mdx)
- [SharedResources](../../modules_sdk/types/modules_sdk.SharedResources/page.mdx)

## Variables

- [MedusaModule](page.mdx#medusamodule)
- [MODULE\_DEFINITIONS](page.mdx#module_definitions)
- [ModulesDefinition](page.mdx#modulesdefinition)

___

## Functions

### convertRecordsToLinkDefinition

#### Parameters

<TypeList types={[{"name":"links","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"alias","type":"[JoinerServiceConfigAlias](../../types/interfaces/types.JoinerServiceConfigAlias/page.mdx) \\| [JoinerServiceConfigAlias](../../types/interfaces/types.JoinerServiceConfigAlias/page.mdx)[]","description":"Property name to use as entrypoint to the service","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fieldAlias","type":"`Record<string, string \\| object>`","description":"alias for deeper nested relationships (e.g. &#123; 'price': 'prices.calculated\\_price\\_set.amount' &#125;)","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"args","type":"`Record<string, any>`","description":"Extra arguments to pass to the remoteFetchData callback","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g &#123; product\\_id: \"Product\" &#125; \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"__definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resolvePath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="convertRecordsToLinkDefinition"/>

#### Returns

<TypeList types={[{"name":"LinkDefinition[]","type":"[LinkDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LinkDefinition/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="convertRecordsToLinkDefinition"/>

### createQuery

API wrapper around the remoteQuery with backward compatibility support

#### Parameters

<TypeList types={[{"name":"remoteQuery","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"remoteQuery","type":"[RemoteQuery](../../modules_sdk/classes/modules_sdk.RemoteQuery/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"traceFetchRemoteData","type":"(`fetcher`: () => Promise&#60;any&#62;, `serviceName`: `string`, `method`: `string`, `options`: ``{ select?: string[] ; relations: string[]  }``) => Promise&#60;any&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"indexModule","type":"[IIndexService](../../types/IndexTypes/interfaces/types.IndexTypes.IIndexService/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createQuery"/>

#### Returns

<TypeList types={[{"name":"Omit","type":"Omit&#60;[RemoteQueryFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFunction/page.mdx), symbol&#62;","optional":false,"defaultValue":"","description":"API wrapper around the remoteQuery with backward compatibility support","expandable":false,"children":[{"name":"RemoteQueryFunction","type":"[RemoteQueryFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFunction/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"graph","type":"[QueryGraphFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.QueryGraphFunction/page.mdx)","description":"Graph function uses the remoteQuery under the hood and\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"index","type":"[QueryIndexFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.QueryIndexFunction/page.mdx)","description":"Index function uses the index module to query and remoteQuery to hydrate the data\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gql","type":"(`query`: `string`, `variables?`: `Record<string, unknown>`, `options?`: [RemoteJoinerOptions](../../types/interfaces/types.RemoteJoinerOptions/page.mdx)) => Promise&#60;any&#62;","description":"Query wrapper to provide specific GraphQL like API around remoteQuery.query","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"symbol","type":"`symbol`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createQuery"/>

### linkingErrorMessage

#### Parameters

<TypeList types={[{"name":"input","type":"`LinkingErrorMessageInput`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="linkingErrorMessage"/>

#### Returns

<TypeList types={[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="linkingErrorMessage"/>

### loadModuleProvider

#### Parameters

<TypeList types={[{"name":"container","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"[ModuleProvider](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProvider/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"resolve","type":"`string` \\| [ModuleProviderExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProviderExports/page.mdx)&#60;any&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"services","type":"[Constructor](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.Constructor/page.mdx)&#60;Service&#62;[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"module","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"[ModuleProviderLoaderFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProviderLoaderFunction/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"`string`","description":"Explicitly set the the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"registerServiceFn","type":"(`klass`: `any`, `container`: `any`, `moduleDetails`: `any`) => Promise&#60;void&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModuleProvider"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;any[]&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any[]","type":"`any`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModuleProvider"/>

### loadModules

#### Parameters

<TypeList types={[{"name":"args","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"modulesConfig","type":"[MedusaModuleConfig](../../modules_sdk/types/modules_sdk.MedusaModuleConfig/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"[SharedResources](../../modules_sdk/types/modules_sdk.SharedResources/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"[ModuleServiceInitializeOptions](../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.ModuleServiceInitializeOptions/page.mdx)[`\"database\"`] & `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"migrationOnly","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"workerMode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModules"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;any&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="loadModules"/>

### MedusaApp

#### Parameters

<TypeList types={[{"name":"options","type":"[MedusaAppOptions](../../modules_sdk/types/modules_sdk.MedusaAppOptions/page.mdx)","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"[SharedResources](../../modules_sdk/types/modules_sdk.SharedResources/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"[ModuleServiceInitializeOptions](../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.ModuleServiceInitializeOptions/page.mdx)[`\"database\"`] & `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"[LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g &#123; product\\_id: \"Product\" &#125; \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"modulesConfigPath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"[MedusaModuleConfig](../../modules_sdk/types/modules_sdk.MedusaModuleConfig/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"[RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx) \\| [RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"`RemoteFetchDataCallback`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"`any`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => `void`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"`boolean`","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaApp"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;[MedusaAppOutput](../../modules_sdk/types/modules_sdk.MedusaAppOutput/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"modules","type":"`Record<string, [LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx) \\| [LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx)[]>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"link","type":"[Link](../../modules_sdk/classes/modules_sdk.Link/page.mdx) \\| `undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[RemoteQueryFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFunction/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"graph","type":"[QueryGraphFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.QueryGraphFunction/page.mdx)","description":"Graph function uses the remoteQuery under the hood and\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"index","type":"[QueryIndexFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.QueryIndexFunction/page.mdx)","description":"Index function uses the index module to query and remoteQuery to hydrate the data\nreturns a result set","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gql","type":"(`query`: `string`, `variables?`: `Record<string, unknown>`, `options?`: [RemoteJoinerOptions](../../types/interfaces/types.RemoteJoinerOptions/page.mdx)) => Promise&#60;any&#62;","description":"Query wrapper to provide specific GraphQL like API around remoteQuery.query","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"runMigrations","type":"[RunMigrationFn](../../modules_sdk/types/modules_sdk.RunMigrationFn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"revertMigrations","type":"[RevertMigrationFn](../../modules_sdk/types/modules_sdk.RevertMigrationFn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"generateMigrations","type":"[GenerateMigrations](../../modules_sdk/types/modules_sdk.GenerateMigrations/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"linkMigrationExecutionPlanner","type":"[GetLinkExecutionPlanner](../../modules_sdk/types/modules_sdk.GetLinkExecutionPlanner/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationShutdown","type":"() => Promise&#60;void&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationPrepareShutdown","type":"() => Promise&#60;void&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStart","type":"() => Promise&#60;void&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entitiesMap","type":"`Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"gqlSchema","type":"`GraphQLUtils.GraphQLSchema`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"notFound","type":"`Record<string, Record&#60;string, string&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaApp"/>

### MedusaAppGetLinksExecutionPlanner

#### Parameters

<TypeList types={[{"name":"options","type":"[MedusaAppOptions](../../modules_sdk/types/modules_sdk.MedusaAppOptions/page.mdx)","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"[SharedResources](../../modules_sdk/types/modules_sdk.SharedResources/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"[ModuleServiceInitializeOptions](../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.ModuleServiceInitializeOptions/page.mdx)[`\"database\"`] & `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"[LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g &#123; product\\_id: \"Product\" &#125; \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"modulesConfigPath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"[MedusaModuleConfig](../../modules_sdk/types/modules_sdk.MedusaModuleConfig/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"[RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx) \\| [RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"`RemoteFetchDataCallback`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"`any`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => `void`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"`boolean`","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppGetLinksExecutionPlanner"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;[ILinkMigrationsPlanner](../../types/interfaces/types.ILinkMigrationsPlanner/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"createPlan","type":"() => Promise&#60;[LinkMigrationsPlannerAction](../../types/types/types.LinkMigrationsPlannerAction/page.mdx)[]&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"executePlan","type":"(`actions`: [LinkMigrationsPlannerAction](../../types/types/types.LinkMigrationsPlannerAction/page.mdx)[]) => Promise&#60;void&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppGetLinksExecutionPlanner"/>

### MedusaAppMigrateDown

#### Parameters

<TypeList types={[{"name":"moduleNames","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[MedusaAppOptions](../../modules_sdk/types/modules_sdk.MedusaAppOptions/page.mdx)","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"[SharedResources](../../modules_sdk/types/modules_sdk.SharedResources/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"[ModuleServiceInitializeOptions](../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.ModuleServiceInitializeOptions/page.mdx)[`\"database\"`] & `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"[LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g &#123; product\\_id: \"Product\" &#125; \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"modulesConfigPath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"[MedusaModuleConfig](../../modules_sdk/types/modules_sdk.MedusaModuleConfig/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"[RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx) \\| [RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"`RemoteFetchDataCallback`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"`any`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => `void`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"`boolean`","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateDown"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateDown"/>

### MedusaAppMigrateGenerate

#### Parameters

<TypeList types={[{"name":"moduleNames","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[MedusaAppOptions](../../modules_sdk/types/modules_sdk.MedusaAppOptions/page.mdx)","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"[SharedResources](../../modules_sdk/types/modules_sdk.SharedResources/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"[ModuleServiceInitializeOptions](../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.ModuleServiceInitializeOptions/page.mdx)[`\"database\"`] & `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"[LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g &#123; product\\_id: \"Product\" &#125; \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"modulesConfigPath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"[MedusaModuleConfig](../../modules_sdk/types/modules_sdk.MedusaModuleConfig/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"[RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx) \\| [RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"`RemoteFetchDataCallback`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"`any`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => `void`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"`boolean`","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateGenerate"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateGenerate"/>

### MedusaAppMigrateUp

#### Parameters

<TypeList types={[{"name":"options","type":"[MedusaAppOptions](../../modules_sdk/types/modules_sdk.MedusaAppOptions/page.mdx)","description":"","optional":false,"defaultValue":"{}","expandable":false,"children":[{"name":"workerMode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContainer","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedResourcesConfig","type":"[SharedResources](../../modules_sdk/types/modules_sdk.SharedResources/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"database","type":"[ModuleServiceInitializeOptions](../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.ModuleServiceInitializeOptions/page.mdx)[`\"database\"`] & `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"loadedModules","type":"[LoadedModule](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.LoadedModule/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"__joinerConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"__definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"servicesConfig","type":"[ModuleJoinerConfig](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"schema","type":"`string`","description":"GraphQL schema for the all module's available entities and fields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relationships","type":"[ModuleJoinerRelationship](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerRelationship/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extends","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"serviceName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"primaryKeys","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isLink","type":"`boolean`","description":"If the module is a link module","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkableKeys","type":"`Record<string, string>`","description":"Keys that can be used to link to other modules. e.g &#123; product\\_id: \"Product\" &#125; \"Product\" being the entity it refers to","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isReadOnlyLink","type":"`boolean`","description":"If true it expands a RemoteQuery property but doesn't create a pivot table","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"extraDataFields","type":"`string`[]","description":"Fields that will be part of the link record aside from the primary keys that can be updated\nIf not explicitly defined, this array will be populated by databaseConfig.extraFields","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"databaseConfig","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"modulesConfigPath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfigFileName","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"modulesConfig","type":"[MedusaModuleConfig](../../modules_sdk/types/modules_sdk.MedusaModuleConfig/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"linkModules","type":"[RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx) \\| [RegisterModuleJoinerConfig](../../modules_sdk/types/modules_sdk.RegisterModuleJoinerConfig/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"remoteFetchData","type":"`RemoteFetchDataCallback`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"injectedDependencies","type":"`any`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"onApplicationStartCb","type":"() => `void`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"`boolean`","description":"Forces the modules bootstrapper to only run the modules loaders and return prematurely","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateUp"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="MedusaAppMigrateUp"/>

### moduleLoader

#### Parameters

<TypeList types={[{"name":"__namedParameters","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"container","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleResolutions","type":"`Record<string, [ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"resolutionPath","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleExports","type":"[ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx) \\| [ModuleProviderExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProviderExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"logger","type":"[Logger](../../medusa/interfaces/medusa.Logger/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"panic","type":"(`data`: `any`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shouldLog","type":"(`level`: `string`) => `boolean`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"setLogLevel","type":"(`level`: `string`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unsetLogLevel","type":"() => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"activity","type":"(`message`: `string`, `config?`: `Record<string, any>`) => `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"progress","type":"(`activityId`: `string`, `message`: `string`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"error","type":"(`messageOrError`: `string` \\| `Error`, `error?`: `Error`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"failure","type":"(`activityId`: `string`, `message`: `string`) => `null` \\| `Record<string, any>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"success","type":"(`activityId`: `string`, `message`: `string`) => `null` \\| `Record<string, any>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"debug","type":"(`message`: `string`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"info","type":"(`message`: `string`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"warn","type":"(`message`: `string`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"log","type":"(...`args`: `any`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"migrationOnly","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"loaderOnly","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleLoader"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleLoader"/>

### moduleProviderLoader

#### Parameters

<TypeList types={[{"name":"__namedParameters","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"container","type":"[MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"providers","type":"[ModuleProvider](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProvider/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"resolve","type":"`string` \\| [ModuleProviderExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProviderExports/page.mdx)&#60;any&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"registerServiceFn","type":"(`klass`: `any`, `container`: [MedusaContainer](../../medusa/types/medusa.MedusaContainer/page.mdx), `moduleDetails`: `any`) => Promise&#60;void&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleProviderLoader"/>

#### Returns

<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="moduleProviderLoader"/>

### registerMedusaLinkModule

#### Parameters

<TypeList types={[{"name":"definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"`\"internal\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[CustomModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.CustomModuleDefinition/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resolve","type":"`string` \\| [ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"`string`","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"`boolean`","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"server","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resolvePath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"moduleDeclaration","type":"Partial&#60;[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx)&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"`\"internal\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[CustomModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.CustomModuleDefinition/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resolve","type":"`string` \\| [ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"[ModuleLoaderFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleLoaderFunction/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"`string`","description":"Explicitly set the the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"`string`","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"`boolean`","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"moduleExports","type":"[ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"[ModuleLoaderFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleLoaderFunction/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"`string`","description":"Explicitly set the the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaLinkModule"/>

#### Returns

<TypeList types={[{"name":"Record","type":"`Record<string, [ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"ModuleResolution","type":"[ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"resolutionPath","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resolvePath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"`\"internal\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[CustomModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.CustomModuleDefinition/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resolve","type":"`string` \\| [ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"`string`","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"`boolean`","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"server","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"moduleExports","type":"[ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx) \\| [ModuleProviderExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProviderExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"services","type":"[Constructor](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.Constructor/page.mdx)&#60;Service&#62;[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"[ModuleLoaderFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleLoaderFunction/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"`string`","description":"Explicitly set the the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"module","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaLinkModule"/>

### registerMedusaModule

#### Parameters

<TypeList types={[{"name":"moduleKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"`string` \\| `false` \\| Partial&#60;[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleExports","type":"[ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"[ModuleLoaderFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleLoaderFunction/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"`string`","description":"Explicitly set the the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"`\"internal\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[CustomModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.CustomModuleDefinition/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resolve","type":"`string` \\| [ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"`string`","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"`boolean`","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"server","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"resolvePath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaModule"/>

#### Returns

<TypeList types={[{"name":"Record","type":"`Record<string, [ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"string","type":"`string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"ModuleResolution","type":"[ModuleResolution](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleResolution/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"resolutionPath","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"key","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultPackage","type":"`string` \\| `false`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"defaultModuleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"resolvePath","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isRequired","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isQueryable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"moduleDeclaration","type":"[InternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.InternalModuleDeclaration/page.mdx) \\| [ExternalModuleDeclaration](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ExternalModuleDeclaration/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"scope","type":"`\"internal\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"dependencies","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"definition","type":"[CustomModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.CustomModuleDefinition/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"resolve","type":"`string` \\| [ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"alias","type":"`string`","description":"If multiple modules are registered with the same key, the alias can be used to differentiate them","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"main","type":"`boolean`","description":"If the module is the main module for the key when multiple ones are registered","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"worker_mode","type":"`\"shared\"` \\| `\"worker\"` \\| `\"server\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"server","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"moduleExports","type":"[ModuleExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleExports/page.mdx) \\| [ModuleProviderExports](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleProviderExports/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"service","type":"T","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"services","type":"[Constructor](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.Constructor/page.mdx)&#60;Service&#62;[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"loaders","type":"[ModuleLoaderFunction](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleLoaderFunction/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discoveryPath","type":"`string`","description":"Explicitly set the the true location of the module resources.\nCan be used to re-export the module from a different location and specify its original location.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"module","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerMedusaModule"/>

___

## Variables

### MedusaModule

 `Const` **MedusaModule**: typeof `MedusaModule`

### MODULE\_DEFINITIONS

 `Const` **MODULE\_DEFINITIONS**: [ModuleDefinition](../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx)[]

### ModulesDefinition

 `Const` **ModulesDefinition**: `object`
