You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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)
Copy file name to clipboardExpand all lines: docs/source/api/apollo-server.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -300,7 +300,7 @@ Provide this function to transform the structure of error objects before they're
300
300
</td>
301
301
<td>
302
302
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.
Copy file name to clipboardExpand all lines: docs/source/api/plugin/usage-reporting.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,7 @@ Specify this asynchronous function to configure which requests are included in u
172
172
173
173
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.
174
174
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)).
176
176
177
177
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).
178
178
@@ -192,7 +192,7 @@ By default, all requests are included in usage reports.
192
192
193
193
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/).
194
194
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.
196
196
197
197
By default, the plugin attempts to obtain these values from the incoming request's HTTP headers (specifically, `apollographql-client-name` and `apollographql-client-version`).
Copy file name to clipboardExpand all lines: docs/source/data/data-sources.mdx
+5-5
Original file line number
Diff line number
Diff line change
@@ -26,15 +26,15 @@ flowchart LR;
26
26
27
27
## Open-source implementations
28
28
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.
30
30
31
31
Apollo and the larger community maintain the following open-source implementations:
32
32
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!
|[`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)) |
38
38
|[`HTTPDataSource`](https://github.com/StarpTech/apollo-datasource-http)| Community | HTTP/REST APIs (newer community alternative to `RESTDataSource`) |
39
39
|[`SQLDataSource`](https://github.com/cvburgess/SQLDataSource)| Community | SQL databases (via [Knex.js](http://knexjs.org/)) |
40
40
|[`MongoDataSource`](https://github.com/GraphQLGuide/apollo-datasource-mongodb/)| Community | MongoDB |
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.
126
126
127
127
### 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.
129
129
130
130
#### Constructor Parameters
131
131
##### `httpFetch`
@@ -229,7 +229,7 @@ class MoviesAPI extends RESTDataSource {
229
229
230
230
### HTTP Methods
231
231
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)).
Copy file name to clipboardExpand all lines: docs/source/data/errors.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ Here's an example error response caused by misspelling the `__typename` field in
42
42
43
43
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.
44
44
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).
Copy file name to clipboardExpand all lines: docs/source/integrations/middleware.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -232,7 +232,7 @@ The set of common options supported by each package is listed under [Basic usage
232
232
233
233
## Basic usage
234
234
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).
236
236
237
237
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).
Copy file name to clipboardExpand all lines: docs/source/integrations/plugins-event-reference.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -229,7 +229,7 @@ const server = new ApolloServer({
229
229
230
230
## Request lifecycle events
231
231
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.
233
233
234
234
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)
Copy file name to clipboardExpand all lines: docs/source/integrations/plugins.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ const myPlugin = {
19
19
};
20
20
```
21
21
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.
23
23
24
24
You can define a plugin in the same file where you initialize Apollo Server, or
25
25
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
189
189
190
190
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.
191
191
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).
Copy file name to clipboardExpand all lines: docs/source/migration.mdx
+3-3
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The focus of this major-version release is to provide a lighter, nimbler core li
10
10
11
11
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).
12
12
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).
14
14
15
15
16
16
## Bumped dependencies
@@ -184,7 +184,7 @@ import typeDefs from "./typeDefs";
184
184
}
185
185
}],
186
186
});
187
-
187
+
188
188
subscriptionServer =SubscriptionServer.create({
189
189
schema,
190
190
execute,
@@ -197,7 +197,7 @@ import typeDefs from "./typeDefs";
0 commit comments