cors error @shopify/react-graphql unable to make queries

Solved
Highlighted
Tourist
10 3 3

Screen Shot 2020-05-11 at 8.26.39 PM.pngScreen Shot 2020-05-11 at 8.27.17 PM.png

 

const link = createHttpLink({
    uri: "https://xxxxx.myshopify.com/api/2020-04/graphql.json", 
    headers: {
        'X-Shopify-Storefront-Access-Token': 'xxxxx', 
    }, 
})

export const client = new ApolloClient({
    link: link,
    cache: new InMemoryCache(),
});
import {useQuery} from '@shopify/react-graphql';
...
 let customer =  useQuery( xxxx )

 

 

0 Likes
Tourist
10 3 3

This is an accepted solution.

My token was incorrect. Use Shopify Storefront API Token

1 Like