Skip to content

Commit

Permalink
docs: Document new fetcher on @apollo/gateway.
Browse files Browse the repository at this point in the history
Follows-up: #3783
Follows-up: #3829
  • Loading branch information
abernix authored Mar 12, 2020
1 parent 945dd29 commit 27dee37
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/source/api/apollo-gateway.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,30 @@ example of using `ApolloGateway`, see [Implementing a federated graph](/federati

If `true`, the gateway logs startup messages, along with the query plan for
each incoming request. The default value is `false`.

* `fetcher`: `typeof fetch`

When specified, overrides the default
[Fetch API](https://fetch.spec.whatwg.org/#fetch-api) implementation
which is used when communicating with downstream servcies. By default,
[`make-fetch-happen`](https://npm.im/make-fetch-happen) is used with its
default settings. Another compliant implementation can be provided
(e.g. [`node-fetch`](https://npm.im/node-fetch) by setting
`fetcher: require('node-fetch')`) or different [default options for
`make-fetch-happen`](https://www.npmjs.com/package/make-fetch-happen#extra-options)
can be defined entirely. E.g.:

```javascript
const gateway = new ApolloGateway({
/* ... */
fetcher: require('make-fetch-happen').defaults({
onRetry() {
console.log('we will retry!')
},
}),
/* ... */
});
```

* `experimental_approximateQueryPlanStoreMiB`: `number`

Expand Down

0 comments on commit 27dee37

Please sign in to comment.