docs: use tooling convention across docs (#10512)
This commit is contained in:
1 parent
7c76ee24cb
commit
3409953c4f
76 files changed
+283
-265
No files matched your search
@@ -10,7 +10,7 @@ In this chapter, you'll learn how to infer the type of a data model.
|
||||
|
||||
Consider you have a `MyCustom` data model. You can't reference this data model in a type, such as a workflow input or service method output types, since it's a variable.
|
||||
|
||||
Instead, Medusa provides an `InferTypeOf` utility imported from `@medusajs/framework/types` that transforms your data model to a type.
|
||||
Instead, Medusa provides `InferTypeOf` that transforms your data model to a type.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -21,7 +21,7 @@ import { MyCustom } from "../models/my-custom" // relative path to the model
|
||||
export type MyCustom = InferTypeOf<typeof MyCustom>
|
||||
```
|
||||
|
||||
The `InferTypeOf` utility accepts as a type argument the type of the data model.
|
||||
`InferTypeOf` accepts as a type argument the type of the data model.
|
||||
|
||||
Since the `MyCustom` data model is a variable, use the `typeof` operator to pass the data model as a type argument to `InferTypeOf`.
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ export const metadata = {
|
||||
|
||||
In this chapter, you’ll learn about the types of properties in a data model’s schema.
|
||||
|
||||
These types are available as methods on the `model` utility imported from `@medusajs/framework/utils`.
|
||||
|
||||
## id
|
||||
|
||||
The `id` method defines an automatically generated string ID property. The generated ID is a unique string that has a mix of letters and numbers.
|
||||
|
||||
@@ -8,7 +8,7 @@ In this chapter, you’ll learn how to define relationships between data models
|
||||
|
||||
## What is a Relationship Property?
|
||||
|
||||
A relationship property defines an association in the database between two models. It's created using methods on the `models` utility, such as `hasOne` or `belongsTo`.
|
||||
A relationship property defines an association in the database between two models. It's created using the Data Model Language (DML) methods, such as `hasOne` or `belongsTo`.
|
||||
|
||||
When you generate a migration for these data models, the migrations include foreign key columns or pivot tables, based on the relationship's type.
|
||||
|
||||
|
||||
Reference in new issue
Block a user