Skip to content

Commit

Permalink
Fix isGraphQLQuery check in response-cache plugin (#2792)
Browse files Browse the repository at this point in the history
* Fix isGraphQLQuery check

* Update CHANGELOG.md
  • Loading branch information
fabsrc authored and abernix committed Jun 25, 2019
1 parent d767397 commit 0ae49d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The version headers in this history reflect the versions of Apollo Server itself
> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. When a release is being prepared, a new header will be (manually) created below and the the appropriate changes within that release will be moved into the new section.
- `apollo-server-core`: Avoid duplicate `cacheControl` directives being added via `isDirectiveDefined`. [PR #2762](https://github.com/apollographql/apollo-server/pull/2762) (was reverted in 2.6.1 because previous implementation released in 2.6.0 broke passing in typedefs as a string)
- `apollo-server-plugin-response-cache`: Fix undefined property access attempt which occurred when an incomplete operation was received. [PR #2792](https://github.com/apollographql/apollo-server/pull/2792) [Issue #2745](https://github.com/apollographql/apollo-server/issues/2745)

### v2.6.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ function cacheKeyString(key: CacheKey) {
}

function isGraphQLQuery(requestContext: GraphQLRequestContext<any>) {
return requestContext.operation!.operation === 'query';
return (
requestContext.operation && requestContext.operation.operation === 'query'
);
}

export default function plugin(
Expand Down

0 comments on commit 0ae49d3

Please sign in to comment.