{"_id":"@apollo/persisted-query-lists","_rev":"9-5bf820b3bea56b896e1a105111f28e32","name":"@apollo/persisted-query-lists","dist-tags":{"alpha":"1.0.0-alpha.0","latest":"1.1.0"},"versions":{"1.0.0-alpha.0":{"name":"@apollo/persisted-query-lists","version":"1.0.0-alpha.0","keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/persisted-query-lists@1.0.0-alpha.0","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"dist":{"shasum":"24120f9fe3d784525f651057f2ca8372d1290a29","tarball":"https://registry.npmjs.org/@apollo/persisted-query-lists/-/persisted-query-lists-1.0.0-alpha.0.tgz","fileCount":10,"integrity":"sha512-jiQErmCrR73fCh+9CGu3yO6F4ZxCd7vuQ82ugn79TlORCP/wq8CignOt+jfrYKD9uGohtNSTcgOnz61FUtw/2g==","signatures":[{"sig":"MEUCIEwCopvCIeIhswfYwKyI0wqPnPPOEp+yFqsgzP5Z414UAiEAu5LQayzY1zGJ9MXXwwFD3O8CBvR9e5k4r6eMqkqKYwo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29368},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"cd22cf436ba816835f373e209059aa68b7688c4b","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"_npmVersion":"8.5.0","description":"Support for Persisted Query Lists in Apollo Client Web","directories":{},"_nodeVersion":"16.20.0","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"14.x || 15.x || 16.x","@apollo/client":"^3.2.0"},"_npmOperationalInternal":{"tmp":"tmp/persisted-query-lists_1.0.0-alpha.0_1685121643163_0.2844891776063485","host":"s3://npm-registry-packages"}},"1.0.0-alpha.1":{"name":"@apollo/persisted-query-lists","version":"1.0.0-alpha.1","keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/persisted-query-lists@1.0.0-alpha.1","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"dist":{"shasum":"655250ac802a7bba37eadae72150e794638e469d","tarball":"https://registry.npmjs.org/@apollo/persisted-query-lists/-/persisted-query-lists-1.0.0-alpha.1.tgz","fileCount":10,"integrity":"sha512-vf97PmYU+tsESLlKDR7VoSn4fUFvSIbFkxmiVHLzgigr4NUXtupCsdQM+Cac8p2VuLlj8YhDhRISKOiTsRfkMg==","signatures":[{"sig":"MEUCICKfm1K0UoMp+GiZET9rGw8KtnMX59BlpvcOZtL0dnVHAiEAlg8EKxPNXviNqYZcPoTcAwId8jBZYzPVc83HXExmBtQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33915},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"cef21e816557801ac03dfda039e93898126140e4","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"_npmVersion":"8.5.0","description":"Support for Persisted Query Lists in Apollo Client Web","directories":{},"_nodeVersion":"16.20.0","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"14.x || 15.x || 16.x","@apollo/client":"^3.2.0"},"_npmOperationalInternal":{"tmp":"tmp/persisted-query-lists_1.0.0-alpha.1_1685126381650_0.33088179176154386","host":"s3://npm-registry-packages"}},"1.0.0-alpha.2":{"name":"@apollo/persisted-query-lists","version":"1.0.0-alpha.2","keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/persisted-query-lists@1.0.0-alpha.2","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"dist":{"shasum":"9ef753b3e524d14173dc2b17fe4f859d1646cfbb","tarball":"https://registry.npmjs.org/@apollo/persisted-query-lists/-/persisted-query-lists-1.0.0-alpha.2.tgz","fileCount":10,"integrity":"sha512-9ii9zbxbYkSJjiPYtAz8lDkUv1wgzidjo+8z5LwU9PeQl/SKz6rW4JIxp9v92eNSqlI2Se39JfQ537K3edHmMg==","signatures":[{"sig":"MEUCIE39zaUk1uN+ATIsj225zKPc9z2b2AYOh6S6xNItdkfjAiEA/nSASJL067Uz/KJ0zigaHYYYVvJBAwMKzDsiVabipVo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33931},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"f10d9c4d4ebb28c5890e249831248f6708d90ec6","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"_npmVersion":"8.5.0","description":"Support for Persisted Query Lists in Apollo Client Web","directories":{},"_nodeVersion":"16.20.0","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"14.x || 15.x || 16.x","@apollo/client":"^3.2.0 || ^3.8.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/persisted-query-lists_1.0.0-alpha.2_1685575617760_0.7755821339039941","host":"s3://npm-registry-packages"}},"1.0.0-alpha.3":{"name":"@apollo/persisted-query-lists","version":"1.0.0-alpha.3","keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/persisted-query-lists@1.0.0-alpha.3","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"dist":{"shasum":"85e072fd835886b7658baa2572e7eeacd351ccb4","tarball":"https://registry.npmjs.org/@apollo/persisted-query-lists/-/persisted-query-lists-1.0.0-alpha.3.tgz","fileCount":10,"integrity":"sha512-CabD8yDMsZOvicmFgk/PkrSJUEIaP8FNFndOU3UcgUoJVauYUlgqiLKczeYIlNMhYB08rhVV7d8tBUS0BYyzhg==","signatures":[{"sig":"MEYCIQDRu13Yua14mn1bye32cegD5AHFyktk3fTuKBveInK8ywIhAMdMMcQwMPNNqH7sOE/P4IBBSNEC0tfX8CelJoPwk8wy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36702},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"a8f712e41a55a7f87dda93a8e9fd9782e8c51073","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"_npmVersion":"8.5.0","description":"Support for Persisted Query Lists in Apollo Client Web","directories":{},"_nodeVersion":"16.20.0","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"14.x || 15.x || 16.x","@apollo/client":"^3.2.0 || ^3.8.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/persisted-query-lists_1.0.0-alpha.3_1685679502525_0.884377318032642","host":"s3://npm-registry-packages"}},"1.0.0-alpha.4":{"name":"@apollo/persisted-query-lists","version":"1.0.0-alpha.4","keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/persisted-query-lists@1.0.0-alpha.4","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"dist":{"shasum":"cce8c027aeece5437c05f4c1f58f7cd40a7fab7d","tarball":"https://registry.npmjs.org/@apollo/persisted-query-lists/-/persisted-query-lists-1.0.0-alpha.4.tgz","fileCount":10,"integrity":"sha512-2Y1Wz35nBn8HYyj+XV/axJ/m1D7+h7u0HGygfONfd+vdWnhpJSyXiLQmY8WUvpWfjAw+TSCDR52NOB8cMA+oYQ==","signatures":[{"sig":"MEYCIQCGyg8+2BAMxVclUtGQyjm7yvyqYHLynrlejTcJXdt5zwIhAI/L/iSYTiij7PsvjCquTzjCa6BRGPI0keGfF7cSfUxd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":37753},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"cc4d393127c5b8f90f951beb50c5fdd9e6e89e52","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"_npmVersion":"8.5.0","description":"Support for Persisted Query Lists in Apollo Client Web","directories":{},"_nodeVersion":"16.20.0","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"14.x || 15.x || 16.x","@apollo/client":"^3.2.0 || ^3.8.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/persisted-query-lists_1.0.0-alpha.4_1687476030094_0.17223950517667097","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@apollo/persisted-query-lists","version":"1.0.0","keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/persisted-query-lists@1.0.0","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"dist":{"shasum":"12ed5c3b204e04187a027d5ffd862313b012c221","tarball":"https://registry.npmjs.org/@apollo/persisted-query-lists/-/persisted-query-lists-1.0.0.tgz","fileCount":10,"integrity":"sha512-PrqOKBrI01tqGwjji97Ux4L3z8bIkUJ9QJ7kGt13CzH6d1cUx+4IehF7p2Tceo1Rwkr5cAR98RYfzMCd0JALTQ==","signatures":[{"sig":"MEUCIQD9gEm1xGi9Zjb6fHwUCqflbqA/Z01dvioVysYu04AM6gIgVYOMRQe3DGBv1AtcnyQeXxcZw5H6tveVsmjgIlcg4fw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45011},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"2abfc46a2762ef283a3e9ab069521f6448dad6af","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"_npmVersion":"8.5.0","description":"Support for Persisted Query Lists in Apollo Client Web","directories":{},"_nodeVersion":"16.20.1","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"14.x || 15.x || 16.x","@apollo/client":"^3.2.0 || ^3.8.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/persisted-query-lists_1.0.0_1688771701799_0.2310120730841696","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@apollo/persisted-query-lists","version":"1.1.0","keywords":["apollo","graphql","typescript","node"],"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","_id":"@apollo/persisted-query-lists@1.1.0","maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"homepage":"https://github.com/apollographql/apollo-utils#readme","bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"dist":{"shasum":"395885ef674e7bdae05ca166fd2236d120e4a9cf","tarball":"https://registry.npmjs.org/@apollo/persisted-query-lists/-/persisted-query-lists-1.1.0.tgz","fileCount":10,"integrity":"sha512-LpegTvQfn2MUiaBbdxv/InzLsgDEcOW6h3UyI4cRHUlYpA3ftHazGcZnMAlPSfMgf88yAvGi4nqTwYB3wy+JZg==","signatures":[{"sig":"MEUCIQCv8YqFkiNH0z8czaht7XcyZDts9g23YAXmGenm7i2udAIgThyxLPehin6oRpzG3U7ELdVmDJwK86SYV+bS8QH/6A8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46358},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16"},"gitHead":"be366a9a9dfb872431936ddb400f949641650091","_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"_npmVersion":"10.9.3","description":"Support for Persisted Query Lists in Apollo Client Web","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"peerDependencies":{"graphql":"14.x || 15.x || 16.x","@apollo/client":"^3.2.0 || ^3.8.0-alpha || ^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/persisted-query-lists_1.1.0_1763051049040_0.7384651132078772","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2023-05-26T17:20:43.092Z","modified":"2026-01-22T17:30:05.882Z","1.0.0-alpha.0":"2023-05-26T17:20:43.339Z","1.0.0-alpha.1":"2023-05-26T18:39:41.894Z","1.0.0-alpha.2":"2023-05-31T23:26:57.963Z","1.0.0-alpha.3":"2023-06-02T04:18:22.695Z","1.0.0-alpha.4":"2023-06-22T23:20:30.367Z","1.0.0":"2023-07-07T23:15:02.109Z","1.1.0":"2025-11-13T16:24:09.239Z"},"bugs":{"url":"https://github.com/apollographql/apollo-utils/issues"},"author":{"name":"Apollo","email":"packages@apollographql.com"},"license":"MIT","homepage":"https://github.com/apollographql/apollo-utils#readme","keywords":["apollo","graphql","typescript","node"],"repository":{"url":"git+https://github.com/apollographql/apollo-utils.git","type":"git","directory":"packages/persisted-query-lists/"},"description":"Support for Persisted Query Lists in Apollo Client Web","maintainers":[{"email":"npm@apollographql.com","name":"apollo-bot"},{"email":"mail@lenzw.de","name":"phryneas"},{"email":"npmjs@jro.cc","name":"abernix"}],"readme":"# `@apollo/persisted-query-lists`\n\nThis package contains utilities for working with Apollo GraphQL persisted\nqueries. Specifically, this package contains an [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction)\nthat can be used to verify your persisted queries against a manifest as well as\nhelpers that work with the [Persisted Query Link](https://www.apollographql.com/docs/react/api/link/persisted-queries).\n\nThese functions correspond to different steps in the adoption of persisted queries:\n\n- `createPersistedQueryManifestVerificationLink` allows you to verify that you've properly configured the `@apollo/generate-persisted-query-manifest` tool, without changing how your app communicates with your GraphQL server or requiring you to set up persisted queries in GraphOS/Router. This helps you build a deployment workflow that creates (and optionally publishes) your manifest.\n- Once you're confident that your manifest is being properly generated and published by your deployment infrastructure, you can use `generatePersistedQueryIdsAtRuntime` to tell your app to send persisted query IDs in its GraphQL requests instead of the full GraphQL document. While you do need to generate and publish your manifest to GraphOS in order for this to work properly, you don't need to make the manifest available to your client at runtime if you use this mechanism, so it can be simpler to set up than `generatePersistedQueryIdsFromManifest`. However, this requires your app to calculate SHA256 hashes at runtime.\n- Finally, you can use `generatePersistedQueryIdsFromManifest` to tell your app to send persisted query IDs by including the manifest directly inside your app. It uses your GraphQL operation's name to select which persisted query ID to send. This can perform better than `generatePersistedQueryIdsAtRuntime` by not requiring the client to calculate hashes.\n\n## Setup\n\nInstall the package:\n\n```sh\nnpm install @apollo/persisted-query-lists\n```\n\n## Usage\n\n### `generatePersistedQueryIdsAtRuntime`\n\nHelper function passed to [Persisted Query Link](https://www.apollographql.com/docs/react/api/link/persisted-queries)\nthat generates query hashes at runtime without the use of a manifest file. This\ndiffers from the default behavior of the Persisted Query Link by disabling\nautomatic registration of persisted queries and sorting top-level definitions\nto mimic the behavior of the manifest file. See [`generatePersistedQueryIdsFromManifest`](#generatepersistedqueryidsfrommanifest)\nif you are able to integrate manifest file generation into your app's build process.\n\n```ts\nimport { generatePersistedQueryIdsAtRuntime } from \"@apollo/persisted-query-lists\";\nimport { createPersistedQueryLink } from \"@apollo/client/link/persisted-queries\";\nimport { sha256 } from \"crypto-hash\";\n\nconst persistedQueryLink = createPersistedQueryLink(\n  generatePersistedQueryIdsAtRuntime({ sha256 }),\n);\n```\n\nThis function will not work properly if you use the `createOperationId` config option to `@apollo/generate-persisted-query-manifest`.\n\n#### Options\n\n- `sha256`: A SHA-256 hashing function. Can be sync or async. Providing a SHA-256\n  hashing function is required.\n\n### `generatePersistedQueryIdsFromManifest`\n\nHelper function passed to [Persisted Query Link](https://www.apollographql.com/docs/react/api/link/persisted-queries)\nthat will read from your manifest configuration to get the persisted query ID.\nNote that this function completely ignores the `body` in the manifest: it just looks for an operation whose `name` matches the operation your code is trying to execute, and uses its `id`.\nSee the [`@apollo/generate-persisted-query-manifest`](https://www.npmjs.com/package/@apollo/generate-persisted-query-manifest)\npackage to learn how to generate the manifest file.\n\n```ts\nimport { generatePersistedQueryIdsFromManifest } from \"@apollo/persisted-query-lists\";\nimport { createPersistedQueryLink } from \"@apollo/client/link/persisted-queries\";\n\nconst persistedQueryLink = createPersistedQueryLink(\n  generatePersistedQueryIdsFromManifest({\n    loadManifest: () => import(\"./path/to/persisted-query-manifest.json\"),\n  }),\n);\n```\n\n#### Options\n\n- `loadManifest`: A function that returns your persisted query manifest\n  configuration. Can be sync or async. We recommend using a dynamic import to\n  avoid bundling the manifest configuration with your production build.\n\n### `createPersistedQueryManifestVerificationLink`\n\nAn [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction)\nthat verifies that queries sent to your server can be matched to your manifest\nconfiguration. See the [`@apollo/generate-persisted-query-manifest`](https://www.npmjs.com/package/@apollo/generate-persisted-query-manifest)\npackage to learn how to generate the manifest file.\n\nNOTE: This link is not a terminating link and will forward the operation through\nthe link chain.\n\n```ts\nimport { createPersistedQueryManifestVerificationLink } from \"@apollo/persisted-query-lists\";\n\nconst verificationLink = createPersistedQueryManifestVerificationLink({\n  loadManifest: () => import(\"./path/to/persisted-query-manifest.json\"),\n  onVerificationFailed: (details) => {\n    console.warn(details.reason);\n  },\n});\n```\n\n#### Options\n\n- `loadManifest`: A function that returns your persisted query manifest\n  configuration. Can by sync or async. We recommend using a dynamic import to\n  avoid bundling the manifest configuration with your production build.\n\n- `onVerificationFailed`: A function that is called when there is a verification\n  failure for the operation about to be sent to the server. Each error that\n  occurs will have a `reason` property describing the failure that occurred. See\n  below for details on the various verification failures.\n\n#### Verification failures\n\nA verification failure will contain a `reason` property that describes the\nfailure that occurred. Additionally, each failure contains an [`operation`](https://www.apollographql.com/docs/react/api/link/introduction#the-operation-object)\nproperty for the operation that triggered the verification failure.\n\nThe following failures may occur as described by the `reason` property:\n\n- `AnonymousOperation`: Failure when the GraphQL operation does not contain an\n  operation name. Persisted queries do not support anonymous operations.\n\n- `MultipleOperations`: Failure when the GraphQL document contains multiple\n  operations. Persisted queries do not support multiple operations in a single\n  document.\n\n- `NoOperations`: Failure when the GraphQL document does not contain an operation,\n  such as a fragment definition. Persisted queries do not support GraphQL\n  documents without operations.\n\n- `UnknownOperation`: Failure when the GraphQL document cannot be matched to an\n  operation in the manifest configuration. This is an indicator that you may need\n  to regenerate your manifest configuration.\n\n- `OperationMismatch`: Failure when an operation was found in your manifest\n  configuration, matched by the operation name, but the operation body did not\n  match the manifest configuration body. This error also provides a\n  `manifestOperation` property that is the matched operation from your manifest\n  configuration. This is an indicator that the manifest might contain an outdated\n  query and that you might need to regenerate your manifest configuration.\n","readmeFilename":"README.md"}