A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Has anyone been able to get this to work?
I have a very simple GraphQL query that I am attempting;
export const GET_PRODUCT_VARIANTS = gql`query getProductVariants($query:String $savedSearchId:ID) {
productVariants(query:$query savedSearchId:$savedSearchId first:10) {
edges {
node {
id
title
sku
inventoryQuantity
price
compareAtPrice
displayName
product {
productType
vendor
}
}
}
}
}`;
export const GET_PRODUCTS = gql`query getProducts($query:String $savedSearchId:ID) {
products(query:$query first:15 savedSearchId:$savedSearchId) {
edges {
node {
id
title
productType
vendor
variants(first:5) {
edges {
node {
id
image {
originalSrc
}
sku
compareAtPrice
price
}
}
}
}
}
}
}`;
When supplying a savedSearchId variable of "gid://shopify/SavedSearch/1999798337641" to either query I get an error back;
`Error: invalid savedSearchId`
I'm grabbing this savedSearchId from the productSavedSearches graphQL query.
Does anyone know what I'm doing wrong?
It's been one year and this is still a problem. It's either a bug that hasn't been fixed or I'm still not seeing the solution...