Created
January 19, 2023 17:03
-
-
Save josephbona/3e18f64f45b14893729e317445754f3d to your computer and use it in GitHub Desktop.
Pink Whitney Products
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Graphql query | |
const gql = ` | |
{ | |
collection(handle: "the-pink-whitney") { | |
products(first: 5, sortKey: BEST_SELLING) { | |
edges { | |
node { | |
title | |
handle | |
description | |
images(first: 1) { | |
edges { | |
node { | |
originalSrc | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
` | |
// Base64 encoded query | |
const base64EncodedGql = 'ewogIGNvbGxlY3Rpb24oaGFuZGxlOiAidGhlLXBpbmstd2hpdG5leSIpIHsKICAgIHByb2R1Y3RzKGZpcnN0OiA1LCBzb3J0S2V5OiBCRVNUX1NFTExJTkcpIHsKICAgICAgZWRnZXMgewogICAgICAgIG5vZGUgewogICAgICAgICAgdGl0bGUKICAgICAgICAgIGhhbmRsZQogICAgICAgICAgZGVzY3JpcHRpb24KICAgICAgICAgIGltYWdlcyhmaXJzdDogMSkgewogICAgICAgICAgICBlZGdlcyB7CiAgICAgICAgICAgICAgbm9kZSB7CiAgICAgICAgICAgICAgICBvcmlnaW5hbFNyYwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQogICAgfQogIH0KfQ==' | |
// GET Request | |
GET `https://union.barstoolsports.com/v2/shopify-storefront?query=${base64EncodedGql}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment