Tento Product Update
Tento represents Shopify Update Product mutation
If you want to add existed Metafield Definition to Product, you can provide a metafields
object
and TypeScript will help you with metafields you can add.
index.ts
schema.ts
const result = await client.products.update("gid://shopify/Product/1", {
fields: {
title: "Product #1",
metafields: {
// description is the name of metafield
description: "Innovative Product #1"
}
},
});
// return type
const result: {
title: string;
metafields: {
key: string;
type: MetafieldFieldType;
namespace: string;
ownerType: MetafieldOwnerType;
id: string;
value: string;
}[];
}