Internal Structure
Class ShopQuery
ShopQueryimport {ShopQuery} from '@scandipwa/shopify-shop/src/api/Shop.query.js'Description: * Query declarations for shop Read more: Query controller
Namespace: ShopifyShop/Api/Shop/Query/ShopQuery
Method _getShopFields
_getShopFieldsDescription: A function which returns an array of shop fields Read more: Extending Query controllers
Function processShop
processShopimport {processShop} from '@scandipwa/shopify-shop/src/api/Shop.processor.js'Description: Shop processor
Namespace: ShopifyShop/Api/Shop/Processor/processShop
🔮 Common extension point: Great place to add some "calculated" field into shop
{
'ShopifyShop/Api/Shop/Processor/processShop': {
'function': ([shop], callback) => {
callback(shop);
shop.translatedDescription = translate(shop.description);
}
}
}Class ShopProvider
ShopProviderimport {ShopProvider} from '@scandipwa/shopify-shop/src/context/Shop.provider.js'Description: Provider class for Shop Context. Used to make shop data available to every component in the app.
Namespace: ShopifyShop/Context/Shop/Provider/ShopProvider
Method getContextValue
getContextValueDescription: A function which returns an object that will be visible in the Shop Context
🔮 Common extension point: Add more fields to Shop Context outside of Shopify API
{
'ShopifyShop/Context/Shop/Provider/ShopProvider': {
'member-function': {
'getContextValue': (args, callback) => ({
...args,
supportedLanguages: ['EN', 'IT', 'ES']
})
}
}
}Last updated
Was this helpful?