{"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":{"integrity":"sha512-BoPW+Z3kA8kLh0FCWyzOt+R77W5mVZWer5s6UyvVwZ/qROGiEgcHXFcI5TMMndpXoDo0xBSvQV0lIKYHbJQ7+g==","shasum":"5a9df1d34c2dbcdc395564de18687f055435da8c","tarball":"http://registry-npm.ywwl.com/@apollo/utils.dropunuseddefinitions/download/@apollo/utils.dropunuseddefinitions-2.0.0.tgz","fileCount":10,"unpackedSize":6566,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMEBbA9GHe0H0zji3lwAbhc63IpoVYxRKRziy50/5HaQIhANlEnccZNLdOQVSDcJmCqTsFW83dk3PEHrysHV/OBROU"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd7z7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquWg/9G4+DIqlUbdDBJXk7LCxO0iNVhS8SO7FbCWvOXWpWMyDTzsWP\r\novM97XscMkkJXdkHXk5P9u/arHMUYgJfSHaMOoqc4vM93sdJzSRYbN+iwGQb\r\nfnr0pSy4FKHb4NvxgA28L+R8M/A1AaA5wS/Rcg70ZdPPX2Oo/A27p9u73XWB\r\n27qOwSjW9fjo/KPbDP3TEdv+djxYgnzkqsm2Pl5USL0tRlOKVEcYmbb8x/HG\r\n0aRkt3HBCeNwhJQrFRk12aSmZhWl8B24NXcD8xZNJGcflfCbgRmuZcqkIuRR\r\nPu8u/5FRfsZUtNwi+do9YW2Q9nhou62bMARQ7me827QZnmIOsjPJXtibN2+k\r\n22HxQpGdQeSLO2XcLX11JpVyOqkBqkPMZ0XENVFOA1ItHriwKHS1TxvG5XQ9\r\nH6Cs1OAW6Cw+F8QGV5zPsQ7D8puVXEPHgtDy6APyGE8iRIYFyh6LGkM7KSD6\r\nMBM7UOGN6tQaT6XJ+LjfPpQySH0MCAsVI5ShKkUNQGEeK3xI+hbucCZ+Oucg\r\n6rlHz7Zi6sPZx5CL1xbPGLN6s9gEiqHDqztkmeCd+draeLXO7V1CZRPW49Of\r\nSfEO6qQ/5y+OxfSXzaaGMSrXpYeSwBFqEH61FN0nrdhvp71au3dZmOkWMCNm\r\n6DmN+5R71cjlGkI40kBeWhGqwv1qL5xd9iw=\r\n=d/KO\r\n-----END PGP SIGNATURE-----\r\n","size":2736,"noattachment":false,"key":"/@apollo/utils.dropunuseddefinitions/-/@apollo/utils.dropunuseddefinitions-2.0.0.tgz"},"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"maintainers":[{"name":"glasser","email":"glasser@apollographql.com"},{"name":"trevor.scheer","email":"trevor.scheer@gmail.com"},{"name":"apollo-bot","email":"npm@apollographql.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/utils.dropunuseddefinitions_2.0.0_1668791547710_0.6254520859355934"},"_hasShrinkwrap":false,"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","publish_time":1668791547962,"_cnpm_publish_time":1668791547962,"dist-tags":{"latest":"3.1.0"}}