{"_id":"graphql-deduplicator","_rev":"234344","name":"graphql-deduplicator","description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","dist-tags":{"latest":"2.0.6"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"time":{"modified":"2021-06-03T15:48:59.000Z","created":"2017-05-19T14:25:42.153Z","2.0.6":"2020-07-11T13:47:32.425Z","2.0.5":"2019-07-22T15:09:29.524Z","2.0.4":"2019-07-11T15:27:02.453Z","2.0.3":"2019-05-28T15:08:30.437Z","2.0.2":"2018-10-27T09:32:02.785Z","2.0.1":"2018-02-14T11:15:53.005Z","2.0.0":"2018-02-14T11:10:25.799Z","1.1.0":"2017-05-19T14:35:45.491Z","1.0.0":"2017-05-19T14:25:42.153Z"},"users":{"bsdllc":true},"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"versions":{"2.0.6":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"require":["@babel/register"]},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"@babel/cli":"^7.10.3","@babel/core":"^7.10.3","@babel/plugin-transform-flow-strip-types":"^7.10.1","@babel/plugin-transform-modules-commonjs":"^7.10.1","@babel/preset-env":"^7.10.3","@babel/preset-flow":"^7.10.1","@babel/register":"^7.10.3","ava":"^3.9.0","babel-plugin-istanbul":"^6.0.0","babel-plugin-tailcall-optimization":"^2.0.0","coveralls":"^3.1.0","eslint":"^7.3.0","eslint-config-canonical":"^20.0.6","flow-bin":"^0.127.0","flow-copy-source":"^2.0.9","husky":"^4.2.5","nyc":"^15.1.0","semantic-release":"^17.1.0"},"engines":{"node":">6.0.0"},"husky":{"hooks":{"pre-commit":"npm run lint && npm run test && npm run build"}},"keywords":["apollo","compression","deduplicator","graphql","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["@babel/register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"2.0.6","dependencies":{},"gitHead":"c4b9002517eaa65a4241d200fb017d9502a98df9","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@2.0.6","_nodeVersion":"10.18.0","_npmVersion":"6.14.6","dist":{"shasum":"83ba9225235531de7be47fdf9fa6d6395d48565c","size":7210,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-2.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-2.0.6.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator_2.0.6_1594475252300_0.581646959745292"},"_hasShrinkwrap":false,"publish_time":1594475252425,"_cnpm_publish_time":1594475252425},"2.0.5":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"require":["@babel/register"]},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-transform-flow-strip-types":"^7.0.0","@babel/plugin-transform-modules-commonjs":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/register":"^7.0.0","ava":"^1.4.1","babel-plugin-istanbul":"^5.1.4","babel-plugin-tailcall-optimization":"^2.0.0","coveralls":"^3.0.3","eslint":"^5.16.0","eslint-config-canonical":"^17.1.0","flow-bin":"^0.98.1","flow-copy-source":"^2.0.6","husky":"^2.3.0","nyc":"^14.1.1","semantic-release":"^15.13.12"},"engines":{"node":">6.0.0"},"husky":{"hooks":{"pre-commit":"npm run lint && npm run test && npm run build"}},"keywords":["apollo","compression","deduplicator","graphql","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["@babel/register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"2.0.5","dependencies":{},"gitHead":"309ea5ba2b8177f1c19874621631f8fb947c1354","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@2.0.5","_nodeVersion":"9.11.2","_npmVersion":"6.10.0","dist":{"shasum":"fab59d8a4f8127e010122784638cfc8afc815a9c","size":7109,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-2.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-2.0.5.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator_2.0.5_1563808169318_0.6987649743481048"},"_hasShrinkwrap":false,"publish_time":1563808169524,"_cnpm_publish_time":1563808169524},"2.0.4":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"require":["@babel/register"]},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-transform-flow-strip-types":"^7.0.0","@babel/plugin-transform-modules-commonjs":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/register":"^7.0.0","ava":"^1.4.1","babel-plugin-istanbul":"^5.1.4","babel-plugin-tailcall-optimization":"^2.0.0","coveralls":"^3.0.3","eslint":"^5.16.0","eslint-config-canonical":"^17.1.0","flow-bin":"^0.98.1","flow-copy-source":"^2.0.6","husky":"^2.3.0","nyc":"^14.1.1","semantic-release":"^15.13.12"},"engines":{"node":">6.0.0"},"husky":{"hooks":{"pre-commit":"npm run lint && npm run test && npm run build"}},"keywords":["apollo","compression","deduplicator","graphql","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["@babel/register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"2.0.4","dependencies":{"is-plain-object":"^3.0.0"},"gitHead":"97e9e7fb8c462408403f373e2dde05f6de3708bf","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@2.0.4","_nodeVersion":"9.11.2","_npmVersion":"6.10.0","dist":{"shasum":"5425250164af7579a7d15848a990732f3bd10b44","size":6922,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-2.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-2.0.4.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator_2.0.4_1562858822364_0.03651857383714763"},"_hasShrinkwrap":false,"publish_time":1562858822453,"_cnpm_publish_time":1562858822453},"2.0.3":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"require":["@babel/register"]},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/plugin-transform-flow-strip-types":"^7.0.0","@babel/plugin-transform-modules-commonjs":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-flow":"^7.0.0","@babel/register":"^7.0.0","ava":"^1.4.1","babel-plugin-istanbul":"^5.1.4","babel-plugin-tailcall-optimization":"^2.0.0","coveralls":"^3.0.3","eslint":"^5.16.0","eslint-config-canonical":"^17.1.0","flow-bin":"^0.98.1","flow-copy-source":"^2.0.6","husky":"^2.3.0","nyc":"^14.1.1","semantic-release":"^15.13.12"},"engines":{"node":">6.0.0"},"husky":{"hooks":{"pre-commit":"npm run lint && npm run test && npm run build"}},"keywords":["apollo","compression","deduplicator","graphql","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["@babel/register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"2.0.3","gitHead":"d1c4d2b70250ba5627293993099a89739c2cd7c6","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@2.0.3","_nodeVersion":"9.11.2","_npmVersion":"6.9.0","dist":{"shasum":"25fff57ebe1611a256dff0533b34bc68ecf8ead8","size":6752,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-2.0.3.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator_2.0.3_1559056110263_0.7239181178687595"},"_hasShrinkwrap":false,"publish_time":1559056110437,"_cnpm_publish_time":1559056110437},"2.0.2":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"ava":"^0.25.0","babel-cli":"^6.26.0","babel-plugin-istanbul":"^4.1.5","babel-plugin-tailcall-optimization":"^1.0.12","babel-plugin-transform-es2015-modules-commonjs":"^6.26.0","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","coveralls":"^3.0.0","eslint":"^4.17.0","eslint-config-canonical":"^9.3.2","flow-bin":"^0.65.0","flow-copy-source":"^1.3.0","husky":"^0.14.3","nyc":"^11.4.1","semantic-release":"^12.4.1"},"engines":{"node":">6.0.0"},"keywords":["graphql","apollo","deduplicator","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["babel-register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","precommit":"npm run lint && npm run test && npm run build","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"2.0.2","gitHead":"e4ce3d4d83af04cefe5f6bb30c7e1714ff7ade69","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@2.0.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.2","_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"dist":{"shasum":"d8608161cf6be97725e178df0c41f6a1f9f778f3","size":6520,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-2.0.2.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator_2.0.2_1540632722632_0.05488764172734162"},"_hasShrinkwrap":false,"publish_time":1540632722785,"_cnpm_publish_time":1540632722785},"2.0.1":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"ava":"^0.25.0","babel-cli":"^6.26.0","babel-plugin-istanbul":"^4.1.5","babel-plugin-tailcall-optimization":"^1.0.12","babel-plugin-transform-es2015-modules-commonjs":"^6.26.0","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","coveralls":"^3.0.0","eslint":"^4.17.0","eslint-config-canonical":"^9.3.2","flow-bin":"^0.65.0","flow-copy-source":"^1.3.0","husky":"^0.14.3","nyc":"^11.4.1","semantic-release":"^12.4.1"},"engines":{"node":">6.0.0"},"keywords":["graphql","apollo","deduplicator","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["babel-register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","precommit":"npm run lint && npm run test && npm run build","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"2.0.1","gitHead":"48080d0fef3b6b78b57303723c40643155be0db8","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@2.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"dist":{"shasum":"20c6b39e3a6f096b46dfc8491432818739c0ee37","size":6328,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-2.0.1.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator_2.0.1_1518606952367_0.9661714989915544"},"_hasShrinkwrap":false,"publish_time":1518606953005,"_cnpm_publish_time":1518606953005},"2.0.0":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"ava":"^0.25.0","babel-cli":"^6.26.0","babel-plugin-istanbul":"^4.1.5","babel-plugin-tailcall-optimization":"^1.0.12","babel-plugin-transform-es2015-modules-commonjs":"^6.26.0","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-env":"^1.6.1","babel-register":"^6.26.0","coveralls":"^3.0.0","eslint":"^4.17.0","eslint-config-canonical":"^9.3.2","flow-bin":"^0.65.0","flow-copy-source":"^1.3.0","husky":"^0.14.3","nyc":"^11.4.1","semantic-release":"^12.4.1"},"engines":{"node":">6.0.0"},"keywords":["graphql","apollo","deduplicator","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["babel-register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","precommit":"npm run lint && npm run test && npm run build","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"2.0.0","gitHead":"91975e9d4d1e83ebe296672fe2e567cdb6ddb981","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"dist":{"shasum":"363732480f2300968078f593331a144a133276ae","size":6327,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-2.0.0.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator_2.0.0_1518606625105_0.4553171579159083"},"_hasShrinkwrap":false,"publish_time":1518606625799,"_cnpm_publish_time":1518606625799},"1.1.0":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"ava":"^0.19.1","babel-cli":"^6.24.1","babel-plugin-istanbul":"^4.1.1","babel-plugin-tailcall-optimization":"^1.0.11","babel-plugin-transform-es2015-modules-commonjs":"^6.24.1","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-env":"^1.4.0","babel-register":"^6.24.1","coveralls":"^2.13.0","eslint":"^3.19.0","eslint-config-canonical":"^8.1.1","flow-bin":"^0.44.0","flow-copy-source":"^1.1.0","husky":"^0.13.3","nyc":"^10.2.0","semantic-release":"^6.3.6"},"engines":{"node":">6.0.0"},"keywords":["graphql","apollo","deduplicator","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["babel-register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","precommit":"npm run lint && npm run test && npm run build","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"1.1.0","gitHead":"a7e34525e430682f6c899b6beb6835070aab5b37","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@1.1.0","_shasum":"20a1d04a8f54a1504e02ed61a5586f90d6d501df","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"dist":{"shasum":"20a1d04a8f54a1504e02ed61a5586f90d6d501df","size":5311,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-1.1.0.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator-1.1.0.tgz_1495204544554_0.4994903749320656"},"directories":{},"publish_time":1495204545491,"_hasShrinkwrap":false,"_cnpm_publish_time":1495204545491},"1.0.0":{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"ava":{"babel":{"babelrc":true},"require":"babel-register"},"description":"A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.","devDependencies":{"ava":"^0.19.1","babel-cli":"^6.24.1","babel-plugin-istanbul":"^4.1.1","babel-plugin-tailcall-optimization":"^1.0.11","babel-plugin-transform-es2015-modules-commonjs":"^6.24.1","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-preset-env":"^1.4.0","babel-register":"^6.24.1","coveralls":"^2.13.0","eslint":"^3.19.0","eslint-config-canonical":"^8.1.1","flow-bin":"^0.44.0","flow-copy-source":"^1.1.0","husky":"^0.13.3","nyc":"^10.2.0","semantic-release":"^6.3.6"},"engines":{"node":">6.0.0"},"keywords":["graphql","apollo","deduplicator","normalizer"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"graphql-deduplicator","nyc":{"include":["src/**/*.js"],"instrument":false,"reporter":["text-lcov"],"require":["babel-register"],"sourceMap":false},"repository":{"type":"git","url":"git+https://github.com/gajus/graphql-deduplicator.git"},"scripts":{"build":"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","lint":"eslint ./src ./test && flow","precommit":"npm run lint && npm run test && npm run build","test":"NODE_ENV=test nyc --reporter=text ava --verbose --serial"},"version":"1.0.0","gitHead":"b725d1e99cc503945c38fda7a0064c16bd2e0114","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","_id":"graphql-deduplicator@1.0.0","_shasum":"1400623d7b0928d646beb817588934649583daeb","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.9.0","_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"dist":{"shasum":"1400623d7b0928d646beb817588934649583daeb","size":5316,"noattachment":false,"key":"/graphql-deduplicator/-/graphql-deduplicator-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/graphql-deduplicator/download/graphql-deduplicator-1.0.0.tgz"},"maintainers":[{"name":"gajus","email":"gk@anuary.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-deduplicator-1.0.0.tgz_1495203941164_0.29239005013369024"},"directories":{},"publish_time":1495203942153,"_hasShrinkwrap":false,"_cnpm_publish_time":1495203942153}},"readme":"# graphql-deduplicator\n\n[![GitSpo Mentions](https://gitspo.com/badges/mentions/gajus/graphql-deduplicator?style=flat-square)](https://gitspo.com/mentions/gajus/graphql-deduplicator)\n[![Travis build status](http://img.shields.io/travis/gajus/graphql-deduplicator/master.svg?style=flat-square)](https://travis-ci.org/gajus/graphql-deduplicator)\n[![Coveralls](https://img.shields.io/coveralls/gajus/graphql-deduplicator.svg?style=flat-square)](https://github.com/gajus/graphql-deduplicator)\n[![NPM version](http://img.shields.io/npm/v/graphql-deduplicator.svg?style=flat-square)](https://www.npmjs.org/package/graphql-deduplicator)\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n\nA GraphQL response deduplicator.\n\nRemoves duplicate entities from the GraphQL response.\n\n- [graphql-deduplicator](#graphql-deduplicator)\n  - [Client support](#Client-support)\n  - [How does it work?](#How-does-it-work)\n  - [Motivation](#Motivation)\n  - [Real-life example](#Real-life-example)\n  - [Usage](#Usage)\n    - [Server-side](#Server-side)\n    - [Client-side](#Client-side)\n      - [Example usage with `apollo-client`](#Example-usage-with-apollo-client)\n      - [Example usage with `apollo-boost`](#Example-usage-with-apollo-boost)\n  - [Best practices](#Best-practices)\n    - [Enable compression conditionally](#Enable-compression-conditionally)\n      - [Example using with Apollo Server](#Example-using-with-Apollo-Server)\n\n## Client support\n\n`graphql-deduplicator` works with any GraphQL client that appends `__typename` and `id` fields to every resource. If your client automatically does not request `__typename` and `id` fields, these fields can be specified in your GraphQL query.\n\n`graphql-deduplicator` has been tested with [`apollo-client`](https://github.com/apollographql/apollo-client).\n\n## How does it work?\n\n`__typename` and an `id` values are used to construct a resource identifier. The resource identifier is used to [normalize data](http://dev.apollodata.com/core/how-it-works.html#normalize). As a result, when GraphQL API response contains a resource with a repeating identifier, the `apollo-client` is going to read only the first instance of the resource and ignore duplicate entities. `graphql-deduplicator` strips body (fields other than `__datatype` and `id`) from all the duplicate entities.\n\n## Motivation\n\n`graphql-deduplicator` is designed to reduce the GraphQL response size by removing body of duplicate entities. This allows to make queries that return large datasets of repeated data without worrying about the cost of the response body size, time it takes to parse the response or the memory the reconstructed object will consume.\n\n## Real-life example\n\nConsider the following schema:\n\n```graphql\ninterface Node {\n  id: ID!\n}\n\ntype Movie implements Node {\n  id: ID!\n  name: String!\n  synopsis: String!\n}\n\ntype Event implements Node {\n  id: ID!\n  movie: Movie!\n  date: String!\n  time: String!\n}\n\ntype Query {\n  events (\n    date: String\n  ): [Event!]!\n}\n\n```\n\nUsing this schema, you can query events for a particular date, e.g.\n\n```graphql\n{\n  events (date: \"2017-05-19\") {\n    __typename\n    id\n    date\n    time\n    movie {\n      __typename\n      id\n      name\n      synopsis\n    }\n  }\n}\n\n```\n\nNote: If you are using `apollo-client`, then you do not need to include `__typename` when constructing the query.\n\nThe result of the above query will contain a lot of duplicate information.\n\n```json\n{\n  \"data\": {\n    \"events\": [\n      {\n        \"__typename\": \"Event\",\n        \"id\": \"1669971\",\n        \"date\": \"2017-05-19\",\n        \"time\": \"17:25\",\n        \"movie\": {\n          \"__typename\": \"Movie\",\n          \"id\": \"1198359\",\n          \"name\": \"King Arthur: Legend of the Sword\",\n          \"synopsis\": \"When the child Arthur’s father is murdered, Vortigern, Arthur’s uncle, seizes the crown. Robbed of his birthright and with no idea who he truly is, Arthur comes up the hard way in the back alleys of the city. But once he pulls the sword Excalibur from the stone, his life is turned upside down and he is forced to acknowledge his true legacy... whether he likes it or not.\"\n        }\n      },\n      {\n        \"__typename\": \"Event\",\n        \"id\": \"1669972\",\n        \"date\": \"2017-05-19\",\n        \"time\": \"20:30\",\n        \"movie\": {\n          \"__typename\": \"Movie\",\n          \"id\": \"1198359\",\n          \"name\": \"King Arthur: Legend of the Sword\",\n          \"synopsis\": \"When the child Arthur’s father is murdered, Vortigern, Arthur’s uncle, seizes the crown. Robbed of his birthright and with no idea who he truly is, Arthur comes up the hard way in the back alleys of the city. But once he pulls the sword Excalibur from the stone, his life is turned upside down and he is forced to acknowledge his true legacy... whether he likes it or not.\"\n        }\n      },\n      // ...\n    ]\n  }\n}\n\n```\n\nI've run into this situation when building https://applaudience.co.uk. A query retrieving 300 events produced a response of 1.5MB. When gziped, that number dropped to 100KB. However, the problem is that upon receiving the response, the browser needs to parse the entire JSON document. Parsing 1.5MB JSON string is (a) time consuming and (b) memory expensive.\n\nThe good news is that we do not need to return body of duplicate records (see [How does it work?](#how-does-it-work)). For all duplicate records we only need to return `__typename` and `id`. This information is enough for `apollo-client` to identify the resource as duplicate and skip it. In case when a response includes large and often repeated fragments, this will reduce the response size 10x, 100x or more times.\n\nIn case of the earlier example, the response becomes:\n\n```json\n{\n  \"data\": {\n    \"events\": [\n      {\n        \"__typename\": \"Event\",\n        \"id\": \"1669971\",\n        \"date\": \"2017-05-19\",\n        \"time\": \"17:25\",\n        \"movie\": {\n          \"__typename\": \"Movie\",\n          \"id\": \"1198359\",\n          \"name\": \"King Arthur: Legend of the Sword\",\n          \"synopsis\": \"When the child Arthur’s father is murdered, Vortigern, Arthur’s uncle, seizes the crown. Robbed of his birthright and with no idea who he truly is, Arthur comes up the hard way in the back alleys of the city. But once he pulls the sword Excalibur from the stone, his life is turned upside down and he is forced to acknowledge his true legacy... whether he likes it or not.\"\n        }\n      },\n      {\n        \"__typename\": \"Event\",\n        \"id\": \"1669972\",\n        \"date\": \"2017-05-19\",\n        \"time\": \"20:30\",\n        \"movie\": {\n          \"__typename\": \"Movie\",\n          \"id\": \"1198359\"\n        }\n      },\n      // ...\n    ]\n  }\n}\n\n```\n\nThe `synopsis` and `name` fields have been removed from the duplicate `Movie` entity.\n\n## Usage\n\n### Server-side\n\nYou need to format the final result of the query. If you are using [`graphql-server`](https://github.com/apollographql/graphql-server), configure `formatResponse`, e.g.\n\n```js\nimport express from 'express';\nimport {\n  graphqlExpress\n} from 'graphql-server-express';\nimport {\n  deflate\n} from 'graphql-deduplicator';\n\nconst app = express();\n\napp.use('/graphql', graphqlExpress(() => {\n  return {\n    formatResponse: (response) => {\n      if (response.data && !response.data.__schema) {\n        return deflate(response);\n      }\n\n      return response;\n    }\n  };\n}));\n\napp.listen(3000);\n\n```\n\n### Client-side\n\n#### Example usage with `apollo-client`\n\nYou need to modify the server response before it is processed by the GraphQL client. If you are using [`apollo-client`](https://github.com/apollographql/apollo-client), use [`link`](https://www.apollographql.com/docs/react/reference/index.html#types) configuration to setup an [afterware](https://www.apollographql.com/docs/react/basics/network-layer.html#linkAfterware), e.g.\n\n```js\n// @flow\n\nimport {\n  ApolloClient\n} from 'apollo-client';\nimport {\n  ApolloLink,\n  concat\n} from 'apollo-link';\nimport {\n  InMemoryCache\n} from 'apollo-cache-inmemory';\nimport {\n  HttpLink\n} from 'apollo-link-http';\nimport {\n  inflate\n} from 'graphql-deduplicator';\n\nconst httpLink = new HttpLink({\n  credentials: 'include',\n  uri: '/api'\n});\n\nconst inflateLink = new ApolloLink((operation, forward) => {\n  return forward(operation)\n    .map((response) => {\n      return inflate(response);\n    });\n});\n\nconst apolloClient = new ApolloClient({\n  cache: new InMemoryCache(),\n  link: concat(inflateLink, httpLink)\n});\n\nexport default apolloClient;\n\n```\n\n#### Example usage with `apollo-boost`\n\nIt is not possible to configure link with `apollo-boost`. Therefore, it is not possible to use `graphql-deduplicator` with `apollo-boost`. Use `apollo-client` setup.\n\nNote: `apollo-boost` will be [discontinued starting Apollo Client v3](https://github.com/apollographql/apollo-client/issues/3225#issuecomment-415858054).\n\n## Best practices\n\n### Enable compression conditionally\n\nDo not break integration of the standard GraphQL clients that are unaware of the `graphql-deduplicator`.\n\nUse `deflate` only when client requests to use `graphql-deduplicator`, e.g.\n\n```js\n// Server-side\n\napp.use('/graphql', graphqlExpress((request) => {\n  return {\n    formatResponse: (response) => {\n      if (request.query.deduplicate && response.data && !response.data.__schema) {\n        return deflate(response);\n      }\n\n      return response;\n    }\n  };\n}));\n\n```\n\n```js\n// Client-side\n\nconst httpLink = new HttpLink({\n  credentials: 'include',\n  uri: '/api?deduplicate=1'\n});\n\n```\n\n#### Example using with [Apollo Server](https://github.com/apollographql/apollo-server)\n\n```javascript\nimport { GraphQLExtension, GraphQLResponse } from 'apollo-server-core'\nimport { deflate } from 'graphql-deduplicator'\n// [..]\n\nconst createContext = ({ req }): => {\n  return {\n    req,\n    // [..]\n  }\n}\nclass DeduplicateResponseExtension extends GraphQLExtension {\n  public willSendResponse(o) {\n    const { context, graphqlResponse } = o\n    // Ensures `?deduplicate=1` is used in the request\n    if (context.req.query.deduplicate && graphqlResponse.data && !graphqlResponse.data.__schema) {\n      const data = deflate(graphqlResponse.data)\n      return {\n        ...o,\n        graphqlResponse: {\n          ...graphqlResponse,\n          data,\n        },\n      }\n    }\n\n    return o\n  }\n}\n\nconst apolloServer = new ApolloServer({\n  // [..]\n  context: createContext,\n  extensions: [() => new DeduplicateResponseExtension()],\n})\n```\n","_attachments":{},"homepage":"https://github.com/gajus/graphql-deduplicator#readme","bugs":{"url":"https://github.com/gajus/graphql-deduplicator/issues"},"license":"BSD-3-Clause"}