Skip to content

Commit 99987aa

Browse files
authored
Merge pull request #7939 from apollographql/version-3-docs-replatform
docs: v3 docs update
2 parents 09d3137 + 616ed98 commit 99987aa

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

docs/source/api/apollo-server.mdx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -565,17 +565,18 @@ The default value is `10_000` (10 seconds).
565565

566566
The `context` object passed between Apollo Server resolvers automatically includes certain fields, depending on which [Node.js middleware](../integrations/middleware/) you're using:
567567

568-
| Middleware | Context fields |
569-
|---|---|
570-
| AWS Lambda | <code>{<br/>&nbsp;&nbsp;event: [`APIGatewayProxyEvent`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/aws-lambda/index.d.ts#L78-L92),<br/>&nbsp;&nbsp;context: [`LambdaContext`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/aws-lambda/index.d.ts#L510-L534),<br/>&nbsp;&nbsp;express: {<br/>&nbsp;&nbsp;&nbsp;&nbsp;req: [`express.Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts),<br/>&nbsp;&nbsp;&nbsp;&nbsp;res: [`express.Response`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts#L490-L861)<br/>&nbsp;&nbsp;}<br/>}</code> |
571-
| Azure Functions | <code>{<br/>&nbsp;&nbsp;request: [`HttpRequest`](https://github.com/Azure/azure-functions-nodejs-worker/blob/ba8402bd3e86344e68cb06f65f9740b5d05a9700/types/public/Interfaces.d.ts#L73-L108),<br/>&nbsp;&nbsp;context: [`Context`](https://github.com/Azure/azure-functions-nodejs-worker/blob/ba8402bd3e86344e68cb06f65f9740b5d05a9700/types/public/Interfaces.d.ts#L18-L69)<br/>}</code> |
572-
| Cloudflare | <code>{ req: [`Request`](https://github.com/apollographql/apollo-server/blob/04fe6aa1314ca84de26b4dc26e9b29dda16b81bc/packages/apollo-server-env/src/fetch.d.ts#L37-L45) }</code> |
573-
| Express (including `apollo-server`) | <code>{<br/>&nbsp;&nbsp;req: [`express.Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts),<br/>&nbsp;&nbsp;res: [`express.Response`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts#L490-L861)<br/>}</code> |
574-
| Fastify | <code>{<br/>&nbsp;&nbsp;request: [`FastifyRequest`](https://github.com/fastify/fastify/blob/1d4dcf2bcde46256c72e96c2cafc843a461c721e/types/request.d.ts#L15),<br/>&nbsp;&nbsp;reply: [`FastifyReply`](https://github.com/fastify/fastify/blob/1d4dcf2bcde46256c72e96c2cafc843a461c721e/types/reply.d.ts#L10)<br/>}</code> |
575-
| Google Cloud Functions | <code>{ req: [`Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts), res: [`Response`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts#L490-L861) }</code> |
576-
| hapi | <code>{<br/>&nbsp;&nbsp;request: [`hapi.Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/05cbc5521f895344fb7dbf5c51902b6ff235aa69/types/hapi__hapi/index.d.ts#L406-L615),<br/>&nbsp;&nbsp;h: [`hapi.ResponseToolkit`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/05cbc5521f895344fb7dbf5c51902b6ff235aa69/types/hapi__hapi/index.d.ts#L999-L1113)<br/>}</code> |
577-
| Koa | <code>{ ctx: [`Koa.Context`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/koa/index.d.ts#L724-L731) }</code> |
578-
| Micro | <code>{ req: [`MicroRequest`](https://github.com/apollographql/apollo-server/blob/c356bcf3f2864b8d2fcca0add455071e0606ef46/packages/apollo-server-micro/src/types.ts#L3-L5), res: [`ServerResponse`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/node/v10/http.d.ts#L145-L158) }</code> |
568+
| Middleware | Context Fields | Reference Links |
569+
|-------------------------|---------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
570+
| AWS Lambda | ```js { event: APIGatewayProxyEvent, context: LambdaContext, express: { req: express.Request, res: express.Response } }``` | - [`APIGatewayProxyEvent`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/aws-lambda/index.d.ts#L78-L92) <br/> - [`LambdaContext`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/aws-lambda/index.d.ts#L510-L534) <br/> - [`express.Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts) <br/> - [`express.Response`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts#L490-L861) |
571+
| Azure Functions | ```js { request: HttpRequest, context: Context }``` | - [`HttpRequest`](https://github.com/Azure/azure-functions-nodejs-worker/blob/ba8402bd3e86344e68cb06f65f9740b5d05a9700/types/public/Interfaces.d.ts#L73-L108) <br/> - [`Context`](https://github.com/Azure/azure-functions-nodejs-worker/blob/ba8402bd3e86344e68cb06f65f9740b5d05a9700/types/public/Interfaces.d.ts#L18-L69) |
572+
| Cloudflare | ```js { req: Request }``` | - [`Request`](https://github.com/apollographql/apollo-server/blob/04fe6aa1314ca84de26b4dc26e9b29dda16b81bc/packages/apollo-server-env/src/fetch.d.ts#L37-L45) |
573+
| Express (including `apollo-server`) | ```js { req: express.Request, res: express.Response }``` | - [`express.Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts) <br/> - [`express.Response`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts#L490-L861) |
574+
| Fastify | ```js { request: FastifyRequest, reply: FastifyReply }``` | - [`FastifyRequest`](https://github.com/fastify/fastify/blob/1d4dcf2bcde46256c72e96c2cafc843a461c721e/types/request.d.ts#L15) <br/> - [`FastifyReply`](https://github.com/fastify/fastify/blob/1d4dcf2bcde46256c72e96c2cafc843a461c721e/types/reply.d.ts#L10) |
575+
| Google Cloud Functions | ```js { req: Request, res: Response }``` | - [`Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts) <br/> - [`Response`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/express-serve-static-core/index.d.ts#L490-L861) |
576+
| hapi | ```js { request: hapi.Request, h: hapi.ResponseToolkit }``` | - [`hapi.Request`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/05cbc5521f895344fb7dbf5c51902b6ff235aa69/types/hapi__hapi/index.d.ts#L406-L615) <br/> - [`hapi.ResponseToolkit`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/05cbc5521f895344fb7dbf5c51902b6ff235aa69/types/hapi__hapi/index.d.ts#L999-L1113) |
577+
| Koa | ```js { ctx: Koa.Context }``` | - [`Koa.Context`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/koa/index.d.ts#L724-L731) |
578+
| Micro | ```js { req: MicroRequest, res: ServerResponse }``` | - [`MicroRequest`](https://github.com/apollographql/apollo-server/blob/c356bcf3f2864b8d2fcca0add455071e0606ef46/packages/apollo-server-micro/src/types.ts#L3-L5) <br/> - [`ServerResponse`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/50adc95acf873e714256074311353232fcc1b5ed/types/node/v10/http.d.ts#L145-L158) |
579+
579580

580581
## `listen`
581582

docs/source/api/plugin/usage-reporting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Providing a number `x` is equivalent to passing this function:
137137
* The operation _doesn't_ produce a trace that can be viewed in the Traces section of the Operations page in Studio.
138138
* The operation _does_ still contribute to most features of Studio, such as schema checks, the Operations page, and the "referencing operations" statistic on the Fields page.
139139

140-
(For more information about the difference between the "referencing operations" and "field executions" statistics, see [the Studio Fields page documentation](https://apollographql.com/docs/studio/metrics/field-usage/).)
140+
(For more information about the difference between the "referencing operations" and "field executions" statistics, see the [field usage documentation](/graphos/platform/insights/field-usage).)
141141

142142
Returning `false` (or `0`) for some or all operations can improve your server's performance, because calculating complete traces can introduce significant overhead. This is especially true for a federated graph, because traces are transmitted from the subgraph to the Gateway in-band inside the actual GraphQL response.
143143

docs/source/data/subscriptions.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ httpServer.listen(PORT, () => {
211211

212212
</ExpansionPanel>
213213

214-
> ⚠️ **Running into an error?** If you're using the `graphql-ws` library, your specified subscription protocol must be consistent across your backend, frontend, and **every other tool** you use (including [Apollo Sandbox](/studio/explorer/additional-features/#subscription-support)). For more information, see [Switching from `subscriptions-transport-ws`](#switching-from-subscriptions-transport-ws).
214+
> ⚠️ **Running into an error?** If you're using the `graphql-ws` library, your specified subscription protocol must be consistent across your backend, frontend, and **every other tool** you use (including [Apollo Sandbox](/graphos/platform/explorer/subscription-support). For more information, see [Switching from `subscriptions-transport-ws`](#switching-from-subscriptions-transport-ws).
215215
216216
## Resolving a subscription
217217

@@ -412,7 +412,7 @@ subscription IncrementingNumber {
412412
}
413413
```
414414

415-
> If you don't see the result of your subscription operation you might need to [adjust your Sandbox settings to use the `graphql-ws` protocol](/studio/explorer/additional-features/#subscription-support).
415+
> If you don't see the result of your subscription operation you might need to [adjust your Sandbox settings to use the `graphql-ws` protocol](/graphos/platform/explorer/subscription-support).
416416
417417
After you start up the server in CodeSandbox, follow the instructions in the browser to test running the `numberIncremented` subscription in Apollo Sandbox. You should see the subscription's value update every second.
418418

@@ -609,19 +609,19 @@ If you intend to [switch from `subscriptions-transport-ws` to `graphql-ws`](#swi
609609
<tr>
610610
<td>
611611

612-
[Apollo Studio Explorer](/studio/explorer/explorer/)
612+
[Apollo Studio Explorer](/graphos/platform/explorer)
613613

614614
</td>
615615

616616
<td>
617617

618-
[`graphql-ws`](/studio/explorer/additional-features/#subscription-support)
618+
[`graphql-ws`](/graphos/platform/explorer/subscription-support)
619619

620620
</td>
621621

622622
<td>
623623

624-
[`subscriptions-transport-ws`](/studio/explorer/additional-features/#subscription-support)
624+
[`subscriptions-transport-ws`](/graphos/platform/explorer/subscription-support)
625625
</td>
626626

627627
</tr>
@@ -652,7 +652,7 @@ Use [`WebSocketLink`](/react/api/link/apollo-link-ws/)
652652
<tr>
653653
<td>
654654

655-
[Apollo iOS](/ios/subscriptions/)
655+
[Apollo iOS](/ios/fetching/subscriptions/)
656656

657657
</td>
658658

docs/source/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ title: Introduction to Apollo Server
1212

1313
#### You can use Apollo Server as:
1414

15-
* A gateway for a [federated supergraph](/federation/)
16-
* The GraphQL server for a [subgraph](/federation/subgraphs) in a federated supergraph
15+
* A gateway for a [federated supergraph](/graphos/schema-design/federated-schemas/federation)
16+
* The GraphQL server for a [subgraph in a federated supergraph](/graphos/get-started/concepts/graphs#supergraphs)
1717
* A stand-alone GraphQL server, including in a serverless environment
18-
* An add-on to your application's existing [Node.js middleware](./integrations/middleware/) (such as Express or Fastify)
18+
* An add-on to your application's existing [Node.js middleware](/apollo-server/v3/integrations/middleware/) (such as Express or Fastify)
1919

2020
#### Apollo Server provides:
2121

docs/source/security/cors.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ If you don't, while your personal computer is on your private network, a script
6464

6565
If you're building a [federated graph](/federation/), we strongly recommend that _all_ of your production subgraph servers [_disable_ CORS](../api/apollo-server#cors) (or at least specify origins and limit them to tools like the Apollo Explorer). Most subgraphs should allow communication _only_ from your gateways, and that communication doesn't involve a browser at all.
6666

67-
For more information, see [Securing your subgraphs](/federation/subgraphs/#securing-your-subgraphs).
67+
For more information, see [Securing your subgraphs](/graphos/routing/cloud/secure-subgraphs).
6868

6969
#### APIs that require cookies
7070

@@ -115,7 +115,7 @@ Under the hood, the batteries-included `apollo-server` wraps around middleware p
115115
116116
If you're using another integration of Apollo Server, you can add the `cors` configuration option to your framework-specific middleware function to change your server's CORS behavior. To learn more about the CORS defaults and options for your integration of Apollo Server, see [CORS configuration options](../api/apollo-server/#cors-1).
117117

118-
Below is an example of setting up CORS with the [`apollo-server-express`](../integrations/middleware#swapping-out-apollo-server) package:
118+
Below is an example of setting up CORS with the [`apollo-server-express`](/apollo-server/v3/integrations/middleware#swapping-out-apollo-server) package:
119119

120120
```js
121121
// ... set up the server
@@ -132,7 +132,7 @@ server.applyMiddleware({
132132
});
133133
```
134134

135-
You can also [remove CORS middleware entirely](../api/apollo-server#cors) to disable cross-origin requests. In the batteries-included `apollo-server` and `apollo-server-express`, you do this by passing `cors: false`. This is [recommended for subgraphs in a federated graph](/federation/subgraphs/#securing-your-subgraphs).
135+
You can also [remove CORS middleware entirely](../api/apollo-server#cors) to disable cross-origin requests. In the batteries-included `apollo-server` and `apollo-server-express`, you do this by passing `cors: false`. This is [recommended for subgraphs in a federated graph](/graphos/routing/cloud/secure-subgraphs).
136136

137137
### Passing credentials with CORS
138138

0 commit comments

Comments
 (0)