Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

Fetch 3D media assets trhough JS-Buy-Sdk

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)