Hi Shopify experts,
I’m trying to create options and variants for product using GraphQL API.
Always I’m getting
LINKED_METAFIELD_DEFINITION_NOT_FOUND
error.
Creating Products:
While Creating the product, I’m sending following info in variables:
“metafields”=> [
[
“namespace”=> “products-meta”,
“key”=> “product-title”,
“type”=> “single_line_text_field”,
],
[
“namespace”=> “products-meta”,
“key”=> “product-finish”,
“type”=> “single_line_text_field”,
],
[
“namespace”=> “products-meta”,
“key”=> “product-shade”,
“type”=> “single_line_text_field”,
],
]
Creating Options:
And while creating the options:
$variables = [
“productId” => $product->shopifyproductid,
“options” => [
[
“name”=>“Finish”,
“linkedMetafield”=>[
“namespace”=>“products-meta”,
“key”=>“product-finish”,
‘values’=>[‘Brushed Nickel’, ‘Olde Bronze’, ]
],
],
],
];
While creating the options, I’m getting LINKED_METAFIELD_DEFINITION_NOT_FOUND error.
Not sure whats wrong I’m doing here. Your help will be appreciated.
Thanks,
Jay