Internal Structure
Class ShopQuery
ShopQuery
import {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
_getShopFields
Description: A function which returns an array of shop fields Read more: Extending Query controllers
Function processShop
processShop
import {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
ShopProvider
import {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
getContextValue
Description: 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?