Hi,
Have got an irritating issue with graphQL calls to either create or upsert metaobjects. They always give the same error: Value is invalid JSON: unexpected token at ‘gid://shopify/TaxonomyValue/1’.
Here’s the variables object I’m passing in:
…and that matches up pretty exactly to the example in https://shopify.dev/docs/api/admin-graphql/latest/mutations/metaobjectcreate
When I query this metaobject, the existing entries it returns are all in that format. For example here’s a dump of the ‘green’ entry, as it is returned from the metaobject API call:
[4] => stdClass Object
(
[node] => stdClass Object
(
[id] => gid://shopify/Metaobject/167683359049
[handle] => green-reference
[type] => shopify–color-pattern
[displayName] => Green reference
[fields] => Array
(
[0] => stdClass Object
(
[key] => label
[value] => Green reference
)
[1] => stdClass Object
(
[key] => color
[value] => #05AA3D
)
[2] => stdClass Object
(
[key] => image
[value] =>
)
[3] => stdClass Object
(
[key] => color_taxonomy_reference
[value] => [“gid://shopify/TaxonomyValue/9”]
)
[4] => stdClass Object
(
[key] => pattern_taxonomy_reference
[value] => gid://shopify/TaxonomyValue/2874
)
)
)
)
The sharper-eyed among you will have noted that color_taxonomy_reference is an array: I’ve tried providing that field as an array when I try to create one and it doesn’t work either.
Any ideas anyone?
(PS: respectfully, please don’t pitch your service or app to me, this is a technical question and I’m hoping for answers/suggestions, I am not looking to install anything or outsource anything, thank you)
Many thanks,
G
