Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apollo-link-retry

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-retry

Retry Apollo Link for GraphQL Network Stack

  • 0.6.1-beta.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
79K
increased by6.29%
Maintainers
3
Weekly downloads
 
Created
Source

Purpose

An Apollo Link to allow multiple attempts when an operation has failed. One such use case is to try a request while a network connection is offline and retry until it comes back online. Retry's can vary based on operation through the configuration of the link.

Installation

npm install apollo-link-retry --save

To use this package in a web browser or mobile app, you'll need a build system capable of loading NPM packages on the client. Some common choices include Browserify, Webpack, and Meteor +1.3.

Usage

import RetryLink from "apollo-link-retry";

const link = new RetryLink();

Options

Retry Link takes an object with three options on it to customize the behavoir of the link.

namevaluedefaultrequired
maxnumber or Operation => number10false
delaynumber or Operation => number300false
interval(delay: number, count: number) => numberdelay => delayfalse
import RetryLink from "apollo-link-retry"

const max = (operation) => operation.getContext().max
const delay = 5000;
const interval = (delay, count) => {
  if (count > 5) return 10,000;
  return delay;
}

const link = new RetryLink({
  max,
  delay,
  interval
});

Context

The Retry Link does not use the context for anything

FAQs

Package last updated on 25 Sep 2017

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