Update featured image of a product using GraphQL admin API

Hi everyone,

I want to update featured image of a product using GraphQL admin API, and then, I also want to use this API for Bulk operation. But I can’t find any API that can update it. The document mention few APIs, such as: productUpdate, productUpdateMedia. But:

  • productUpdate: It just only add new API when I add media into media field of API, and I have to reorder it using productReorderMedia. But my purpose is use bulk operation which does not support productReorderMedia API

  • productUpdateMedia: it just only allow update alt text. so sad

For updating featured image at single product, I can add image using productUpdate and delete old featured image but I have no options to update featured image in bulk.

Do you guys have any options for this case, please help me. Thank you so much in advance.

Hi thangCQ,

From looking into this it does seem that you’re right that the productReorderMedia mutation isn’t supported in bulk operations for setting an image as the first in the list, which means you can’t use it to reorder images in bulk.

This is indeed a limitation if you’re looking to update multiple products at once. If you’re handling a large number of products, you might consider automating these individual calls through a script or app that processes them sequentially. I’ve also flagged this as a feature request to the product team that owns this space.

Yeb, if I use this way, the limit rate of Admin API is a problem. But if there is no better solution, I have to handle by this way. Thank you much