Socket
Socket
Sign inDemoInstall

apollo-link-dedup

Package Overview
Dependencies
2
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-dedup


Version published
Maintainers
3
Install size
876 kB
Created

Readme

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 { createHttpLink } from "apollo-link-http";
import ApolloClient from "apollo-client";
import InMemoryCache from "apollo-cache-inmemory";

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

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

FAQs

Last updated on 09 Apr 2020

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc