Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct language #11157

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/source/api/link/persisted-queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Malicious actors can exploit GraphQL APIs by sending large and complex requests

## Implementation steps

Because persisted queries requires you to preregister trusted operations, it has additional implementation steps.
Because persisted queries requires you to preregister operations, it has additional implementation steps.

<ClientPQImplementation />

Expand All @@ -45,7 +45,7 @@ You can use APQ with the following versions of Apollo Client Web, Apollo Server,

> **This step is only required for persisted queries, not APQ.**

An operation manifest acts as a safelist of trusted operations the [Apollo Router](/router/) can check incoming requests against.
An operation manifest acts as a safelist the [Apollo Router](/router/) can check incoming requests against.
You can generate the manifest using the [`@apollo/generate-persisted-query-manifest`](https://www.npmjs.com/package/@apollo/generate-persisted-query-manifest) package:

1. Install the [`@apollo/generate-persisted-query-manifest`](https://www.npmjs.com/package/@apollo/generate-persisted-query-manifest) package as a dev dependency:
Expand Down Expand Up @@ -105,15 +105,15 @@ Install the [`@apollo/persisted-query-lists`](https://www.npmjs.com/package/@apo
npm install @apollo/persisted-query-lists
```

One of the package's utilities, `generatePersistedQueryIdsAtRuntime`, reads operation IDs from your [operation manifest](#1-generate-operation-manifests) so the client can use them to make requests. To do so, pass the `loadManifest` option a function that returns your manifest. We recommend using a dynamic import to avoid bundling the manifest configuration with your production build.
One of the package's utilities, `generatePersistedQueryIdsFromManifest`, reads operation IDs from your [operation manifest](#1-generate-operation-manifests) so the client can use them to make requests. To do so, pass the `loadManifest` option a function that returns your manifest. We recommend using a dynamic import to avoid bundling the manifest configuration with your production build.

```js
generatePersistedQueryIdsFromManifest({
loadManifest: () => import("./path/to/persisted-query-manifest.json"),
})
```

Finally, combine the link that `generatePersistedQueryIdsAtRuntime` returns with `ApolloClient`'s `HttpLink`. The easiest way to use them together is to `concat` them into a single link.
Finally, combine the link that `generatePersistedQueryIdsFromManifest` returns with `ApolloClient`'s `HttpLink`. The easiest way to use them together is to `concat` them into a single link.

```js
import { HttpLink, InMemoryCache, ApolloClient } from "@apollo/client";
Expand Down