docs: add details on updating a cart's customer (#10226)

Should be merged after releasing v2.0.5

Closes DX-1096
This commit is contained in:
Shahed Nasser
2024-11-25 11:56:35 +00:00
committed by GitHub
parent 01b0a84898
commit ae1c607f4e
12 changed files with 110 additions and 65 deletions
@@ -106,7 +106,7 @@ const myWorkflow = createWorkflow(
const today = new Date()
return new WorkflowResponse({
today
today,
})
})
@@ -117,7 +117,7 @@ const myWorkflow = createWorkflow(
const today = transform({}, () => new Date())
return new WorkflowResponse({
today
today,
})
})
```
@@ -16,7 +16,7 @@ Each workflow step must have a unique ID, which is the ID passed as a first para
```ts
const useQueryGraphStep = createStep(
"use-query-graph",
"use-query-graph"
// ...
)
```
@@ -29,13 +29,13 @@ const helloWorkflow = createWorkflow(
() => {
const { data: products } = useQueryGraphStep({
entity: "product",
fields: ["id"]
fields: ["id"],
})
// ERROR OCCURS HERE: A STEP HAS THE SAME ID AS ANOTHER IN THE WORKFLOW
const { data: customers } = useQueryGraphStep({
entity: "customer",
fields: ["id"]
fields: ["id"],
})
}
)
@@ -63,13 +63,13 @@ const helloWorkflow = createWorkflow(
() => {
const { data: products } = useQueryGraphStep({
entity: "product",
fields: ["id"]
fields: ["id"],
})
// ✓ No error occurs, the step has a different ID.
const { data: customers } = useQueryGraphStep({
entity: "customer",
fields: ["id"]
fields: ["id"],
}).config({ name: "fetch-customers" })
}
)