Skip to content

Commit

Permalink
apollo-server-core: fix plugins that depend on this (#2470)
Browse files Browse the repository at this point in the history
  • Loading branch information
glasser authored Mar 19, 2019
1 parent b2f5b18 commit dcd572f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### vNEXT

- Allow `GraphQLRequestListener` callbacks in plugins to depend on `this`. [PR #2470](https://github.com/apollographql/apollo-server/pull/2470)

### v2.4.8

- No functional changes in this version. The patch version has been bumped to fix the `README.md` displayed on the [npm package for `apollo-server`](https://npm.im/apollo-server) as a result of a broken publish. Apologies for the additional noise!
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-core/src/utils/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Dispatcher<T> {
this.targets.map(target => {
const method = target[methodName];
if (method && typeof method === 'function') {
return method(...args);
return method.apply(target, args);
}
}),
);
Expand All @@ -42,7 +42,7 @@ export class Dispatcher<T> {
for (const target of this.targets) {
const method = target[methodName];
if (method && typeof method === 'function') {
const didEndHook = method(...args);
const didEndHook = method.apply(target, args);
if (didEndHook) {
didEndHooks.push(didEndHook);
}
Expand Down

0 comments on commit dcd572f

Please sign in to comment.