Create sample request in the browser

Jul 4th 2022

While viewing your storefront in a browser, navigate to the integrated JavaScript console; for example, Google Chrome's Console. Use it to run the following code after entering your API token in the authorization header, and adding a valid Product ID for the entityId:

fetch('/graphql', { method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer token`}, body: JSON.stringify({ query: ` query SingleProduct { site { products (entityIds: product ID) { edges { node { id entityId name prices { price { value currencyCode } } } } } } }` }), }) .then(res => res.json()) .then(res => res.data);