chore(docs): Generated References (automated) (#10276)
Generated the following references: - `api_key` - `auth` - `cart` - `core_flows` - `currency` - `customer` - `dml` - `fulfillment` - `helper_steps` - `inventory_next` - `js_sdk` - `medusa` - `medusa_config` - `modules` - `modules_sdk` - `order` - `payment` - `payment_provider` - `pricing` - `product` - `product_models` - `promotion` - `region` - `sales_channel` - `search` - `stock_location_next` - `store` - `tax` - `tax_provider` - `types` - `user` - `utils` - `workflows` Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
1 parent
67e2e718e9
commit
d5ee0070b4
928 files changed
+182409
-172163
No files matched your search
+17
-10
@@ -16,22 +16,29 @@ Learn more in the [Remote Link documentation.](https://docs.medusajs.com/advance
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||
import { createRemoteLinkStep } from "@medusajs/medusa/core-flows"
|
||||
import { Modules } from "@medusajs/framework/utils"
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
createRemoteLinkStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
import {
|
||||
Modules
|
||||
} from "@medusajs/framework/utils"
|
||||
|
||||
const helloWorldWorkflow = createWorkflow("hello-world", () => {
|
||||
createRemoteLinkStep([
|
||||
{
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
createRemoteLinkStep([{
|
||||
[Modules.PRODUCT]: {
|
||||
product_id: "prod_123",
|
||||
},
|
||||
helloModuleService: {
|
||||
"helloModuleService": {
|
||||
my_custom_id: "mc_123",
|
||||
},
|
||||
},
|
||||
])
|
||||
})
|
||||
}])
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
+87
-6
@@ -9,14 +9,95 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `useQueryGraphStep` step. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
## Type Parameters
|
||||
This step fetches data across modules using the Query.
|
||||
|
||||
<TypeList types={[{"name":"TEntry","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="useQueryGraphStep"/>
|
||||
Learn more in the [Query documentation](https://docs.medusajs.com/learn/advanced-development/module-links/query).
|
||||
|
||||
## Parameters
|
||||
## Example
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[UseQueryGraphStepInput](../../types/helper_steps.UseQueryGraphStepInput/page.mdx)<TEntry>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"entity","type":"TEntry \\| keyof [RemoteQueryEntryPoints](../../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"[ObjectToRemoteQueryFields](../../../types/types/types.ObjectToRemoteQueryFields/page.mdx)<[RemoteQueryEntryPoints](../../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints/page.mdx)[TEntry & keyof [RemoteQueryEntryPoints](../../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints/page.mdx)]> extends `never` ? `string`[] : [ObjectToRemoteQueryFields](../../../types/types/types.ObjectToRemoteQueryFields/page.mdx)<[RemoteQueryEntryPoints](../../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints/page.mdx)[TEntry & keyof [RemoteQueryEntryPoints](../../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints/page.mdx)]>[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"pagination","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"[RemoteQueryFilters](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFilters/page.mdx)<TEntry>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"`any`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[RemoteJoinerOptions](../../../types/interfaces/types.RemoteJoinerOptions/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="useQueryGraphStep"/>
|
||||
To retrieve a list of records of a data model:
|
||||
|
||||
## Returns
|
||||
```ts
|
||||
import {
|
||||
createWorkflow
|
||||
} from "@medusajs/framework/workflows-sdk"
|
||||
import {
|
||||
useQueryGraphStep
|
||||
} from "@medusajs/medusa/core-flows"
|
||||
|
||||
<TypeList types={[{"name":"data","type":"TEntry extends `never` ? [RemoteQueryEntryPoints](../../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints/page.mdx)[TEntry<TEntry>][] : `any`[] \\| [WorkflowData](../../../workflows/types/workflows.WorkflowData/page.mdx)<TEntry extends never ? [RemoteQueryEntryPoints](../../../types/ModulesSdkTypes/interfaces/types.ModulesSdkTypes.RemoteQueryEntryPoints/page.mdx)[TEntry<TEntry>][] : any[]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"GraphResultSet","type":"[GraphResultSet](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.GraphResultSet/page.mdx)<TEntry>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"WorkflowDataProperties","type":"[WorkflowDataProperties](../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)<[GraphResultSet](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.GraphResultSet/page.mdx)<TEntry>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: ``{ name?: string }`` & Omit<TransactionStepsDefinition, \"next\" \\| \"uuid\" \\| \"action\">) => [WorkflowData](../../../workflows/types/workflows.WorkflowData/page.mdx)<[GraphResultSet](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.GraphResultSet/page.mdx)<TEntry>>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"StepFunctionReturnConfig","type":"[StepFunctionReturnConfig](../../../workflows/types/workflows.StepFunctionReturnConfig/page.mdx)<[GraphResultSet](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.GraphResultSet/page.mdx)<TEntry>>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"metadata","type":"[RemoteQueryFunctionReturnPagination](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFunctionReturnPagination/page.mdx) \\| [WorkflowData](../../../workflows/types/workflows.WorkflowData/page.mdx)<undefined \\| [RemoteQueryFunctionReturnPagination](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.RemoteQueryFunctionReturnPagination/page.mdx)>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="useQueryGraphStep"/>
|
||||
const helloWorldWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
() => {
|
||||
const { data: products } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
]
|
||||
})
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
To retrieve a single item instead of a an array:
|
||||
|
||||
```ts
|
||||
const { data: products } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
],
|
||||
filters: {
|
||||
id: "123"
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
To throw an error if a record isn't found matching the specified ID:
|
||||
|
||||
```ts
|
||||
const { data: products } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
],
|
||||
filters: {
|
||||
id: "123"
|
||||
},
|
||||
options: {
|
||||
throwIfKeyNotFound: true
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
To set pagination configurations:
|
||||
|
||||
```ts
|
||||
const { data: products } = useQueryGraphStep({
|
||||
entity: "product",
|
||||
fields: [
|
||||
"*",
|
||||
"variants.*"
|
||||
],
|
||||
filters: {
|
||||
id: "123"
|
||||
},
|
||||
pagination: {
|
||||
take: 10,
|
||||
skip: 10,
|
||||
order: {
|
||||
created_at: "DESC"
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"UseQueryGraphStepInput","type":"[UseQueryGraphStepInput](../../types/helper_steps.UseQueryGraphStepInput/page.mdx)<TEntry>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"TEntry","type":"TEntry","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="useQueryGraphStep"/>
|
||||
|
||||
## Output
|
||||
|
||||
<TypeList types={[{"name":"GraphResultSet","type":"[GraphResultSet](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.GraphResultSet/page.mdx)<TEntry>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"TEntry","type":"TEntry","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="useQueryGraphStep"/>
|
||||
+7
-1
@@ -11,7 +11,13 @@ This documentation provides a reference to the `useRemoteQueryStep` step. It bel
|
||||
|
||||
This step fetches data across modules using the remote query.
|
||||
|
||||
Learn more in the [Remote Query documentation](https://docs.medusajs.com/advanced-development/modules/remote-query).
|
||||
Learn more in the [Remote Query documentation](https://docs.medusajs.com/learn/advanced-development/module-links/query).
|
||||
|
||||
:::note
|
||||
|
||||
This step is deprecated. Use [useQueryGraphStep](../helper_steps.useQueryGraphStep/page.mdx) instead.
|
||||
|
||||
:::
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
Reference in new issue
Block a user