Skip to content

Commit c610ba6

Browse files
committed
Naming docs fixes
1 parent 9b9590b commit c610ba6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/source/federation/implementing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,16 @@ server.listen().then(({ url }) => {
199199

200200
By leveraging the `buildService` function, we're able to customize how requests are sent to our federated services. In this example, we return a custom `RemoteGraphQLDataSource`. The datasource allows us to modify the outgoing request with information from the Apollo Server `context` before it's sent. Here, we're adding the `user-id` header to pass an authenticated user id to downstream services.
201201

202-
In a similar vein, the `didReceiveResponse` hook allows us to inspect a service's `response` in order to modify the `context`. The lifecycle of a request to a federated server involves a number of responses, which may contain headers that need to be passed back to the client. Suppose our services report back their id via a `Service-Id` header.
202+
In a similar vein, the `didReceiveResponse` hook allows us to inspect a service's `response` in order to modify the `context`. The lifecycle of a request to a federated server involves a number of responses, which may contain headers that need to be passed back to the client. Suppose our services report back their id via a `Server-Id` header.
203203

204204
![Flowchart demonstrating willSendResponse usage](../images/willSendResponse-flowchart.png)
205205

206-
To implement this, we can aggregate the service IDs into a single, comma-separated list in our final response using the `didReceiveResponse` hook and an `ApolloServerPlugin`:
206+
To implement this, we can aggregate the server IDs into a single, comma-separated list in our final response using the `didReceiveResponse` hook and an `ApolloServerPlugin`:
207207
```javascript
208208
const { ApolloServer } = require('apollo-server');
209209
const { ApolloGateway, RemoteGraphQLDataSource } = require('@apollo/gateway');
210210

211-
class DataSourceWithCacheControl extends RemoteGraphQLDataSource {
211+
class DataSourceWithServerId extends RemoteGraphQLDataSource {
212212
// highlight-start
213213
async didReceiveResponse(response, request, context) {
214214
const body = await super.didReceiveResponse(response, request, context);

0 commit comments

Comments
 (0)