docs: add guide on how to seed data (#9449)

Add a guide on how to seed data using a custom CLI script, with an example to seed products

Closes DOCS-953
This commit is contained in:
Shahed Nasser
2024-10-14 07:08:05 +00:00
committed by GitHub
parent c9ce918982
commit e3dc9eaf0c
6 changed files with 241 additions and 27 deletions
@@ -31,9 +31,9 @@ export default defineLink(
extraColumns: {
metadata: {
type: "json",
}
}
}
},
},
},
}
)
```
@@ -94,16 +94,16 @@ Learn more about the remote link, how to resolve it, and its methods in [this ch
```ts
await remoteLink.create({
[Modules.PRODUCT]: {
product_id: "123"
product_id: "123",
},
HELLO_MODULE: {
my_custom_id: "321"
my_custom_id: "321",
},
data: {
metadata: {
test: true
}
}
test: true,
},
},
})
```
@@ -138,8 +138,8 @@ const { data } = await query.graph({
entity: productHelloLink.entryPoint,
fields: ["metadata", "product.*", "my_custom.*"],
filters: {
product_id: "prod_123"
}
product_id: "prod_123",
},
})
```
@@ -160,15 +160,15 @@ For example:
```ts
await remoteLink.create({
[Modules.PRODUCT]: {
product_id: "123"
product_id: "123",
},
HELLO_MODULE: {
my_custom_id: "321"
my_custom_id: "321",
},
data: {
metadata: {
test: false
}
}
test: false,
},
},
})
```