Skip to content

Commit 0e8d85f

Browse files
committed
Update docs (mostly) for v4 release on version-3
- Run docs publish workflow on version-3 - Update lots of links from main to version-3 - Don't redirect away from /v3 in docs - renovate.json5 is ignored off of main (if we wanted to renovate this branch, we'd have to configure it on main using baseBranches) - make prettier ignore _redirects (it was treating it as Markdown)
1 parent 24a841b commit 0e8d85f

13 files changed

+20
-201
lines changed

.github/workflows/docs-publish.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- version-2
8+
- version-3
89
paths:
910
- docs/**
1011

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ docs/.cache/
1212
**/generated/**
1313

1414
.volta
15+
_redirects

docs/source/_redirects

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# The v3 docs were beta for a while, and non-default, but now that they are
2-
# default, the v3 docs don't exist anymore. So redirect them to the default!
3-
/v3 /docs/apollo-server
4-
/v3/* /docs/apollo-server/:splat
5-
61
# Updating URLs for v3
72
/testing/graphql-playground/ /docs/apollo-server/testing/build-run-queries/#graphql-playground
83
/deployment /docs/apollo-server/deployment/heroku
@@ -25,7 +20,7 @@
2520
/api/graphql-tools /docs/apollo-server/
2621

2722
# Redirects associated with revamp of Apollo Server information architecture
28-
/whats-new https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md
23+
/whats-new https://github.com/apollographql/apollo-server/blob/version-3/CHANGELOG.md
2924
/essentials/data/ /docs/apollo-server/data/data/
3025
/essentials/schema/ /docs/apollo-server/schema/schema/
3126
/essentials/server /docs/apollo-server/getting-started/

docs/source/api/apollo-server.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Provide this function to transform the structure of error objects before they're
300300
</td>
301301
<td>
302302

303-
Provide this function to transform the structure of GraphQL response objects before they're sent to a client. The function takes a [`GraphQLResponse`](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-types/src/index.ts#109-L114) object and a [`GraphQLRequestContext`](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-types/src/index.ts#L127-L162) object, and it should return a `GraphQLResponse` object, or null to preserve the existing structure.
303+
Provide this function to transform the structure of GraphQL response objects before they're sent to a client. The function takes a [`GraphQLResponse`](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-types/src/index.ts#109-L114) object and a [`GraphQLRequestContext`](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-types/src/index.ts#L127-L162) object, and it should return a `GraphQLResponse` object, or null to preserve the existing structure.
304304
</td>
305305
</tr>
306306

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Specify this asynchronous function to configure which requests are included in u
172172

173173
Note that returning `false` here means that the operation is completely ignored by all Apollo Studio features. If you want to improve performance by skipping the field-level execution trace, set the [`fieldLevelInstrumentation`](#fieldlevelinstrumentation) option instead of this one.
174174

175-
This function is called for each received request. It takes a [`GraphQLRequestContext`](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-types/src/index.ts#L115-L150) object and must return a `Promise<Boolean>` that indicates whether to include the request. It's called either after the operation is successfully resolved (via [the `didResolveOperation` event](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#didresolveoperation)), or when sending the final error response if the operation was not successfully resolved (via [the `willSendResponse` event](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#willsendresponse)).
175+
This function is called for each received request. It takes a [`GraphQLRequestContext`](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-types/src/index.ts#L115-L150) object and must return a `Promise<Boolean>` that indicates whether to include the request. It's called either after the operation is successfully resolved (via [the `didResolveOperation` event](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#didresolveoperation)), or when sending the final error response if the operation was not successfully resolved (via [the `willSendResponse` event](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#willsendresponse)).
176176

177177
If you don't want any usage reporting at all, don't use this option: instead, either avoid specifying an Apollo API key or explicitly [disable the plugin](#disabling-the-plugin).
178178

@@ -192,7 +192,7 @@ By default, all requests are included in usage reports.
192192

193193
Specify this function to provide Apollo Studio with client details for each processed request. Apollo Studio uses this information to [segment metrics by client](https://www.apollographql.com/docs/studio/client-awareness/).
194194

195-
This function is passed a [`GraphQLRequestContext`](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-types/src/index.ts#L115-L150) object containing all available information about the request. It should return an object with `clientName` and `clientVersion` fields that identify the associated client.
195+
This function is passed a [`GraphQLRequestContext`](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-types/src/index.ts#L115-L150) object containing all available information about the request. It should return an object with `clientName` and `clientVersion` fields that identify the associated client.
196196

197197
By default, the plugin attempts to obtain these values from the incoming request's HTTP headers (specifically, `apollographql-client-name` and `apollographql-client-version`).
198198

docs/source/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"Apollo Federation": "https://www.apollographql.com/docs/federation/",
1616
"New in v3": {
1717
"Migrating to Apollo Server 3": "/migration",
18-
"Changelog": "https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md"
18+
"Changelog": "https://github.com/apollographql/apollo-server/blob/version-3/CHANGELOG.md"
1919
},
2020
"Defining a Schema": {
2121
"Schema basics": "/schema/schema",

docs/source/data/data-sources.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ flowchart LR;
2626

2727
## Open-source implementations
2828

29-
All data source implementations extend the generic [`DataSource` abstract class](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-datasource/src/index.ts), which is included in the `apollo-datasource` package. Subclasses of a `DataSource` should define whatever logic is required to communicate with a particular store or API.
29+
All data source implementations extend the generic [`DataSource` abstract class](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-datasource/src/index.ts), which is included in the `apollo-datasource` package. Subclasses of a `DataSource` should define whatever logic is required to communicate with a particular store or API.
3030

3131
Apollo and the larger community maintain the following open-source implementations:
3232

33-
> Do you maintain a `DataSource` implementation that isn't listed here? Please [submit a PR](https://github.com/apollographql/apollo-server/blob/main/docs/source/data/data-sources.md) to be added to the list!
33+
> Do you maintain a `DataSource` implementation that isn't listed here? Please [submit a PR](https://github.com/apollographql/apollo-server/blob/version-3/docs/source/data/data-sources.md) to be added to the list!
3434
3535
| Class | Source | For Use With |
3636
|------------------|-----------|-----------------------|
37-
| [`RESTDataSource`](https://github.com/apollographql/apollo-server/tree/main/packages/apollo-datasource-rest) | Apollo | REST APIs ([see below](#restdatasource-reference)) |
37+
| [`RESTDataSource`](https://github.com/apollographql/apollo-server/tree/version-3/packages/apollo-datasource-rest) | Apollo | REST APIs ([see below](#restdatasource-reference)) |
3838
| [`HTTPDataSource`](https://github.com/StarpTech/apollo-datasource-http) | Community | HTTP/REST APIs (newer community alternative to `RESTDataSource`) |
3939
| [`SQLDataSource`](https://github.com/cvburgess/SQLDataSource) | Community | SQL databases (via [Knex.js](http://knexjs.org/)) |
4040
| [`MongoDataSource`](https://github.com/GraphQLGuide/apollo-datasource-mongodb/) | Community | MongoDB |
@@ -125,7 +125,7 @@ npm install apollo-datasource-rest
125125
You then extend the `RESTDataSource` class and implement whatever data-fetching methods your resolvers need. These methods can use built-in convenience methods (like `get` and `post`) to perform HTTP requests, helping you add query parameters, parse JSON results, and handle errors.
126126

127127
### API Reference
128-
To see the all the properties and functions that can be overridden, the [source code](https://github.com/apollographql/apollo-server/tree/main/packages/apollo-datasource-rest) is always the best option.
128+
To see the all the properties and functions that can be overridden, the [source code](https://github.com/apollographql/apollo-server/tree/version-3/packages/apollo-datasource-rest) is always the best option.
129129

130130
#### Constructor Parameters
131131
##### `httpFetch`
@@ -229,7 +229,7 @@ class MoviesAPI extends RESTDataSource {
229229

230230
### HTTP Methods
231231

232-
`RESTDataSource` includes convenience methods for common REST API request methods: `get`, `post`, `put`, `patch`, and `delete` ([see the source](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-datasource-rest/src/RESTDataSource.ts#L154-L202)).
232+
`RESTDataSource` includes convenience methods for common REST API request methods: `get`, `post`, `put`, `patch`, and `delete` ([see the source](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-datasource-rest/src/RESTDataSource.ts#L154-L202)).
233233

234234
An example of each is shown below:
235235

docs/source/data/errors.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Here's an example error response caused by misspelling the `__typename` field in
4242

4343
To help with debugging, Apollo Server defines error subclasses that represent different types of errors that can occur while handling a GraphQL operation (such as `SyntaxError` and `ValidationError`). These subclasses each return a different [error code](#error-codes), which enables requesting clients to respond differently to different error types.
4444

45-
These built-in error subclasses inherit from the generic `ApolloError` class, and they're all defined in [the `apollo-server-errors` package](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-errors/src/index.ts). You can also [create your own custom errors and codes](#custom-errors).
45+
These built-in error subclasses inherit from the generic `ApolloError` class, and they're all defined in [the `apollo-server-errors` package](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-errors/src/index.ts). You can also [create your own custom errors and codes](#custom-errors).
4646

4747
## Error codes
4848

docs/source/integrations/middleware.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ The set of common options supported by each package is listed under [Basic usage
232232

233233
## Basic usage
234234

235-
The sections below demonstrate how to initialize an `ApolloServer` instance with each package. More details are available in each package's [README](https://github.com/apollographql/apollo-server/tree/main/packages).
235+
The sections below demonstrate how to initialize an `ApolloServer` instance with each package. More details are available in each package's [README](https://github.com/apollographql/apollo-server/tree/version-3/packages).
236236

237237
Each section also lists the options supported by each package's `applyMiddleware` or `getMiddleware` or `createHandler` function. Learn more about how these options work in the [`ApolloServer` API reference](../api/apollo-server/#framework-specific-middleware-function).
238238

docs/source/integrations/plugins-event-reference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ const server = new ApolloServer({
229229

230230
## Request lifecycle events
231231

232-
> If you're using TypeScript to create your plugin, implement the [ `GraphQLRequestListener` interface](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-plugin-base/src/index.ts) from the `apollo-server-plugin-base` module to define functions for request lifecycle events.
232+
> If you're using TypeScript to create your plugin, implement the [ `GraphQLRequestListener` interface](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-plugin-base/src/index.ts) from the `apollo-server-plugin-base` module to define functions for request lifecycle events.
233233
234234
When Apollo Server processes a request, these events fire in the order listed (with the exception of `didEncounterErrors`, which might fire in one of a few places depending on when errors occur). [See the flow diagram](./plugins/#request-lifecycle-event-flow)
235235

docs/source/integrations/plugins.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const myPlugin = {
1919
};
2020
```
2121

22-
> If you're using TypeScript to create a plugin, the `apollo-server-plugin-base` module exports the [`ApolloServerPlugin` interface](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-plugin-base/src/index.ts) for plugins to implement.
22+
> If you're using TypeScript to create a plugin, the `apollo-server-plugin-base` module exports the [`ApolloServerPlugin` interface](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-plugin-base/src/index.ts) for plugins to implement.
2323
2424
You can define a plugin in the same file where you initialize Apollo Server, or
2525
you can export it as a separate module:
@@ -189,7 +189,7 @@ Note that the `validationDidStart` end hook receives an _array_ of errors that c
189189

190190
As the example above shows, `requestDidStart` and request lifecycle functions accept a `requestContext` parameter. This parameter is of type `GraphQLRequestContext`, which includes a `request` (of type `GraphQLRequest`), along with a `response` field (of type `GraphQLResponse`) if it's available.
191191

192-
These types and their related subtypes are all defined in [`apollo-server-types/src/index.ts`](https://github.com/apollographql/apollo-server/blob/main/packages/apollo-server-types/src/index.ts).
192+
These types and their related subtypes are all defined in [`apollo-server-types/src/index.ts`](https://github.com/apollographql/apollo-server/blob/version-3/packages/apollo-server-types/src/index.ts).
193193

194194
## Installing custom plugins
195195

docs/source/migration.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The focus of this major-version release is to provide a lighter, nimbler core li
1010

1111
This document explains which features _do_ require code changes and how to make them. If you encounter issues while migrating, please [create an issue](https://github.com/apollographql/apollo-server/issues/new/choose).
1212

13-
> For a list of all breaking changes, [see the changelog](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md).
13+
> For a list of all breaking changes, [see the changelog](https://github.com/apollographql/apollo-server/blob/version-3/CHANGELOG.md).
1414
1515

1616
## Bumped dependencies
@@ -184,7 +184,7 @@ import typeDefs from "./typeDefs";
184184
}
185185
}],
186186
});
187-
187+
188188
subscriptionServer = SubscriptionServer.create({
189189
schema,
190190
execute,
@@ -197,7 +197,7 @@ import typeDefs from "./typeDefs";
197197
server: httpServer,
198198
path: server.graphqlPath,
199199
});
200-
200+
201201
await server.start();
202202
server.applyMiddleware({ app });
203203

0 commit comments

Comments
 (0)