Skip to content

Commit

Permalink
Update RESTDataSource docs for correctness (#7361)
Browse files Browse the repository at this point in the history
`willSendRequest` now has a path first argument, which our docs don't
currently reflect.

Ref: apollographql/datasource-rest/#152
  • Loading branch information
trevor-scheer committed Feb 6, 2023
1 parent 96ec774 commit 0083fd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/data/fetching-rest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class PersonalizationAPI extends RESTDataSource {
}

// highlight-start
override willSendRequest(request: AugmentedRequest) {
override willSendRequest(_path: string, request: AugmentedRequest) {
request.headers['authorization'] = this.token;
}
// highlight-end
Expand Down Expand Up @@ -446,7 +446,7 @@ class PersonalizationAPI extends RESTDataSource {
}

// highlight-start
override willSendRequest(request: AugmentedRequest) {
override willSendRequest(_path: string, request: AugmentedRequest) {
request.params.set('api_key', this.token);
}
// highlight-end
Expand Down Expand Up @@ -522,7 +522,7 @@ class PersonalizationAPI extends RESTDataSource {
this.token = options.token;
}

override willSendRequest(request: AugmentedRequest) {
override willSendRequest(_path: string, request: AugmentedRequest) {
request.headers['authorization'] = this.token;
}

Expand Down

0 comments on commit 0083fd5

Please sign in to comment.