All Release Notes

Added filter for matching Product Variants in Product Projection Search in GraphQL

9 January 2025
Composable Commerce
HTTP API
Enhancement
Product catalogGraphQL

You can now control that only Product Variants that match the productProjectionSearch GraphQL query are included in the response. Previously, you had to filter for matching Product Variants on the client side.

Changes:

  • [GraphQL API] Added the onlyMatching argument to the ProductProjection.variants and the ProductProjection.allVariants field.

The following changes were introduced in terms of GraphQL SDL:

extend type ProductProjection {
"Fetch all variants, excluding the master variant. If `onlyMatching` is used, filter this list based on the the search query."
variants(onlyMatching: Boolean): [ProductSearchVariant!]!
"Fetch all variants, including the master variant in first position. If `onlyMatching` is used, filter this list based on the the search query."
allVariants(onlyMatching: Boolean): [ProductSearchVariant!]!
}