docs: change useRemoteQueryStep to useQueryGraphStep (#10051)
* docs: change useRemoteQueryStep to useQueryGraphStep * fix lint errors
This commit is contained in:
@@ -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,
|
||||
},
|
||||
},
|
||||
]
|
||||
],
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ const myWorkflow = createWorkflow(
|
||||
function (input: WorkflowInput) {
|
||||
const message = transform(
|
||||
{
|
||||
input
|
||||
input,
|
||||
},
|
||||
(data) => data.input.message || "hello"
|
||||
)
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ const myWorkflow = createWorkflow(
|
||||
"hello-world",
|
||||
function (input) {
|
||||
validateHasStr1({
|
||||
input
|
||||
input,
|
||||
})
|
||||
|
||||
// workflow continues its execution only if
|
||||
|
||||
Reference in New Issue
Block a user