shopify-storefront
Version:
Wrapper for the Shopify's Storefront API.
24 lines • 1.17 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShopifyClient = void 0;
const graphql_1 = require("../graphql");
const checkout_client_1 = __importDefault(require("./checkout/checkout-client"));
const products_client_1 = __importDefault(require("./products/products-client"));
const shop_client_1 = __importDefault(require("./shop/shop-client"));
class ShopifyClient {
constructor(settings) {
const { storeDomain, accessToken } = settings;
const endpoint = `https://${storeDomain}/api/2022-10/graphql.json`;
const graphql = new graphql_1.GraphQLClient(endpoint);
graphql.setHeader('X-Shopify-Storefront-Access-Token', accessToken);
this.checkout = new checkout_client_1.default(graphql);
this.products = new products_client_1.default(graphql);
this.shop = new shop_client_1.default(graphql);
}
}
exports.ShopifyClient = ShopifyClient;
exports.default = ShopifyClient;
//# sourceMappingURL=client.js.map