All Release Notes
Added Product Projection Search to GraphQL API
18 August 2021
Composable Commerce
HTTP API
Enhancement
GraphQLSearchProduct catalog
ProductProjection Search can now be performed using the GraphQL API.
Changes:
- [GraphQL API] Added the following types to the GraphQL schema:
CategoryOrderHintProductSearch
,DimensionsProductSearch
,DiscountedProductSearchPriceValue
,ExistsFilterInput
,FacetResult
,FacetResultValue
,ImageProductSearch
,MissingFacetInput
,MissingFilterInput
,PriceSelectorInput
,ProductPriceSearch
,ProductProjection
,ProductProjectionSearchResult
,ProductSearchPriceTier
,ProductSearchVariant
,ProductSearchVariantAvailabilitiesResult
,ProductSearchVariantAvailability
,ProductSearchVariantAvailabilityWithChannel
,ProductSearchVariantAvailabilityWithChannels
,RangeCount
,RangeCountDouble
,RangeCountLong
,RangeElementInput
,RangeFacetInput
,RangeFacetResult
,RangeFilterInput
,RawProductSearchAttribute
,SearchFacetInput
,SearchFacetModelInput
,SearchFilterInput
,SearchFilterModelInput
,SearchKeywordProductSearch
,SearchKeywordsProductSearch
,SuggestTokenizerProductSearch
,CustomSuggestTokenizerProductSearch
,WhitespaceSuggestTokenizerProductSearch
,TermCount
,TermsFacetInput
,TermsFacetResult
,TreeFacetInput
,TreeFilterInput
,ValueCountFacetInput
,ValueFacetInput
,ValueFacetResult
,ValueFilterInput
. - [GraphQL API] Changed the
Query
type:- Added the
productProjectionSearch
field to theQuery
type.
- Added the
The following changes were introduced in terms of GraphQL SDL:
extend type Query {productProjectionSearch(locale: Locale, text: String, facets: [SearchFacetInput!]! = [], filters: [SearchFilterInput!]! = [], queryFilters: [SearchFilterInput!]! = [], facetFilters: [SearchFilterInput!]! = [], sorts: [String!]! = [], limit: Int! = 10, offset: Int! = 0, fuzzy: Boolean! = false, fuzzyLevel: Int, priceSelector: PriceSelectorInput, markMatchingVariant: Boolean! = false,"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"storeProjection: String,"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"localeProjection: [Locale!], staged: Boolean = false): ProductProjectionSearchResult!}type CategoryOrderHintProductSearch {categoryId: String!orderHint: String!}type DimensionsProductSearch {width: Int!height: Int!}type DiscountedProductSearchPriceValue {value: BaseMoney!discountRef: Reference!discount: ProductDiscount}input ExistsFilterInput {path: String!}interface FacetResult {type: String!}type FacetResultValue {facet: String!value: FacetResult!}type ImageProductSearch {url: String!dimensions: DimensionsProductSearch!label: String}input MissingFacetInput {path: String!alias: String}input MissingFilterInput {path: String!}input PriceSelectorInput {currency: Currency!country: CountrycustomerGroup: ReferenceInputchannel: ReferenceInputdate: Instant!}scalar Instanttype ProductPriceSearch {id: Stringvalue: BaseMoney!country: CountrycustomerGroup: CustomerGroupcustomerGroupRef: Referencechannel: ChannelchannelRef: ReferencevalidFrom: DateTimevalidUntil: DateTimediscounted: DiscountedProductSearchPriceValuetiers: [ProductSearchPriceTier!]custom: CustomFieldsType}type ProductProjection {id: String!version: Long!createdAt: DateTime!lastModifiedAt: DateTime!productTypeRef: Reference!productType: ProductTypeDefinitionname("String is defined for different locales. This argument specifies the desired locale."locale: Locale,"List of languages the client is able to understand, and which locale variant is preferred."acceptLanguage: [Locale!]): StringnameAllLocales: [LocalizedString!]!description("String is defined for different locales. This argument specifies the desired locale."locale: Locale,"List of languages the client is able to understand, and which locale variant is preferred."acceptLanguage: [Locale!]): StringdescriptionAllLocales: [LocalizedString!]slug("String is defined for different locales. This argument specifies the desired locale."locale: Locale,"List of languages the client is able to understand, and which locale variant is preferred."acceptLanguage: [Locale!]): StringslugAllLocales: [LocalizedString!]!categoryOrderHints: [CategoryOrderHintProductSearch!]!categoriesRef: [Reference!]!categories: [Category!]!searchKeywords: [SearchKeywordsProductSearch!]!metaTitle("String is defined for different locales. This argument specifies the desired locale."locale: Locale,"List of languages the client is able to understand, and which locale variant is preferred."acceptLanguage: [Locale!]): StringmetaTitleAllLocales: [LocalizedString!]metaKeywords("String is defined for different locales. This argument specifies the desired locale."locale: Locale,"List of languages the client is able to understand, and which locale variant is preferred."acceptLanguage: [Locale!]): StringmetaKeywordsAllLocales: [LocalizedString!]metaDescription("String is defined for different locales. This argument specifies the desired locale."locale: Locale,"List of languages the client is able to understand, and which locale variant is preferred."acceptLanguage: [Locale!]): StringmetaDescriptionAllLocales: [LocalizedString!]hasStagedChanges: Boolean!published: Boolean!masterVariant: ProductSearchVariant!variants: [ProductSearchVariant!]!taxCategoryRef: ReferencetaxCategory: TaxCategorystateRef: Referencestate: StatereviewRatingStatistics: ReviewRatingStatistics}type ProductProjectionSearchResult {offset: Int!count: Int!total: Int!results: [ProductProjection!]!facets: [FacetResultValue!]!}type ProductSearchPriceTier {minimumQuantity: Int!value: BaseMoney!}type ProductSearchVariant {id: Int!key: Stringsku: Stringprices: [ProductPriceSearch!]"Returns a single price based on the price selection rules."price(currency: Currency!, country: Country, customerGroupId: String, channelId: String, date: DateTime): ProductPriceSearchimages: [ImageProductSearch!]!assets: [Asset!]!availability: ProductSearchVariantAvailabilityWithChannels"This field contains raw attributes data"attributesRaw("""The names of the attributes to include.If neither `includeNames` nor `excludeNames` are provided, then all attributes are returned."""includeNames: [String!],"""The names of the attributes to exclude.If neither `includeNames` nor `excludeNames` are provided, then all attributes are returned."""excludeNames: [String!]): [RawProductSearchAttribute!]!}"Product variant availabilities"type ProductSearchVariantAvailabilitiesResult {limit: Intoffset: Inttotal: Int!results: [ProductSearchVariantAvailabilityWithChannel!]!}"Product variant availability"type ProductSearchVariantAvailability {isOnStock: Boolean!restockableInDays: IntavailableQuantity: Long}type ProductSearchVariantAvailabilityWithChannel {channelRef: Reference!channel: Channelavailability: ProductSearchVariantAvailability!}type ProductSearchVariantAvailabilityWithChannels {noChannel: ProductSearchVariantAvailabilitychannels("""The IDs of channels to include.If neither `includeChannelIds` nor `excludeChannelIds` are provided, then all channels are returned."""includeChannelIds: [String!],"""The IDs of channels to exclude.If neither `includeChannelIds` nor `excludeChannelIds` are provided, then all channels are returned."""excludeChannelIds: [String!], limit: Int, offset: Int): ProductSearchVariantAvailabilitiesResult!}interface RangeCount {type: String!}type RangeCountDouble implements RangeCount {from: Float!fromStr: String!to: Float!toStr: String!count: Int!productCount: InttotalCount: Int!total: Float!min: Float!max: Float!mean: Float!type: String!}type RangeCountLong implements RangeCount {from: Long!fromStr: String!to: Long!toStr: String!count: Int!productCount: InttotalCount: Int!total: Long!min: Long!max: Long!mean: Float!type: String!}input RangeElementInput {from: String!to: String!}input RangeFacetInput {path: String!ranges: [RangeElementInput!]!alias: StringcountProducts: Boolean! = false}type RangeFacetResult implements FacetResult {dataType: String!ranges: [RangeCount!]!type: String!}input RangeFilterInput {path: String!ranges: [RangeElementInput!]!}type RawProductSearchAttribute {name: String!value: Json!}input SearchFacetInput {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"model: SearchFacetModelInputstring: String}input SearchFacetModelInput {terms: TermsFacetInputvalue: ValueFacetInputrange: RangeFacetInputtree: TreeFacetInputvalueCount: ValueCountFacetInputmissing: MissingFacetInput}input SearchFilterInput {"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"model: SearchFilterModelInputstring: String}input SearchFilterModelInput {value: ValueFilterInputrange: RangeFilterInputmissing: MissingFilterInputexists: ExistsFilterInputtree: TreeFilterInput}type SearchKeywordProductSearch {text: String!suggestTokenizer: SuggestTokenizerProductSearch}type SearchKeywordsProductSearch {locale: Locale!searchKeywords: [SearchKeywordProductSearch!]!}interface SuggestTokenizerProductSearch {type: String!}type CustomSuggestTokenizerProductSearch implements SuggestTokenizerProductSearch {inputs: [String!]!type: String!}type WhitespaceSuggestTokenizerProductSearch implements SuggestTokenizerProductSearch {type: String!}type TermCount {term: String!count: Int!productCount: Int}input TermsFacetInput {path: String!alias: StringcountProducts: Boolean! = false}type TermsFacetResult implements FacetResult {dataType: String!missing: Int!total: Int!other: Int!terms: [TermCount!]!type: String!}input TreeFacetInput {path: String!rootValues: [String!]!subTreeValues: [String!]!alias: StringcountProducts: Boolean! = false}input TreeFilterInput {path: String!rootValues: [String!]!subTreeValues: [String!]!}input ValueCountFacetInput {path: String!alias: String}input ValueFacetInput {path: String!values: [String!]!alias: StringcountProducts: Boolean! = false}type ValueFacetResult implements FacetResult {count: Int!productCount: Inttype: String!}input ValueFilterInput {path: String!values: [String!]!}