Hi everyone, I have two questions regarding the Shopify Storefront/Admin GraphQL API:
- How can I efficiently collect all product options (like Size, Color, etc.) using GraphQL?
Currently, I loop through each product to collect the options, but this approach is inefficient. Is there a better way to retrieve a distinct list of all available product options across the store or a collection?
- Problem with combined filters returning no results:
When I use this query:
graphql
products(first: 250, query: "collection_id:648642101590 AND status:active AND title:cotton*") {
...
}
It returns no results, even though there are matching products.
However, using just collection_id
or just title:cotton*
works individually and returns results.
Is there a known issue with combining collection_id
and title
in a query, or is there a specific syntax I should be using?
Any help or guidance would be greatly appreciated!
1 Like
Hey @sezerium, there isn’t currently a query to list the options.
One workaround that may be a bit more efficient than looping through all products would be a bulk query for all products and then you could filter the jsonl file returned to filter for the unique values.
For the second problem, I recommend adding the search query debugging headers to your query to get a better look at how it’s being parsed. That tool is really great to help understand why some queries are working when others aren’t.
Let me know if any of those suggestions will work 
Thanks for the response!
For the first point, bulk queries aren’t ideal, especially since some merchants have thousands of products. In those cases, looping through all of them can become a serious performance issue. Ideally, we’d ask merchants to manually define available options in the app, but in many scenarios that’s not realistic. So having a way to get all product options via GraphQL is really necessary. Just hoping it for now.
As for the second point, I added debug info and even tried isolating parts of the query, but still no clue why combining collection_id
and title
returns empty results. The individual filters work fine, but when combined, the response is empty even though matching products clearly exist. Really confusing. I guess the graphql has filter issue, I will try to contact to Support if they can check it with the team
{
"data": {
"products": {
"pageInfo": {
"hasNextPage": false
},
"edges": []
}
},
"extensions": {
"cost": {
"requestedQueryCost": 574,
"actualQueryCost": 2,
"throttleStatus": {
"maximumAvailable": 2000.0,
"currentlyAvailable": 1998,
"restoreRate": 100.0
}
},
"search": [
{
"path": [
"products"
],
"query": "collection_id:648642101590 AND status:active AND title:cotton*",
"parsed": {
"and": [
{},
{
"field": "status",
"match_all": "active"
},
{
"field": "title",
"match_prefix": "cotton"
}
]
}
}
]
}
}
Thanks. I’ve added that as a feature request for our team 
What I find interesting is it’s not parsing the collection ID at all.
"parsed": {
"and": [
{},
{
"field": "status",
"match_all": "active"
},
{
"field": "title",
"match_prefix": "cotton"
}
]
}
I’ll test some of these on my end to try and replicate.
Are you using the storefront API or Admin API for this?
Thank you Kyle,
I use Admin Graphql to filter products.
Shop: stamp-variants-collection-demo.myshopify.com
Date: Thu, 05 Jun 2025 18:40:44 GMT
X-Request-ID: 57665de1-d685-4841-9d12-11badabe5795-1749148844
This is the query what I run
{
products(first: 250, query: "collection_id:648642101590 AND status:active AND title:cotton*") {
pageInfo {
hasNextPage
}
edges {
cursor
node {
id
title
collections(first: 250) {
nodes {
id
}
}
}
}
}
}
Hey! Thanks for sharing that.
I’ve been able to replicate this on my end as well. I’ve found that the issue seems to be specific to the wildcard argument combined with other fields. When you search on it’s own, it works fine, and when you exclude it, it works. Exact match for the title works too.
I’m looking further in to this and will report back with what I find 