{"_id":"@apollo/utils.dropunuseddefinitions","_rev":"2908420","name":"@apollo/utils.dropunuseddefinitions","description":"Drop unused definitions from a GraphQL document","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"},{"name":"glasser","email":"glasser@apollographql.com"}],"time":{"modified":"2023-01-13T06:24:22.000Z","created":"2022-02-16T01:57:08.241Z","2.0.0":"2022-11-18T17:12:27.962Z","1.1.0":"2022-04-26T17:48:43.288Z","1.0.0":"2022-02-16T01:57:08.241Z"},"users":{},"author":{"name":"Apollo","email":"packages@apollographql.com"},"repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-utils.git","directory":"packages/dropUnusedDefinitions/"},"versions":{"2.0.0":{"name":"@apollo/utils.dropunuseddefinitions","version":"2.0.0","description":"Drop unused definitions from a GraphQL document","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-utils.git","directory":"packages/dropUnusedDefinitions/"},"keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","engines":{"node":">=14"},"peerDependencies":{"graphql":"14.x || 15.x || 16.x"},"gitHead":"a81b88047ea1213c08fec8530e6ab9c30d03ce59","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"homepage":"https://github.com/apollographql/apollo-utils#readme","_id":"@apollo/utils.dropunuseddefinitions@2.0.0","_nodeVersion":"16.18.0","_npmVersion":"8.5.0","dist":{"shasum":"5a9df1d34c2dbcdc395564de18687f055435da8c","size":2736,"noattachment":false,"key":"/@apollo/utils.dropunuseddefinitions/-/@apollo/utils.dropunuseddefinitions-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@apollo/utils.dropunuseddefinitions/download/@apollo/utils.dropunuseddefinitions-2.0.0.tgz"},"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"},{"name":"glasser","email":"glasser@apollographql.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/utils.dropunuseddefinitions_2.0.0_1668791547710_0.6254520859355934"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-18T17:13:53.285Z","publish_time":1668791547962,"_cnpm_publish_time":1668791547962},"1.1.0":{"name":"@apollo/utils.dropunuseddefinitions","version":"1.1.0","description":"Drop unused definitions from a GraphQL document","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-utils.git","directory":"dropUnusedDefinitions/"},"keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","engines":{"node":">=12.13.0"},"publishConfig":{"access":"public"},"peerDependencies":{"graphql":"14.x || 15.x || 16.x"},"gitHead":"854df1b996deea0ed10871640f5289e53c9d390b","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"homepage":"https://github.com/apollographql/apollo-utils#readme","_id":"@apollo/utils.dropunuseddefinitions@1.1.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"shasum":"02b04006442eaf037f4c4624146b12775d70d929","size":2517,"noattachment":false,"key":"/@apollo/utils.dropunuseddefinitions/-/@apollo/utils.dropunuseddefinitions-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@apollo/utils.dropunuseddefinitions/download/@apollo/utils.dropunuseddefinitions-1.1.0.tgz"},"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"},{"name":"glasser","email":"glasser@apollographql.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/utils.dropunuseddefinitions_1.1.0_1650995323114_0.10984622363822583"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-26T17:55:40.238Z","publish_time":1650995323288,"_cnpm_publish_time":1650995323288},"1.0.0":{"name":"@apollo/utils.dropunuseddefinitions","version":"1.0.0","description":"Drop unused definitions from a GraphQL document","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-utils.git","directory":"dropUnusedDefinitions/"},"keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","engines":{"node":">=12.13.0 <18.0"},"publishConfig":{"access":"public"},"peerDependencies":{"graphql":"14.x || 15.x || 16.x"},"gitHead":"c7bd6d038c208f804331dec36fcf1a7fcfcf8ad6","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"homepage":"https://github.com/apollographql/apollo-utils#readme","_id":"@apollo/utils.dropunuseddefinitions@1.0.0","_nodeVersion":"16.13.2","_npmVersion":"8.5.0","dist":{"shasum":"441eadc04eb7a91d2a3fe47312a944551c44c2e5","size":2523,"noattachment":false,"key":"/@apollo/utils.dropunuseddefinitions/-/@apollo/utils.dropunuseddefinitions-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@apollo/utils.dropunuseddefinitions/download/@apollo/utils.dropunuseddefinitions-1.0.0.tgz"},"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"},{"name":"glasser","email":"glasser@apollographql.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/utils.dropunuseddefinitions_1.0.0_1644976628063_0.052992500901709816"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-16T01:57:20.178Z","publish_time":1644976628241,"_cnpm_publish_time":1644976628241}},"readme":"# dropUnusedDefinitions\n\nGiven an operation document and an operation name, this function will return a\nnew document with only the definitions required for the operation name provided.\n\nIf the provided operation name doesn't match any operation in the document,\n`dropUnusedDefinitions` will return the original document.\n\n## Usage\n\n```ts\nimport { dropUnusedDefinitions } from \"@apollo/utils.dropunuseddefinitions\";\n\nconst operation = parse(`#graphql\n  query Drop { ...DroppedFragment }\n  fragment DroppedFragment on Query { abc }\n  query Keep { ...KeptFragment }\n  fragment KeptFragment on Query { def }\n`);\nconst keepOperation = dropUnusedDefinitions(operation, \"Keep\");\n/**\nquery Keep {\n  ...KeptFragment\n}\n\nfragment KeptFragment on Query {\n  def\n}\n*/\n```\n","_attachments":{},"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"license":"MIT"}