Skip to content

Commit cbea04d

Browse files
Merge branch 'master' into unresolved-entity
2 parents f286663 + 589d4b3 commit cbea04d

File tree

36 files changed

+687
-160
lines changed

36 files changed

+687
-160
lines changed

CHANGELOG.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,23 @@ The version headers in this history reflect the versions of Apollo Server itself
77

88
### vNEXT
99

10-
- _Nothing yet! Stay tuned._
10+
> 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. With few exceptions, the format of the entry should follow convention (i.e., prefix with package name, use markdown `backtick formatting` for package names and code, suffix with a link to the change-set à la `[PR #YYY](https://link/pull/YYY)`, etc.). When a release is being prepared, a new header will be (manually) created below and the appropriate changes within that release will be moved into the new section.
11+
12+
- _Nothing yet! Stay tuned!_
13+
14+
### v2.15.0
15+
16+
- `apollo-engine-reporting`: Added a `reportTiming` API to allow trace reporting to be enabled or disabled on a per request basis. The option takes either a boolean or a predicate function that takes a [`GraphQLRequestContextDidResolveOperation`](https://github.com/apollographql/apollo-server/blob/a926b7eedbb87abab2ec70fb03d71743985cb18d/packages/apollo-server-types/src/index.ts#L185-L190) or [`GraphQLRequestContextDidEncounterErrors`](https://github.com/apollographql/apollo-server/blob/a926b7eedbb87abab2ec70fb03d71743985cb18d/packages/apollo-server-types/src/index.ts#L191-L195) and returns a boolean. If the boolean is false the request will not be instrumented for tracing and no trace will be sent to Apollo Graph Manager. The default is `true` so all traces will get instrumented and sent, which is the same as the previous default behavior. [PR #3918](https://github.com/apollographql/apollo-server/pull/3918)
17+
- `apollo-engine-reporting`: Removed `GraphQLServerOptions.reporting`. It isn't known whether a trace will be reported at the beginning of the request because of the above change. We believe this field was only used internally within Apollo Server; let us know if this is a problem and we can suggest alternatives. Additionally, the field `requestContext.metrics.captureTraces` is now initialized later in the request pipeline. [PR #3918](https://github.com/apollographql/apollo-server/pull/3918)
18+
- `apollo-engine-reporting`: Make Apollo Server throw if schema reporting is enabled for a gateway or federated service. [PR #4246](https://github.com/apollographql/apollo-server/pull/4246)
19+
- `apollo-engine-reporting`: Remove the `experimental_` prefix from schema reporting options, and specifically rename `experimental_schemaReporting` option name to `reportSchema`. (The old option names remain functional, but are deprecated.) [PR #4236](https://github.com/apollographql/apollo-server/pull/4236)
20+
21+
### v2.14.5
22+
23+
- `apollo-engine-reporting`: Make Apollo Server throw if schema reporting is enabled for a gateway or federated service. [PR #4246](https://github.com/apollographql/apollo-server/pull/4246)
1124

1225
### v2.14.4
1326

14-
> 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. With few exceptions, the format of the entry should follow convention (i.e., prefix with package name, use markdown `backtick formatting` for package names and code, suffix with a link to the change-set à la `[PR #YYY](https://link/pull/YYY)`, etc.).
15-
When a release is being prepared, a new header will be (manually) created below and the appropriate changes within that release will be moved into the new section.
1627
- `apollo-engine-reporting`: Add environment variable `APOLLO_SCHEMA_REPORTING` that can enable schema reporting. If `experimental__schemaReporting` is set it will override the environment variable. [PR #4206](https://github.com/apollographql/apollo-server/pull/4206)
1728
- `apollo-engine-reporting`: The schema reporting URL has been changed to use the new dedicated sub-domain `https://edge-server-reporting.api.apollographql.com`. [PR #4232](https://github.com/apollographql/apollo-server/pull/4232)
1829
- `apollo-server-core`: Though Apollo Server **is not affected** due to the way it is integrated, in response to [an upstream security advisory for GraphQL Playground](https://github.com/prisma-labs/graphql-playground/security/advisories/GHSA-4852-vrh7-28rf) we have published [the same patch](https://github.com/prisma-labs/graphql-playground/commit/bf1883db538c97b076801a60677733816cb3cfb7) on our `@apollographql/graphql-playground-html` fork and bumped Apollo Server to use it. Again, this was done out of an **abundance of caution** since the way that Apollo Server utilizes `renderPlaygroundPage` is _not_ vulnerable as it does not allow per-request Playground configuration that could allow interpolation of user-input. [PR #4231](https://github.com/apollographql/apollo-server/pull/4231)

docs/package-lock.json

Lines changed: 47 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"dependencies": {
99
"gatsby": "2.23.3",
10-
"gatsby-theme-apollo-docs": "4.2.6",
10+
"gatsby-theme-apollo-docs": "4.2.9",
1111
"react": "16.13.1",
1212
"react-dom": "16.13.1"
1313
}

docs/source/api/apollo-server.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,18 @@ addMockFunctionsToSchema({
480480
481481
A human-readable name for the variant of a schema (i.e. staging, EU). Setting this value will cause metrics to be segmented in the Apollo Graph Manager UI. Additionally schema validation with a graph variant will only check metrics associated with the same string.
482482
483+
* `reportTiming`: Boolean | async (GraphQLRequestContextDidResolveOperation | GraphQLRequestContextDidEncounterErrors) => Boolean
484+
485+
Specify whether to instrument an operation to send traces and metrics to Apollo.
486+
This may resolve to a boolean or a async function returning a promise resolving to a boolean.
487+
If the option resolves to false for an operation the operation will not be instrumented
488+
and no metrics information will be sent to Apollo.
489+
490+
The function will receive a `GraphQLRequestContextDidResolveOperation` with client and operation
491+
information or a `GraphQLRequestContextDiDEncounterErrors` in the case an operation failed
492+
to resolve properly. This allows the choice of whether to include a given request in trace
493+
and metric reporting to be made on a per-request basis. The default value is true.
494+
483495
* `generateClientInfo`: (GraphQLRequestContext) => ClientInfo **AS 2.2**
484496
485497
Creates a client context(ClientInfo) based on the request pipeline's
@@ -500,3 +512,30 @@ addMockFunctionsToSchema({
500512
> [WARNING] If you specify a `clientReferenceId`, Graph Manager will treat the
501513
> `clientName` as a secondary lookup, so changing a `clientName` may result
502514
> in an unwanted experience.
515+
516+
* `reportSchema`: boolean
517+
518+
Enables the automatic schema reporting feature of Apollo Server, which will
519+
cause it to periodically report the server's schema (when changes are
520+
detected) along with details about the runtime environment to Apollo Graph
521+
Manager. This feature removes the need to register schemas manually via
522+
`apollo service:push` in CI/CD pipelines.
523+
524+
* `overrideReportedSchema`: string
525+
526+
By default, the schema reported to Apollo Graph Manager will be normalized,
527+
which may shift ordering and comments and remove whitespace. This option can
528+
be used to override the default schema. Any schema provided will not undergo
529+
normalization, which can be helpful to preserve details that normalization
530+
removes.
531+
532+
* `schemaReportingInitialDelayMaxMs`: number
533+
534+
By default, the schema reporter will wait a random amount of time between 0
535+
and 10 seconds before making its first report at reporter startup. A longer
536+
range of times leads to more staggered starts, which reduces bandwidth
537+
since it makes it less likely that multiple servers will get asked to upload
538+
the same schema. However, in certain constrained environments (e.g. AWS
539+
Lambda), this wait time may be less desirable. This option can be used to
540+
change the maximum amount of time that the reporter will wait until it starts
541+
sending reports.

docs/source/integrations/middleware.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ the core `apollo-server` package:
1111
| Middleware | Package |
1212
|---|---|
1313
| Express | `apollo-server-express` |
14-
| Fastify | `apollo-server-fastify` |
15-
| hapi | `apollo-server-hapi` |
14+
| AWS Lambda | `apollo-server-lambda` |
1615
| Koa | `apollo-server-koa` |
16+
| hapi | `apollo-server-hapi` |
17+
| Micro | `apollo-server-micro` |
18+
| Fastify | `apollo-server-fastify` |
19+
| Google Cloud Functions | `apollo-server-cloud-functions` |
20+
| Azure Functions | `apollo-server-azure-functions` |
21+
| Cloudflare | `apollo-server-cloudflare` |
22+
1723

1824
If you've already installed the core `apollo-server` package, you can `npm uninstall`
1925
it after installing an integration package.

packages/apollo-engine-reporting/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apollo-engine-reporting",
3-
"version": "2.0.1",
3+
"version": "2.2.0",
44
"description": "Send reports about your GraphQL services to Apollo Graph Manager (previously known as Apollo Engine)",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)