docs: general updates and fixes (#13374)

* docs: general updates and fixes

* fix lint errors
This commit is contained in:
Shahed Nasser
2025-09-02 09:07:07 +03:00
committed by GitHub
parent c717535ca2
commit 24199fa47a
25 changed files with 477 additions and 396 deletions
@@ -18,22 +18,22 @@ Refer to the [Service Factory](!docs!/learn/fundamentals/modules/service-factory
When your module's main service extends the service factory, Medusa will:
1. Generate data-management methods in your main service for each of the data models passed to the `MedusaService` function.
2. Generate internal services for each of the data models passed to the `MedusaService` function, which can be resolved in loaders.
1. Generate [data-management methods in your main service](#main-service-methods) for each of the data models passed to the `MedusaService` function.
2. Generate [internal services](#internal-generated-service-methods) for each of the data models passed to the `MedusaService` function, which can be resolved in loaders.
### Main Service Methods
The names of the generated methods for a service extending the service factory are of the format `{operationName}_{dataModelName}`, where:
The names of the generated methods for a service extending the service factory are of the format `{operationName}{DataModelName}`, where:
- `{operationName}` is the name of the operation. For example, `create`.
- `{dataModelName}` is the pascal-case version of the data model's key that's passed in the object parameter of `MedusaService`. The name is pluralized for all operations except the `retrieve` operation.
- `{DataModelName}` is the pascal-case version of the data model's key that's passed in the object parameter of `MedusaService`. The name is pluralized for all operations except the `retrieve` operation.
Some examples of method names:
- `createPosts`
- `createMyPosts`
- `retrievePost`
- `listPosts`
- `createPosts` (`Post` data model)
- `createMyPosts` (`MyPost` data model)
- `retrievePost` (`Post` data model)
- `listPosts` (`Post` data model)
### Internal Generated Service Methods