New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apollo-link-shopify-retry

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-shopify-retry

Easy setup for retrying rate limited request in Shopify's (Admin) GraphQL API.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
192
decreased by-39.43%
Maintainers
1
Weekly downloads
 
Created
Source

Easy setup for retrying rate limited request in Shopify's (Admin) GraphQL API.

Installation

For npm:

npm i apollo-link-shopify-retry

For yarn:

yarn add apollo-link-shopify-retry

Usage

When creating your client, inject this link as a middleware:

// client.js
import {
  ApolloClient,
  HttpLink,
  ApolloLink,
  InMemoryCache,
} from "@apollo/client";
import { createShopifyRetryLink } from "apollo-link-shopify-retry";

export const createClient = (shop, accessToken) => {
  const endpoint = new HttpLink({
    uri: `https://${shop}/admin/api/2021-04/graphql.json`,
  });
  const rateLimit = createShopifyRetryLink();

  const link = ApolloLink.from([
    rateLimit,
    endpoint,
  ]);

  return new ApolloClient({
    cache: new InMemoryCache(),
    link,
  });
};

Options

By default, we log the throttles to console.log. You can disable this by passing { debug: false } to createShopifyRetryLink.

Behavior

It utilizes @apollo/client/link/error. This link checks how much cost needs to be restored in order to perform a GraphQL operation, allows you to wait until the operation can succeed. If the operation exceeds the maximum allowed cost of your Shopify API, the error will still be raised.

Keywords

FAQs

Package last updated on 01 Feb 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc