Tento Product Update

Tento represents Shopify Update Product mutation

const result = await client.products.update("gid://shopify/Product/1", {
  fields: {
    title: "Product #1",
  },
});
// result type
const result: {
  title: string;
}


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: {
    metafields: {
      // description is the name of metafield
      description: "Innovative Product #1"
    }
  },
});
// return type
const result: {
  metafields: {
    key: string;
    type: MetafieldFieldType;
    namespace: string;
    ownerType: MetafieldOwnerType;
    id: string;
    value: string;
  }[];
}