Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

@originalfunko/shopify-collection-fetcher

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@originalfunko/shopify-collection-fetcher

This library returns all products or ids from a Shopify collection using the GraphQL endpoint. It automatically handles pagination.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
4
Created
Source

shopify-collection-fetcher

This library returns all products or ids from a Shopify collection using the GraphQL endpoint. It automatically handles pagination.

Usage:

Inside of your project, do:

yarn add @originalfunko/shopify-collection-fetcher

Simply include the library:

const shopifyCollectionFetcher = require('shopify-collection-fetcher');

Initialize your config settings:

shopifyCollectionFetcher.init({
    SHOPIFY_API_URI: '<API_URI>',
    SHOPIFY_API_TOKEN: '<API_TOKEN>',
});

Then call it as needed:

let productsResult = await shopifyCollectionFetcher.fetchIt(id);
let productIds = await shopifyCollectionFetcher.parseIt(id, productsResult);
products = products.concat(productIds);

Configuration:

Beyond the SHOPIFY_API_URI and SHOPIFY_API_TOKEN settings (which will inherit process.env.SHOPIFY_API_URI and process.env.SHOPIFY_API_TOKEN if available), here is the complete list of settings:

shopifyCollectionFetcher.init({
    SHOPIFY_API_URI: '<API_URI>',
    SHOPIFY_API_TOKEN: '<API_TOKEN>',
    SHOPIFY_API_RATE_LIMIT: 50,
    SHOPIFY_API_GRAPHQL_PRODUCTS: 20,
});

FAQs

Package last updated on 06 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts