Version 2.2.0. Normalizes GraphQL responses by flattening the object hierarchy into an array and deduplicating repeated values, reducing raw payload size (e.g., 76% reduction on Banter.fm) and improving JSON parse speed on mobile. Supports any GraphQL client (Apollo, Relay, etc.) via lossless crunch/uncrunch functions. Ships TypeScript types. Actively maintained.
npm install graphql-crunchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates crunching and lossless uncrunching of a GraphQL response object.
Always call uncrunch on the client to restore the original object.
Replace `import graphqlCrunch from 'graphql-crunch'` with `import { crunch, uncrunch } from 'graphql-crunch'`.Ensure the input object has no circular dependencies or use a custom replacer to remove cycles.
Upgrade Node.js to v12 or later.
Install via `npm install graphql-crunch` and use ESM import `import { crunch } from 'graphql-crunch'`.Use named import: `import { crunch } from 'graphql-crunch'`.No dependency data recorded yet.