Shopify / storefront-api-examples

Example custom storefront applications built on Shopify's Storefront API
https://help.shopify.com/api/storefront-api
MIT License
1.12k stars 329 forks source link

How to set constant httpLink dynamically with shop_domain #100

Open tomlober opened 5 years ago

tomlober commented 5 years ago

Hello,

In react-apollo you set httplink with URL. How to set set this constant with shopify_domain vars ?

const httpLink = createHttpLink({ uri: MyURL })

const middlewareLink = setContext(() => ({ headers: { 'X-Shopify-Storefront-Access-Token': MyToken } }))

All the best,

ToM