Hi everyone,
I’m building a custom front-end product upload form that lets me create products in Shopify along with associated metaobjects for additional product details (like pairings, flavor notes, country/region, cultivar, cooking methods, and measurement bar). I’m using Node.js/Express and Shopify’s REST and GraphQL APIs to achieve this.
What I’ve Done:
- My form submits product details (title, description, price) along with nested data for each metaobject type.
- On the server side, I first create the product using the Shopify REST API.
- Then, for each metaobject type, I call a GraphQL mutation (using
metaobjectCreate
) to create the corresponding metaobject. - I attach the created metaobject IDs to the product using metafields (via GraphQL) so that, for example, the product’s “pairing” metafield references a list of pairing metaobjects.
The Issue:
When the metaobjects are created through my API calls, they are automatically set to “draft” status. This means that even though my product is created and its metafield references are attached, the metaobject entries themselves remain unpublished (draft) in the Shopify admin. Unfortunately, Shopify’s MetaobjectCreateInput does not allow me to set a status (like “ACTIVE”) upon creation. I even attempted to update the metaobject status via a subsequent metaobjectUpdate
mutation, but that approach did not return the expected data.
I’ve tried several workarounds, including using update mutations and even considering a scheduled script (using Puppeteer) to simulate manual publishing. However, none of these methods provide an official, supported way to have my metaobjects automatically become active immediately after creation.
My Question:
Is there any supported method or best practice for automatically publishing metaobjects created via the API?
- Has anyone successfully automated the process so that metaobjects aren’t stuck in draft status after creation from a front-end form?
- Are there alternative API endpoints or tools (e.g., Shopify Flow) that can help automate this without relying on hacky workarounds like headless browser scripts?
Any insights, workarounds, or updates on when Shopify might support this feature would be greatly appreciated. Thank you for your help!