Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
HI everyone,
I use the GraphQL Admin API to send products and receive orders.
I create thousands of products at time via bulk operation "createProducts".
My current problem is the field "published" has been remove from ProductInput
and now I need to call the mutation "publishablePublish" for each product.
This is ridiculous, I have a cloud application with many sellers integrated with Shopify and every seller now need to call "publishablePublish" for every single product, the result will be billions of calls?
Please, does anyone have the same problem as me?
Help please
Did you find a solution? I am integrating a legacy store and basically need to delete and create all products every day to reflect inventory...
1. I need to delete all products by product ID one by one
2. I bulk upload all products with bulkOperationRunMutation productCreate (which in it of itself is overly complex with its staging and multiple calls and polling to check the status etc.)
3. ImageSrc is now deprecated, so i need to run productCreateMedia for every single product to upload an image
4. And now... I need to run publishablePublish on all products???
I thought the idea of the GraphQL admin API was to limit the number of calls necessary to acheive certain tasks - doesn't seem to acheive that goal...
@lvorraro It's now available via bulk operations:
https://shopify.dev/docs/api/usage/bulk-operations/imports#limitations
@batsandi The thoughts and feelings that you're expressing are similar to the ones that we've had while trying to get things done with the API. We've had to build several new systems in response to changes with the API. That can take the wind out of our sails.
Here are a couple of reassuring ideas that we've had:
I'm probably missing something, but the bulk upload method is still incredibly annoying. If I want to remove some publications and add some others, I still need to make two bulk operations right? It seems there is no simple way to update a products publications (sales channels) in bulk using 1 mutation call..
I've been bashing on `publicationUpdate` for a few hours today as I thought this would be the silver bullet because it had `publishablesToAdd` and `publishablesToRemove`. However, this is the other way around. So you specify a publishable ID and add/remove products from that publishable.
As of june 2024, an array works:
HI Could you please explain with an example how this particular array works? Im getting familiar with the mutation Payload Returns
It is annoying to work with some aspects of the API, but it gets better as time goes.
We've built an entire system for working with the bulk operations: Getting data, transforming it, acting on it in groups of tasks and organized by types. We don't call it "bulk operation system" though, because it's vendor agnostic and lends itself to work on other systems. It took some time up front, but it has paid off in the long run.
Out of curiosity: Do you use the mutation space to include this code? Or where do you run it?
I only use the mutation fields, and I find that the following structure is unfamiliar with the space provided because the space is usually already inside the mutation. So, when additional fields are included, the mutation usually excludes them. So far, I haven't solved this issue.
Sorry, I don't understand your question. Can you use different words? What is a mutation space? Cheers jb
To this point, the following are now available for use with Bulk Operations:
See also: https://shopify.dev/docs/api/usage/bulk-operations/imports