Hi. I am going to create metaobject and metafields for custom color using GraphQL API.
I can see and want to use the ‘Color’ - ‘shopify–color-pattern’, but client to want to change name to ‘Colour’.
Q1: so in this case, it there any way to change standard metafields of ‘Color’? if so, how can do this using graphql?
Q2: if it is not possible, I want to defined the custom metaobject and metafields. I tried to it and I can make the ‘Colour’ custom metaobject and custom metafields definitions. but it is assign to product. I think, to assign product metafield definitions to a category using GraphQL, you’ll need to create the metafield definition and then associate it with the category as defualt ‘Color’ metafields definition. but I am not sure how can do it?
Can you give some example?
Here is my code for creating the metafield definition.
const payload = {
definition: {
name: "Colour",
namespace: "custom",
key: "colour-pattern",
description: "",
type: "list.metaobject_reference",
ownerType: "PRODUCT",
validations: [
{
name: 'metaobject_definition_id',
value: definition.metaobjectDefinitionByType.id
}
]
}
}
const res = await metafieldDefinitionCreate(payload)
Thanks.
Neven.