Skip to content

brydonm/shopify-graphql-bulk-throttler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopify GraphQL Bulk Throttler

Run bulk throttled requests through the Shopify GraphQL API.

Examples

import ShopifyGraphqlBulkThrottler from "shopify-graphql-bulk-throttler";

const throttler = new ShopifyGraphqlBulkThrottler(graphqlClient);

const myFunction = () => {
  throttler.setOnQueueEmpty(() => {
    console.log("All requests have been processed");

    throttler.stopRestore(); // stop restoring bucket points once we're finished
  });

  throttler.addToQueue({
    query: `query { shop { name } }`,
    variables: {},
  });

  // or

  throttler.addToQueue([
    {
      query: `query { shop { name } }`,
      variables: {},
    },
    {
      query: `query { shop { name } }`,
      variables: {},
    },
  ]);
};

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published