Skip to content

Instantly share code, notes, and snippets.

@richardsweeney
Created September 23, 2025 11:28
Show Gist options
  • Save richardsweeney/dc6ae9cd01ef968dc5a824883bdac3f8 to your computer and use it in GitHub Desktop.
Save richardsweeney/dc6ae9cd01ef968dc5a824883bdac3f8 to your computer and use it in GitHub Desktop.
const accessToken = "ACCESS_TOKEN_HERE";
const query = `
query {
collections(first: 50) {
edges {
node {
id
title
handle
description
descriptionHtml
productsCount {
count
}
image {
url(transform: {maxWidth: 400})
altText
}
seo {
title
description
}
}
}
}
}
`;
fetch(
`https://paper-collective-com.myshopify.com/admin/api/2023-10/graphql.json`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Shopify-Storefront-Access-Token": accessToken,
},
body: JSON.stringify({ query }),
},
)
.then((response) => response.json())
.then((data) => console.dir(data, { depth: null }));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment