import { useCategoryFactory , Context , UseCategoryFactoryParams , Logger , } from '@vue-storefront/core' ; import { Category , CategoryListQueryVariables , } from '@vue-storefront/magento-api' ; const factoryParams = { categorySearch : async ( context , params ) => { Logger . debug ( '[Magento]: List available categories' , { params } ) ; const { data } = await context . $magento . api . categoryList ( params ) ; Logger . debug ( '[Result]:' , { data } ) ; return data . categories . items ; } , } ; export default useCategoryFactory < Category , CategoryListQueryVariables > ( factoryParams ) ;