UNPKG

usimple-saleor-sdk

Version:

This package contains all queries and mutations that are used in our sample storefront. It can be used for semi-custom or fully-custom (with ability to extend existing queries) storefront solutions.

22 lines 1.13 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProductList = void 0; const BaseList_1 = __importDefault(require("../../helpers/BaseList")); const products_1 = require("../../queries/products"); class ProductList extends BaseList_1.default { constructor() { super(...arguments); this.getPageInfo = result => { var _a; return (_a = result.data.products) === null || _a === void 0 ? void 0 : _a.pageInfo; }; this.getTotalCount = result => { var _a; return (_a = result.data.products) === null || _a === void 0 ? void 0 : _a.totalCount; }; this.mapQueryData = data => { var _a; return (_a = data.products) === null || _a === void 0 ? void 0 : _a.edges.map(({ node }) => node); }; this.query = (variables) => this.client.query({ query: products_1.productList, variables, }); } } exports.ProductList = ProductList; //# sourceMappingURL=ProductList.js.map