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

  • 1.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53K
increased by5.72%
Maintainers
3
Weekly downloads
 
Created
Source

NOTE This link is included by default when using apollo-client so you don't need to add it to your link chain if using apollo-client.

Installation

npm install apollo-link-dedup --save

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 overridden by using the context on a per operation basis:

  • forceFetch: a true or false (defaults to false) to bypass deduplication per request
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 23 Feb 2018

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