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

apollo-link-dedup

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-dedup

Deduplicates queries that are currently on the wire

  • 0.4.1-beta.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52K
decreased by-11.22%
Maintainers
3
Weekly downloads
 
Created
Source

Purpose

An Apollo Link to deduplicate matching requests before making a request.

NOTE This link is included by default when using apollo-client.

Installation

npm install apollo-link-dedup --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 DedupLink from "apollo-link-dedup";

const link = new DedupLink();

Options

The Dedup Link does not take any options when creating the link.

Context

The Dedup Link can be overriden by using the context on a per opearation basis:

namevaluedefaultrequired
forceFetchbooleanfalsefalse
import Link from "apollo-link-http";
import ApolloClient from "apollo-client";
import InMemoryCache from "apollo-cache-inmemory";

const client = new ApolloClient({
  link: new Link({ uri: "/graphql" }),
  cache: new InMemoryCache()
});

// a query with apollo-client that will not be deduped
client.query({
  query: MY_QUERY,
  context: {
    forceFetch: true
  }
})

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