{"name":"@graphql-tools/optimize","version":"2.0.1","license":"MIT","_id":"@graphql-tools/optimize@2.0.1","maintainers":[{"name":"dotansimha","email":"dotan@the-guild.dev"},{"name":"urigo","email":"uri.goldshtein@gmail.com"},{"name":"ardatan","email":"ardatanrikulu@gmail.com"},{"name":"enisdenjo","email":"badurinadenis@gmail.com"},{"name":"theguild-bot","email":"bot@the-guild.dev"}],"homepage":"https://github.com/ardatan/graphql-tools#readme","bugs":{"url":"https://github.com/ardatan/graphql-tools/issues"},"dist":{"shasum":"552a17e51f0fa36bfe0f4214ff5fbe242d0ca18b","tarball":"http://registry-npm.ywwl.com/@graphql-tools/optimize/download/@graphql-tools/optimize-2.0.1.tgz","fileCount":27,"integrity":"sha512-I63H75wg7SD/+iPj+QdvZgvul0dxxf/el18Yiry5zmwKeqRvzcm6l2KUYRNgMR/ydytp0VuHw3XeyGhPWGigAg==","signatures":[{"sig":"MEUCIQCZA5vv1+tJM47XMZL9mnxlTNV62l8Xo336nItVxjA5iAIgEM9tpkI+no7wfV9n3XfVB/JUHSJROrZNThzgRYfy7ME=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICMEMsATQvkHv6hbicATYwkzeLOecLoang3Vqvw/CuaVAiEAx0wPC1GzZ3W/vuZpb5uFHFJN+SDdG39spc2lsdAtUv0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@graphql-tools%2foptimize@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16776,"size":3157,"noattachment":false,"key":"/@graphql-tools/optimize/-/@graphql-tools/optimize-2.0.1.tgz"},"main":"cjs/index.js","type":"module","module":"esm/index.js","engines":{"node":">=16.0.0"},"exports":{".":{"import":{"types":"./typings/index.d.ts","default":"./esm/index.js"},"default":{"types":"./typings/index.d.ts","default":"./esm/index.js"},"require":{"types":"./typings/index.d.cts","default":"./cjs/index.js"}},"./*":{"import":{"types":"./typings/*.d.ts","default":"./esm/*.js"},"default":{"types":"./typings/*.d.ts","default":"./esm/*.js"},"require":{"types":"./typings/*.d.cts","default":"./cjs/*.js"}},"./package.json":"./package.json"},"gitHead":"8b9b7df95d7fc057bf1d7480ab7f8fe9035a9ab2","typings":"typings/index.d.ts","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:98b850dd-7e7f-48ab-bccb-6d08fb676a80"}},"repository":{"url":"git+https://github.com/ardatan/graphql-tools.git","type":"git","directory":"packages/optimize"},"typescript":{"definition":"typings/index.d.ts"},"_npmVersion":"11.19.0","description":"A set of utils for faster development of GraphQL tools","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"tslib":"^2.4.0"},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/optimize_2.0.1_1788797171395_0.9323003439910622","host":"s3://npm-registry-packages-npm-production"},"readme":"# GraphQL Tools: `DocumentNode` Optimizer\n\nThis package is intended to allow developers to optimize `DocumentNode` objects created by `graphql`\nlibrary.\n\nIt's built as a set of small optimizers you can compose to get the most out of your GraphQL setup.\n\nThe goal of this package is mostly around making optimizations for the way the data is stored in\n`DocumentNode`, and not to the essence of the `DocumentNode`.\n\n## Getting Started\n\n    npm install -D @graphql-tools/optimize\n\n## API\n\nTo get started with this tool, import it and run it over your `DocumentNode`.\n\n```ts\nimport { optimizeDocumentNode } from '@graphql-tools/optimize';\n\nconst myDocument: DocumentNode = { ... }\nconst optimizedDocument = optimizeDocumentNode(myDocument);\n```\n\n### Customizing Optimizers\n\nBy default, we apply all optimizers available in this repo over your document. It shouldn't effect\nany runtime since we just remove dead or unused areas.\n\nYou can modify the list of optimizers this way:\n\n```ts\nimport { optimizeDocumentNode, removeDescriptions } from '@graphql-tools/optimize';\n\nconst myDocument: DocumentNode = { ... }\nconst optimizedDocument = optimizeDocumentNode(myDocument, [removeDescriptions]);\n```\n\n### Writing your own optimizer\n\nYou can create your own optimizer to manipulate `DocumentNode`, the API signature is pretty simple:\n\n```ts\nexport type DocumentOptimizer = (input: DocumentNode) => DocumentNode\n```\n\nTake a look at [./optimizers](this directory for inspiration and implementation reference).\n","publish_time":1788797171492,"_cnpm_publish_time":1788797171492,"dist-tags":{"alpha":"3.0.0-alpha-20261019143118-7be5ebb61649aab8d773143666a8b71acf0aab42","latest":"3.0.0","rc":"3.0.0-rc-20261019143444-08495dac9c78ba1d624dc02ca6dcaeca82aaf318"}}