Fetch 3D media assets trhough JS-Buy-Sdk

paulusman
Shopify Partner
1 0 0

Hi everyone,

 

I am using the JS Buy SDK to connect Shopify with my front-end. The response when fetching all products include images I have uploaded but not the 3D models. I believe it is possible to fetch all media using a GraphQL query but I am too inexperienced to succesfully do this.

 

This is what I have tried so far:

 

 

import Client from 'shopify-buy/index.unoptimized.umd';
  
const productsQuery = client.graphQLClient.query((root) => {
    root.addConnection('products', {}, (product) => {

      product.add('title')
      product.add('handle')
      product.addField('media', {}, (image) => {
        image.add('nodes', {}, (node) => {
          node.add('alt')
          node.add('sources', {}, (sources) => {
            sources.add('url')
          })
        })
      })

    });
  });

 

 

 Any help would be appreciated!

Replies 0 (0)