A GraphQL response deduplicator that removes duplicate entities from GraphQL responses to reduce payload size. Version 2.0.6 is the latest stable release; maintenance is sporadic. It works by using __typename and id fields to identify duplicate resources and strips the body of duplicates. It differentiates from other compression techniques by being lossless for normalized caches like Apollo Client. Requires Node >6.0.0.
npm install graphql-deduplicatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Server-side usage: intercept the GraphQL response and apply compress() before sending to client.
Ensure all queries include __typename and id fields, or configure Apollo Client's addTypename: true.
Consider alternatives like apollo-link-compression or manual deduplication.
Use a bundler that supports commonjs or add 'type: module' to your project.
Run 'npm install graphql-deduplicator' or 'yarn add graphql-deduplicator'
Use 'import { compress } from 'graphql-deduplicator'' instead of 'import compress from ...'Add __typename to your query or enable Apollo Client's addTypename: true
No dependency data recorded yet.