Created
September 28, 2024 14:53
-
-
Save jaredkc/ff77624cc9d3240b23023ab15db5c3fc to your computer and use it in GitHub Desktop.
Shopify GraphQL collection query with product metafield
This file contains hidden or 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
query productCollection($handle: String!, $firstProducts: Int!, $metafield: String!) { | |
collectionByHandle(handle: $handle) { | |
id | |
title | |
productsCount { | |
count | |
} | |
products(first: $firstProducts) { | |
edges { | |
node { | |
title | |
handle | |
seo { | |
title | |
description | |
} | |
metafields(first: 1, keys: [$metafield]) { | |
edges { | |
node { | |
key | |
value | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment