Tento Metafield Query
Tento support work with Metafield Definitions.
Also Tento has possibility to add Metafield in products using Update Product API:
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;
}[];
}