A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello there,
I am trying to figure out an error returned by Shopify while trying to create/update a product with videos.
Our integration uses the `productSet` mutation that's part of the 2024-07 API version to create and update products (docs here) .
Along with some other product fields (such as title and description), we also include the `mediaIds` as part of the `productSet` mutation. The `mediaIds` we send includes an array with a video id (e.g. `["gid://shopify/Video/:id"]`).
I double checked the docs, the video id and the mutation and everything seems to be correct. However, Shopify returns an `invalid id` error. If I replace the video id with a media image id it works as expected.
My question is - does the `productSet` mutation support video ids as part of the `mediaIds` field?
Here is the whole response from Shopify:
{ "errors": [ { "message": "invalid id", "locations": [ { "line": 2, "column": 3 } ], "path": [ "productSet" ] } ], "data": { "productSet": null }, "extensions": { "cost": { "requestedQueryCost": 11, "actualQueryCost": 1, "throttleStatus": { "maximumAvailable": 2000, "currentlyAvailable": 1999, "restoreRate": 100 } } } }
Thanks a lot
Hey @JustinKillian, I tried using productSet in the Shopify GraphQL App (2024-07, 2024-10 and unstable) and got the same response. The docs didn't mention any types for mediaIds, so not sure if this is a bug or if the docs need to be updated.
I wondered if adding a Video using the Shopify hosted url with the productUpdate mutation would work but that didn't work either.
ProductSet mutation:
ProductUpdate mutation:
I'm having the same issue. Has anyone been able to get a response from Shopify about this? It seems only MediaImage IDs work, but this doesn't seem right.
Hello @Davi ,
I haven't heard anything from Shopify yet, but I’m keeping an eye on this and similar threads in case there’s any update.
They did announce some changes to the productSet mutation related to media, though I haven’t had a chance to review them yet.
Hopefully, these changes will resolve the issue. If you get a chance to try them out, please let us know how it goes.
Thanks!
Yes, this new change looks promising. I'm really hoping it will allow reordering the media files as well too.
@JustinKillian It looks like it doesn't work to reorder the files 😞