Skip to content

CatalogModule

Module in @evolve-framework/medusa

The catalog, served from Medusa: products, categories, category pages and productSearch, answering the shared schema unchanged.

import { CatalogModule } from "@evolve-framework/medusa/modules";

Serves the Catalog part of the GraphQL API: categories, product, productCategoryPageByPath, products, productsBySku, productSearch, productSearchMaxResults, productSearchSuggestions, productSortOrders.

new CatalogModule(options?: CatalogModuleOptions)
OptionTypeDescription
search?ProductSearchProvider

Where product search is answered from. Omitted, Medusa's product listing answers it — which needs no search infrastructure but returns no facet counts, because Medusa's product querying does not compute them.

More

An engine plugs in here by wrapping its query adapter. Medusa's own Search module is one of them, and needs the index @evolve-framework/medusa-plugin-search declares:

new CatalogModule({
	search: new ProductSearchProvider({
		adapter: new MedusaSearchQueryAdapter({ clientFactory }),
	}),
});

MeilisearchQueryAdapter plugs in the same way.

specifications?SpecificationOptions

How this catalogue's product attributes should be presented.

More

Every field here is a decision about one shop's merchandising, so it is passed in by the application rather than defaulted by the framework: which attribute is the brand, which specifications lead, and which are worth filtering on differ per project and per season.

Read-side on purpose. Making any of it import-side would put a full catalogue re-import between an editor and a reordered specification table.

Omitted, a catalogue exposes its specifications unhighlighted rather than guessing — which is the honest answer when nobody has said.

There is deliberately no facet list here. Which facets a listing offers is derived from what the results actually contain, not enumerated: see the query adapter's wildcard request.

stock?StockOptions

How a variant's stock is worded to a buyer.

dimensionTypes?DimensionTypes

Which product options a picker shows as colour swatches or images, by option title, such as { color: "color" }. Every other option is text.

listingFacets?ListingFacetOptions

Without search, which specifications a listing offers as facets besides the product options, and the labels attribute facets show.

Extends AbstractModule<unknown>.

The same module on commercetools and sfcc.