shopify-ql

1.0.1 • Public • Published

A Shopify graphQl package to use the shopify graphQl api

It contains all the necessary function to make a headless e-commerce shop.

To start using the package you can import the needed solution for your project.

Import client side class

import ShopifyQl from "shopify-ql";

// your shopify information, make sure to use .env or other way to hide this.
export const shop = {
    url:"https://myShop.myshopify.com",
    clientToken:"front-token-here-please",
    adminToken:"admin-token-here-please"
}

const shopify = new ShopifyQl(adminKeys.shopUrl,adminKeys.clientToken)
// after this click shopify. and you will see all the functions available to use
// Example get the first 10 products
const products = await shopify.products(10)

Import admin class, it run on server side to keep your shop safe using the node-fetch package

import {ShopifyAdminQl} from "shopify-ql/admin.js";

// your shopify information, make sure to use .env or other way to hide this.
export const shop = {
    url:"https://myShop.myshopify.com",
    clientToken:"front-token-here-please",
    adminToken:"admin-token-here-please"
}

const shopify = new ShopifyAdminQl(adminKeys.shopUrl,adminKeys.clientToken)
// after this click shopify. and you will see all the functions available to use

// Example delete customer
const customerId='gid://shopify/Customer/1234353212'
const products = await shopify.customerDelete(customerId)

Readme

Keywords

Package Sidebar

Install

npm i shopify-ql

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

55.7 kB

Total Files

20

Last publish

Collaborators

  • anthony16t