Skip to content

Commit

Permalink
Merge pull request #4105 from apollographql/release-2.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix committed May 27, 2020
2 parents 7d6f234 + 20bfb5f commit 68a21f9
Show file tree
Hide file tree
Showing 77 changed files with 3,600 additions and 1,199 deletions.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,52 @@ The version headers in this history reflect the versions of Apollo Server itself
- _Nothing yet! Stay tuned!_

### v2.14.0

- `apollo-server-core` / `apollo-server-plugin-base`: Add support for `willResolveField` and corresponding end-handler within `executionDidStart`. This brings the remaining bit of functionality that was previously only available from `graphql-extensions` to the new plugin API. The `graphql-extensions` API (which was never documented) will be deprecated in Apollo Server 3.x. To see the documentation for the request pipeline API, see [its documentation](https://www.apollographql.com/docs/apollo-server/integrations/plugins/). For more details, see the attached PR. [PR #3988](https://github.com/apollographql/apollo-server/pull/3988)
- `apollo-server-core`: Deprecate `graphql-extensions`. All internal usages of the `graphql-extensions` API have been migrated to the request pipeline plugin API. For any implementor-supplied `extensions`, a deprecation warning will be printed once per-extension, per-server-startup, notifying of the intention to deprecate. Extensions should migrate to the plugin API, which is outlined in [its documentation](https://www.apollographql.com/docs/apollo-server/integrations/plugins/). [PR #4135](https://github.com/apollographql/apollo-server/pull/4135)
- `apollo-engine-reporting`: **Currently only for non-federated graphs.**
Added an _experimental_ schema reporting option,
`experimental_schemaReporting`, for Apollo Graph Manager users. **During
this experiment, we'd appreciate testing and feedback from current and new
users of the schema registry!**

Prior to the introduction of this feature, the only way to get schemas into
the schema registry in Apollo Graph Manager was to use the CLI and run
`apollo schema:push`. _Apollo schema reporting protocol_ is a *new*
specification for GraphQL servers to automatically report schemas to the
Apollo Graph Manager schema registry.

**To enable schema reporting,** provide a Graph Manager API key (available
free from [Apollo Graph Manager](https://engine.apollographql.com/)) in the
`APOLLO_KEY` environment variable *and* set the `experimental_schemaReporting`
option to `true` in the Apollo Server constructor options, like so:

```js
const server = new ApolloServer({
typeDefs,
resolvers,
engine: {
experimental_schemaReporting: true,
/* Other existing options can remain the same. */
},
});
```

> When enabled, a schema reporter is initiated by the `apollo-engine-reporting` agent. It will loop until the `ApolloServer` instance is stopped, periodically calling back to Apollo Graph Manager to send information. The life-cycle of this reporter is managed by the agent.
For more details on the implementation of this new protocol, see the PR which
introduced it to Apollo Server and the [preview documentation](https://github.com/apollographql/apollo-schema-reporting-preview-docs).

[PR #4084](https://github.com/apollographql/apollo-server/pull/4084)
- `apollo-engine-reporting`: The underlying integration of this plugin, which instruments and traces the graph's resolver performance and transmits these metrics to [Apollo Graph Manager](https://engine.apollographql.com/), has been changed from the (soon to be deprecated) `graphql-extensions` API to the new [request pipeline `plugins` API](https://www.apollographql.com/docs/apollo-server/integrations/plugins/). [PR #3998](https://github.com/apollographql/apollo-server/pull/3998)

_This change should be purely an implementation detail for a majority of users_. There are, however, some special considerations which are worth noting:

- The federated tracing plugin's `ftv1` response on `extensions` (which is present on the response from an implementing service to the gateway) is now placed on the `extensions` _after_ the `formatResponse` hook. Anyone leveraging the `extensions`.`ftv1` data from the `formatResponse` hook will find that it is no longer present at that phase.
- `apollo-tracing`: This package's internal integration with Apollo Server has been switched from using the soon-to-be-deprecated `graphql-extensions` API to using [the request pipeline plugin API](https://www.apollographql.com/docs/apollo-server/integrations/plugins/). Behavior should remain otherwise the same. [PR #3991](https://github.com/apollographql/apollo-server/pull/3991)
- `apollo-cache-control`: This package's internal integration with Apollo Server has been switched from using the soon-to-be-deprecated `graphql-extensions` API to using [the request pipeline plugin API](https://www.apollographql.com/docs/apollo-server/integrations/plugins/). Behavior should remain otherwise the same. [PR #3997](https://github.com/apollographql/apollo-server/pull/3997)

### v2.13.0

> [See complete versioning details.](https://github.com/apollographql/apollo-server/commit/e37384a49b2bf474eed0de3e9f4a1bebaeee64c7)
Expand Down
10 changes: 8 additions & 2 deletions docs/source/api/apollo-server.md
Expand Up @@ -404,7 +404,7 @@ addMockFunctionsToSchema({

- `{ none: true }`: Don't send any variable values. **(DEFAULT)**
- `{ all: true }`: Send all variable values.
- `{ transform: ({ variables, operationString}) => { ... } }`: A custom function for modifying variable values. Keys added by the custom function will be removed, and keys removed will be added back with an empty value. For security reasons, if an error occurs within this function, all variable values will be replaced with `[PREDICATE_FUNCTION_ERROR]`.
- `{ transform: ({ variables, operationString}) => { ... } }`: A custom function for modifying variable values. Keys added by the custom function will be removed, and keys removed will be added back with an empty value. For security reasons, if an error occurs within this function, all variable values will be replaced with `[PREDICATE_FUNCTION_ERROR]`.
- `{ exceptNames: [...] }`: A case-sensitive list of names of variables whose values should not be sent to Apollo servers.
- `{ onlyNames: [...] }`: A case-sensitive list of names of variables whose values will be sent to Apollo servers.

Expand Down Expand Up @@ -472,7 +472,13 @@ addMockFunctionsToSchema({

* `schemaTag`: String

A human-readable name to tag this variant of a schema (i.e. staging, EU). Setting this value will cause metrics to be segmented in the Apollo Platform's UI. Additionally schema validation with a schema tag will only check metrics associate with the same string.
> Will be deprecated in 3.0. Use the option `graphVariant` instead.
A human-readable name to tag this variant of a schema (i.e. staging, EU). Setting this value will cause metrics to be segmented in the Apollo Platform's UI. Additionally schema validation with a schema tag will only check metrics associated with the same string.

* `graphVariant`: String

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.

* `generateClientInfo`: (GraphQLRequestContext) => ClientInfo **AS 2.2**

Expand Down
26 changes: 22 additions & 4 deletions docs/source/integrations/plugins.md
Expand Up @@ -121,17 +121,18 @@ The following diagram illustrates the sequence of events that fire for each requ

```mermaid
graph TB;
request(requestDidStart) --> parsing(parsingDidStart*);
request(requestDidStart) --> resolveSource(didResolveSource);
resolveSource --"Success"--> parsing(parsingDidStart*);
parsing --"Success"--> validation(validationDidStart*);
validation --"Success"--> resolve(didResolveOperation);
resolve --"Success"--> response(responseForOperation);
validation --"Success"--> resolveOperation(didResolveOperation);
resolveOperation --"Success"--> response(responseForOperation);
execution(executionDidStart*);
errors(didEncounterErrors);
response --"Response provided"--> send;
response --"No response provided"--> execution;
execution --"Success"--> send(willSendResponse);
execution & resolve & parsing & validation --"Failure"--> errors;
execution & resolveSource & resolveOperation & parsing & validation --"Failure"--> errors;
errors --> send;
class server,request secondary;
```
Expand Down Expand Up @@ -313,6 +314,23 @@ should not return a value.

> If you're using TypeScript to create your plugin, implement the [ `GraphQLRequestListener` interface](https://github.com/apollographql/apollo-server/blob/master/packages/apollo-server-plugin-base/src/index.ts) from the `apollo-server-plugin-base` module to define functions for request lifecycle events.
### `didResolveSource`

The `didResolveSource` event is invoked after Apollo Server has determined the
`String`-representation of the incoming operation that it will act upon. In the
event that this `String` was not directly passed in from the client, this
may be retrieved from a cache store (e.g., Automated Persisted Queries).

At this stage, there is not a guarantee that the operation is not malformed.

```typescript
didResolveSource?(
requestContext: WithRequired<
GraphQLRequestContext<TContext>, 'source' | 'logger'>,
>,
): ValueOrPromise<void>;
```

### `parsingDidStart`

The `parsingDidStart` event fires whenever Apollo Server will parse a GraphQL
Expand Down
20 changes: 17 additions & 3 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -86,6 +86,7 @@
"@types/supertest": "^2.0.8",
"@types/test-listen": "1.1.0",
"@types/type-is": "1.6.3",
"@types/uuid": "^7.0.3",
"@types/ws": "7.2.4",
"apollo-fetch": "0.7.0",
"apollo-link": "1.2.14",
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-cache-control/package.json
@@ -1,6 +1,6 @@
{
"name": "apollo-cache-control",
"version": "0.10.1-alpha.0",
"version": "0.11.0",
"description": "A GraphQL extension for cache control",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -12,7 +12,7 @@
},
"dependencies": {
"apollo-server-env": "file:../apollo-server-env",
"graphql-extensions": "file:../graphql-extensions"
"apollo-server-plugin-base": "file:../apollo-server-plugin-base"
},
"peerDependencies": {
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
Expand Down

This file was deleted.

0 comments on commit 68a21f9

Please sign in to comment.