Skip to content

Commit

Permalink
fix: report APQ hit/registration when sendHeaders is disabled. (#3986)
Browse files Browse the repository at this point in the history
* fix: report APQ hit/registration when `sendHeaders` is disabled.

This APQ flag reporting was almost surely changed incorrectly in #2931 and
not caught during review, causing this APQ boolean to not be properly set
when the request was, in fact, an APQ request, unless `sendHeaders` was
enabled - which it is _not_ by default after the change that released it.

Ref: https://github.com/apollographql/apollo-server/pull/2931/files#diff-24ae042112f9dcc18543ac851c4d8f7cR97-R102

* Add CHANGELOG.md for #3986.
  • Loading branch information
abernix committed Apr 16, 2020
1 parent eeec25f commit 7af676b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The version headers in this history reflect the versions of Apollo Server itself
### vNEXT

> 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-engine-reporting`: Fix inadvertant conditional formatting which prevented automated persisted query (APQ) hits and misses from being reported to Apollo Graph Manager. [PR #3986](https://github.com/apollographql/apollo-server/pull/3986)
- `apollo-server-lambda`: Support file uploads on AWS Lambda [Issue #1419](https://github.com/apollographql/apollo-server/issues/1419) [Issue #1703](https://github.com/apollographql/apollo-server/issues/1703) [PR #3926](https://github.com/apollographql/apollo-server/pull/3926)
- **breaking** `apollo-engine-reporting-protobuf`: Drop legacy fields that were never used by `apollo-engine-reporting`. Added new fields `StatsContext` to allow `apollo-server` to send summary stats instead of full traces, and renamed `FullTracesReport` to `Report` and `Traces` to `TracesAndStats` since reports now can include stats as well as traces.

Expand Down
12 changes: 6 additions & 6 deletions packages/apollo-engine-reporting/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ export class EngineReportingExtension<TContext = any>
o.request.headers,
this.options.sendHeaders,
);
}

if (o.requestContext.metrics.persistedQueryHit) {
this.treeBuilder.trace.persistedQueryHit = true;
}
if (o.requestContext.metrics.persistedQueryRegister) {
this.treeBuilder.trace.persistedQueryRegister = true;
}
if (o.requestContext.metrics.persistedQueryHit) {
this.treeBuilder.trace.persistedQueryHit = true;
}
if (o.requestContext.metrics.persistedQueryRegister) {
this.treeBuilder.trace.persistedQueryRegister = true;
}

if (o.variables) {
Expand Down

0 comments on commit 7af676b

Please sign in to comment.