1.0.1 • Published 2 years ago

shopify-ql v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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)
1.0.1

2 years ago

1.0.0-next1

2 years ago

1.0.0-next

2 years ago

1.0.0

2 years ago