3D model uploaded through GraphQL API is failed to validate

3D model uploaded through GraphQL API is failed to validate

pavindu
Tourist
11 0 6

I want to upload a 3D model to a product page using GraphQL api. I followed the steps in this tutorial and managed to install graphiql editor in the development store as well. However, after I uploaded the 3D model to a specified product page and viewing the corresponding product in the browser, Shopify claims that the model was failed to validate. But I don't get any error in the graphql media create API response.

First,I do a staged upload:

 

mutation stagedUploadsCreate($input: [StagedUploadInput!]!) {
stagedUploadsCreate(input: $input) {
stagedTargets {
resourceUrl
url
}
userErrors {
field
message
}
}
}

 

variables:

 

{
"input": [
{
"resource": "MODEL_3D",
"filename": "https://raw.githubusercontent.com/pavinduLakshan/model/master/original_glb.glb",
"mimeType": "model/gltf-binary",
"fileSize": "197172"
}
]
}

 

 

Then I do a product create media as follows using the resourceUri obtained in the above request.

 

mutation productCreateMedia($productId: ID!, $media: [CreateMediaInput!]!) {
  productCreateMedia(productId: $productId, media: $media) {
    media {
      alt
    }
    mediaUserErrors {
      code
      field
      message
    }
    product {
      id
    }
  }
}

 

 

variables:

 

{
  "productId": "gid://shopify/Product/5499834007719",
  "media": [
    {
      "originalSource": "https://storage.googleapis.com/threed-models-production/models/9dfef9c163e2fcc8/https_raw_githubusercontent_com_pavinduLakshan_model_master_original_glb.glb?external_model3d_id=bW9kZWwzZC00MDM5Mw==",
      "mediaContentType": "MODEL_3D"
    }
  ]
}

 

I don't get any error when uploading the 3D model:

image_2020_07_17T09_15_38_005Z.png

 

but in the corresponding product update page in the Shopify admin UI, I'm getting an error message like below.

media_invalid_3d_modal.PNG

Can someone please help me to understand why this error is happening? Thank you very much for the all helpful suggestions.

Replies 3 (3)

Tina86
Shopify Partner
4 1 1

Hi, Were you able you resolve this issue? I am getting the same error when trying to upload video.

Some of your media failed to upload, please retry again.
demo-video.mp4: Video failed validation

Xen-dev
Shopify Partner
16 0 1

Hi, anyway you figured out the issue with this ?

ShopifyDevSup
Shopify Staff
1453 238 509

Hey Folks @Xen-dev @Tina86 @pavindu 

If you are still experiencing this error, please do reach out to our Support Team via our Shopify Help Center with some additional context and examples and we can absolutely help look into the cause of these errors in each individual case further.

When reaching out to support if you can please provide the following:

 

  • A link to a product in your admin that experienced this issue within the last 7 days
  • A timeframe for when this error occurred
  • All API requests being made and the responses received, including both the body and headers (especially the x-request-id from the response)

 

This context requested above will allow our support team to authenticate with your store and take a closer look into each individual case to help determine the cause of the errors.

I hope this helps, and I hope you all have a great day 🙂

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog