Headless Server Developer Manual / Version 2010
Table Of ContentsOne way to query products is to retrieve a list of products as a part of a category or catalog query, or by navigating from a CMProductTeaser
or CMExternalProduct
content query to the corresponding product.
These kinds of queries will be discussed in the following sections.
A more straightforward way to retrieve a product is to query them by their external ID:
{ commerce { product(externalId: "sfcc:///catalog/product/25592211M", siteId: "sfra-en-gb") { name listPrice offerPrice locale } } }
Products may also be queried by their SEO segment or technical ID.
Client side Caching
Some existing graphql frameworks like Apollo do support client side caching. As caching usually requires a unique cache key, the 'externalId' of commerce objects is aliased additionally to the field 'id'.