GraphQL productUpdateMedia Mutation

Shopify Documentation Link

Hi

I am trying to implement the GraphQL mutation as described in the link above.

I set the products on a private app to write access and am able to perform other updates on products using the API, including uploading media and changing the order of images.

I am trying to add a thumbnail image to the video.

Whenever I run the request using Postman I get the errors:

“message”: “Field ‘id’ doesn’t exist on type ‘Media’”,

“message”: “Field ‘previewImageSource’ doesn’t exist on type ‘Media’”,

The documentation above shows the variable as:
{
“media”: {
“alt”: “”,
“id”: “”,
“previewImageSource”: “”
},
“productId”: “”
}

My query is:

mutation productUpdateMedia($media: [UpdateMediaInput!]!, $productId: ID!) {
productUpdateMedia(media: $media, productId: $productId) {
media {
id
previewImageSource
alt
}
mediaUserErrors {
field
message
}
product {
id
}
}
}

And the graphQL variable is:

{
“media”:
{
“id”:“gid://shopify/ImageSource/2328???152”,
“previewImageSource”:“https://???1.jpg”,
“alt”:“”
},
“productId”:“gid://shopify/Product/687???6”
}

media {
        preview {
            image {
            id
            altText
            originalSrc
            }
        }
   }

The solution is as above. Also make sure the id supplied is the gid for the video. For example,

gid://shopify/Video/1234567890