A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
I'm making a metaobject via the GraphQL mutation (CreateMetaobject($metaobject: MetaobjectCreateInput!))
I then want to reference this MetaObject in a customer metafield, as far as I can tell, to do this I need the metaobject ID. The ID is not passed back when making the metaobject so I need to request it using the objects handle, however I dont understand the documentation about that request (https://shopify.dev/docs/api/admin-graphql/2023-01/queries/metaobjectByHandle).
Any help would be appreciated.
Thanks, Tom
Hi @tinyman1199 , the handle in a Metaobject can function as a custom id. You can retrieve a Metaobject by querying the handle as an ID. There is an example in this doc here that might give more clarity on that query. Hope this helps.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog