Dalexhd

Untitled

Nov 24th, 2023
431
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. const shopify = require("@shopify/shopify-api");
  2.  
  3. // Load the access token as per instructions above
  4. const storefrontAccessToken = "";
  5. // Shop from which we're fetching data
  6. const shop = "";
  7.  
  8. // StorefrontClient takes in the shop url and the Storefront Access Token for that shop.
  9. const storefrontClient = new shopify.clients.Storefront({
  10. domain: shop,
  11. storefrontAccessToken,
  12. });
  13.  
  14. // Use client.query and pass your query as `data`
  15. const products = await storefrontClient.query({
  16. data: `{
  17. products (first: 3) {
  18. edges {
  19. node {
  20. id
  21. title
  22. }
  23. }
  24. }
  25. }`,
  26. });
  27.  
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment