savedSearchId on products or productVariants query.

Topic summary

Main issue: Passing a savedSearchId to Shopify Admin GraphQL queries for products or productVariants returns an error.

  • Behavior: When supplying savedSearchId = “gid://shopify/SavedSearch/1999798337641” to either products or productVariants queries, the API responds with “Error: invalid savedSearchId.” The same error occurs across both queries.

  • Context: The savedSearchId is retrieved via the productSavedSearches query (SavedSearch is a saved filter, and its ID is used to filter other queries). Queries define variables $query and $savedSearchId and include savedSearchId alongside query and first.

  • Evidence: Code snippets are central to understanding; both GET_PRODUCT_VARIANTS and GET_PRODUCTS queries are shown with the savedSearchId variable passed to the respective fields.

  • Status: No solution or workaround provided in the thread. The original poster followed up a year later noting the issue persists, suggesting either an unresolved bug or missing usage detail.

  • Outcome: Unresolved and open; key question remains whether the savedSearchId should work on these endpoints and, if so, how to format/use it correctly.

Summarized with AI on February 2. AI used: gpt-5.

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…