savedSearchId on products or productVariants query.

savedSearchId on products or productVariants query.

ozzyonfire
Shopify Partner
49 2 17

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?

Reply 1 (1)

ozzyonfire
Shopify Partner
49 2 17

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...