Skip to content

Commit

Permalink
Merge branch 'master' into unresolved-entity
Browse files Browse the repository at this point in the history
  • Loading branch information
mduesterhoeft authored Jun 19, 2020
2 parents f286663 + 589d4b3 commit cbea04d
Show file tree
Hide file tree
Showing 36 changed files with 687 additions and 160 deletions.
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@ The version headers in this history reflect the versions of Apollo Server itself

### vNEXT

- _Nothing yet! Stay tuned._
> 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.
- _Nothing yet! Stay tuned!_

### v2.15.0

- `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)
- `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)
- `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)
- `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)

### v2.14.5

- `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)

### v2.14.4

> 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.
- `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)
- `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)
- `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)
Expand Down
58 changes: 47 additions & 11 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"dependencies": {
"gatsby": "2.23.3",
"gatsby-theme-apollo-docs": "4.2.6",
"gatsby-theme-apollo-docs": "4.2.9",
"react": "16.13.1",
"react-dom": "16.13.1"
}
Expand Down
39 changes: 39 additions & 0 deletions docs/source/api/apollo-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,18 @@ addMockFunctionsToSchema({
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.
* `reportTiming`: Boolean | async (GraphQLRequestContextDidResolveOperation | GraphQLRequestContextDidEncounterErrors) => Boolean
Specify whether to instrument an operation to send traces and metrics to Apollo.
This may resolve to a boolean or a async function returning a promise resolving to a boolean.
If the option resolves to false for an operation the operation will not be instrumented
and no metrics information will be sent to Apollo.
The function will receive a `GraphQLRequestContextDidResolveOperation` with client and operation
information or a `GraphQLRequestContextDiDEncounterErrors` in the case an operation failed
to resolve properly. This allows the choice of whether to include a given request in trace
and metric reporting to be made on a per-request basis. The default value is true.
* `generateClientInfo`: (GraphQLRequestContext) => ClientInfo **AS 2.2**
Creates a client context(ClientInfo) based on the request pipeline's
Expand All @@ -500,3 +512,30 @@ addMockFunctionsToSchema({
> [WARNING] If you specify a `clientReferenceId`, Graph Manager will treat the
> `clientName` as a secondary lookup, so changing a `clientName` may result
> in an unwanted experience.
* `reportSchema`: boolean
Enables the automatic schema reporting feature of Apollo Server, which will
cause it to periodically report the server's schema (when changes are
detected) along with details about the runtime environment to Apollo Graph
Manager. This feature removes the need to register schemas manually via
`apollo service:push` in CI/CD pipelines.
* `overrideReportedSchema`: string
By default, the schema reported to Apollo Graph Manager will be normalized,
which may shift ordering and comments and remove whitespace. This option can
be used to override the default schema. Any schema provided will not undergo
normalization, which can be helpful to preserve details that normalization
removes.
* `schemaReportingInitialDelayMaxMs`: number
By default, the schema reporter will wait a random amount of time between 0
and 10 seconds before making its first report at reporter startup. A longer
range of times leads to more staggered starts, which reduces bandwidth
since it makes it less likely that multiple servers will get asked to upload
the same schema. However, in certain constrained environments (e.g. AWS
Lambda), this wait time may be less desirable. This option can be used to
change the maximum amount of time that the reporter will wait until it starts
sending reports.
10 changes: 8 additions & 2 deletions docs/source/integrations/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ the core `apollo-server` package:
| Middleware | Package |
|---|---|
| Express | `apollo-server-express` |
| Fastify | `apollo-server-fastify` |
| hapi | `apollo-server-hapi` |
| AWS Lambda | `apollo-server-lambda` |
| Koa | `apollo-server-koa` |
| hapi | `apollo-server-hapi` |
| Micro | `apollo-server-micro` |
| Fastify | `apollo-server-fastify` |
| Google Cloud Functions | `apollo-server-cloud-functions` |
| Azure Functions | `apollo-server-azure-functions` |
| Cloudflare | `apollo-server-cloudflare` |


If you've already installed the core `apollo-server` package, you can `npm uninstall`
it after installing an integration package.
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-engine-reporting/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-engine-reporting",
"version": "2.0.1",
"version": "2.2.0",
"description": "Send reports about your GraphQL services to Apollo Graph Manager (previously known as Apollo Engine)",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
Loading

0 comments on commit cbea04d

Please sign in to comment.