docs: change useRemoteQueryStep to useQueryGraphStep (#10051)

* docs: change useRemoteQueryStep to useQueryGraphStep

* fix lint errors
This commit is contained in:
Shahed Nasser
2024-11-13 11:00:55 +02:00
committed by GitHub
parent 823552ecd9
commit 868b1c190f
17 changed files with 241 additions and 266 deletions
@@ -55,7 +55,7 @@ import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = () => {
const { data, isLoading } = useQuery({
queryFn: () => sdk.admin.product.list(),
queryKey: ["products"]
queryKey: ["products"],
})
return (
@@ -95,17 +95,17 @@ import { sdk } from "../lib/config"
import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = ({
data: productData
data: productData,
}: DetailWidgetProps<HttpTypes.AdminProduct>) => {
const { mutateAsync } = useMutation({
mutationFn: (payload: HttpTypes.AdminUpdateProduct) =>
sdk.admin.product.update(productData.id, payload),
onSuccess: () => alert("updated product")
onSuccess: () => alert("updated product"),
})
const handleUpdate = () => {
mutateAsync({
title: "New Product Title"
title: "New Product Title",
})
}
@@ -57,7 +57,7 @@ import {
LoaderOptions,
} from "@medusajs/framework/types"
import {
ContainerRegistrationKeys
ContainerRegistrationKeys,
} from "@medusajs/framework/utils"
export default async function helloWorldLoader({
@@ -30,7 +30,7 @@ module.exports = defineConfig({
capitalize: true,
},
},
]
],
})
```
@@ -145,7 +145,7 @@ const myWorkflow = createWorkflow(
function (input: WorkflowInput) {
const message = transform(
{
input
input,
},
(data) => data.input.message || "hello"
)
@@ -179,7 +179,7 @@ const myWorkflow = createWorkflow(
"hello-world",
function (input) {
validateHasStr1({
input
input,
})
// workflow continues its execution only if
@@ -135,8 +135,8 @@ module.exports = defineConfig({
modules: [
{
resolve: "./src/modules/hello",
}
]
},
],
})
```
@@ -212,11 +212,11 @@ export async function GET(
)
const my_custom = await helloModuleService.createMyCustoms({
name: "test"
name: "test",
})
res.json({
my_custom
my_custom,
})
}
```
@@ -105,8 +105,8 @@ module.exports = defineConfig({
modules: [
{
resolve: "./src/modules/brand",
}
]
},
],
})
```
@@ -192,7 +192,7 @@ module.exports = defineConfig({
apiKey: process.env.BRAND_API_KEY || "temp",
},
},
]
],
})
```