Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Error Performing productSet Mutation with Video IDs in mediaIds Field

Error Performing productSet Mutation with Video IDs in mediaIds Field

JustinKillian
Shopify Partner
28 0 19

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

 

Replies 5 (5)

Kristofer
Shopify Partner
1 0 1

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:

 

Screenshot 2024-07-10 at 02.22.11.png

Screenshot 2024-07-10 at 02.28.05.png

 

ProductUpdate mutation:

 

Screenshot 2024-07-10 at 03.12.53.png

Screenshot 2024-07-10 at 03.30.26.png

Screenshot 2024-07-10 at 03.14.57.png

 

 

DavidT
Shopify Partner
39 2 17

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.

QuickEdit - Bulk Product Edit - Quick and easy bulk editor for products, variants, and collections.
SafeShip - Address Validator - International address validation and PO box blocking at checkout for Shopify Plus merchants.
JustinKillian
Shopify Partner
28 0 19

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!

DavidT
Shopify Partner
39 2 17

Yes, this new change looks promising. I'm really hoping it will allow reordering the media files as well too.

QuickEdit - Bulk Product Edit - Quick and easy bulk editor for products, variants, and collections.
SafeShip - Address Validator - International address validation and PO box blocking at checkout for Shopify Plus merchants.
DavidT
Shopify Partner
39 2 17

@JustinKillian It looks like it doesn't work to reorder the files 😞

QuickEdit - Bulk Product Edit - Quick and easy bulk editor for products, variants, and collections.
SafeShip - Address Validator - International address validation and PO box blocking at checkout for Shopify Plus merchants.