docs: fix TypeScript errors in marketplace vendor tutorial (#12302)

The index.ts code example in "Create Workflow" section of the Marketplace Vendor Tutorial contains TypeScript errors that prevent successful compilation:

Missing transform import: The tutorial uses the transform function on line 33, but it's not imported from "@medusajs/framework/workflows-sdk"

TypeScript union type complexity error: When working with the useQueryGraphStep function, TypeScript throws "Expression produces a union type that is too complex to represent" error

Incorrect export name: On line 67, the export is export default createVendorAdminWorkflow but the workflow is defined as createVendorWorkflow (line 24)

These errors make it impossible for developers to follow the tutorial successfully without debugging TypeScript errors.

Closes #12301
This commit is contained in:
Obad Zafar
2025-05-01 11:58:13 +05:00
committed by GitHub
parent 7cb85ea123
commit 393ac8d885

View File

@@ -588,6 +588,7 @@ export const vendorWorkflowHighlights = [
import {
createWorkflow,
WorkflowResponse,
transform,
} from "@medusajs/framework/workflows-sdk"
import {
setAuthAppMetadataStep,
@@ -636,7 +637,7 @@ const createVendorWorkflow = createWorkflow(
actorType: "vendor",
value: vendorAdmin.id,
})
// @ts-ignore
const { data: vendorWithAdmin } = useQueryGraphStep({
entity: "vendor",
fields: ["id", "name", "handle", "logo", "admins.*"],
@@ -651,7 +652,7 @@ const createVendorWorkflow = createWorkflow(
}
)
export default createVendorAdminWorkflow
export default createVendorWorkflow
```
You create a workflow with `createWorkflow` from the Workflows SDK. It accepts two parameters: