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.16 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CollectionList = void 0; const BaseList_1 = __importDefault(require("../../helpers/BaseList")); const collections_1 = require("../../queries/collections"); class CollectionList extends BaseList_1.default { constructor() { super(...arguments); this.getPageInfo = result => { var _a; return (_a = result.data.collections) === null || _a === void 0 ? void 0 : _a.pageInfo; }; this.getTotalCount = result => { var _a; return (_a = result.data.collections) === null || _a === void 0 ? void 0 : _a.totalCount; }; this.mapQueryData = data => { var _a; return (_a = data.collections) === null || _a === void 0 ? void 0 : _a.edges.map(({ node }) => node); }; this.query = (variables) => this.client.query({ query: collections_1.collections, variables, }); } } exports.CollectionList = CollectionList; //# sourceMappingURL=CollectionList.js.map