Merge branch 'release-2.4.0' into HEAD

This commit is contained in:
Jesse Rosenberger 2019-01-23 15:15:11 +02:00
commit a14eddfdc5
No known key found for this signature in database
GPG key ID: C0CCCF81AA6C08D8
9 changed files with 629 additions and 506 deletions

View file

@ -1,5 +1,9 @@
# Changelog
### vNEXT
- Switch from `json-stable-stringify` to `fast-json-stable-stringify`. [PR #2065](https://github.com/apollographql/apollo-server/pull/2065)
### v2.3.1
- Provide types for `graphql-upload` in a location where they can be accessed by TypeScript consumers of `apollo-server` packages. [ccf935f9](https://github.com/apollographql/apollo-server/commit/ccf935f9) [Issue #2092](https://github.com/apollographql/apollo-server/issues/2092)

View file

@ -30,11 +30,11 @@ server.listen().then(({ url }) => {
The API key can also be set with the `ENGINE_API_KEY` environment variable. Setting an environment variable can be done in commandline as seen below or with the [dotenv npm package](https://www.npmjs.com/package/dotenv).
```bash
#Replace YOUR_API_KEY with the api key for you service in the Engine UI
# Replace YOUR_API_KEY with the API key provided within Apollo Engine.
ENGINE_API_KEY=YOUR_API_KEY node start-server.js
```
### Client Awareness
### Client awareness
Apollo Engine accepts metrics annotated with client information. The Engine UI
is then able to filter metrics and usage patterns by these names and versions. To provide metrics to the Engine, pass a `generateClientInfo` function into the `ApolloServer` constructor, like so:
@ -78,9 +78,11 @@ server.listen().then(({ url }) => {
Apollo Server provides two ways to log a server: per input, response, and errors or periodically throughout a request's lifecycle. Treating the GraphQL execution as a black box by logging the inputs and outputs of the system allows developers to diagnose issues quickly without being mired by lower level logs. Once a problem has been found at a high level, the lower level logs enable accurate tracing of how a request was handled.
### High Level Logging
### High-level logging
To log, Apollo Server provides: `formatError` and `formatResponse`. This example uses `console.log` to record the information, servers can use other more sophisticated tools.
Apollo Server allows `formatError` and `formatResponse` configuration options which can be defined as callback-functions which receive `error` or `response` arguments respectively.
For the sake of simplicity, these examples use `console.log` to output error and debugging information though a more complete example might utilize existing logging or error-reporting facilities.
```js
const server = new ApolloServer({
@ -101,7 +103,7 @@ server.listen().then(({ url }) => {
});
```
### Granular Logs
### Granular logs
For more advanced cases, Apollo Server provides an experimental api that accepts an array of `graphql-extensions` to the `extensions` field. These extensions receive a variety of lifecycle calls for each phase of a GraphQL request and can keep state, such as the request headers.

1070
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -34,7 +34,7 @@
"node": ">=6"
},
"dependencies": {
"@apollographql/apollo-tools": "^0.2.6",
"@apollographql/apollo-tools": "^0.3.0",
"apollo-cache-control": "file:packages/apollo-cache-control",
"apollo-datasource": "file:packages/apollo-datasource",
"apollo-datasource-rest": "file:packages/apollo-datasource-rest",
@ -64,24 +64,24 @@
},
"devDependencies": {
"@types/async-retry": "1.2.1",
"@types/aws-lambda": "8.10.15",
"@types/aws-lambda": "8.10.17",
"@types/body-parser": "1.17.0",
"@types/connect": "3.4.32",
"@types/fast-json-stable-stringify": "^2.0.0",
"@types/fibers": "0.0.30",
"@types/graphql": "14.0.3",
"@types/hapi": "17.8.1",
"@types/jest": "23.3.10",
"@types/json-stable-stringify": "1.0.32",
"@types/graphql": "14.0.5",
"@types/hapi": "17.8.4",
"@types/jest": "23.3.13",
"@types/koa-multer": "1.0.0",
"@types/koa-router": "7.0.35",
"@types/lodash": "4.14.119",
"@types/koa-router": "7.0.38",
"@types/lodash": "4.14.120",
"@types/lru-cache": "4.1.1",
"@types/memcached": "2.2.5",
"@types/micro": "7.3.3",
"@types/multer": "1.3.7",
"@types/node": "10.12.15",
"@types/node": "10.12.18",
"@types/node-fetch": "2.1.4",
"@types/redis": "2.8.8",
"@types/redis": "2.8.10",
"@types/request": "2.48.1",
"@types/request-promise": "4.1.42",
"@types/test-listen": "1.1.0",
@ -98,19 +98,19 @@
"fastify": "1.13.0",
"fibers": "3.1.1",
"form-data": "2.3.3",
"graphql": "14.0.2",
"graphql": "14.1.1",
"graphql-subscriptions": "1.0.0",
"graphql-tag": "2.10.0",
"graphql-tag": "2.10.1",
"graphql-tools": "4.0.3",
"hapi": "17.8.1",
"husky": "1.2.1",
"husky": "1.3.1",
"jest": "23.6.0",
"jest-junit": "5.2.0",
"jest-matcher-utils": "23.6.0",
"js-sha256": "0.9.0",
"koa": "2.6.2",
"koa-multer": "1.0.2",
"lerna": "3.6.0",
"lerna": "3.10.6",
"lint-staged": "8.1.0",
"memcached-mock": "0.1.0",
"meteor-promise": "0.8.7",
@ -120,17 +120,17 @@
"prettier": "1.15.3",
"prettier-check": "2.0.0",
"qs-middleware": "1.0.3",
"redis-mock": "0.41.0",
"redis-mock": "0.42.0",
"request": "2.88.0",
"request-promise": "4.2.2",
"subscriptions-transport-ws": "0.9.15",
"supertest": "3.3.0",
"supertest": "3.4.2",
"test-listen": "1.1.0",
"ts-jest": "23.10.5",
"tslint": "5.11.0",
"typescript": "3.2.2",
"tslint": "5.12.1",
"typescript": "3.2.4",
"ws": "6.1.2",
"yup": "0.26.5"
"yup": "0.26.7"
},
"jest": {
"projects": [

View file

@ -24,7 +24,7 @@
"node": ">=6"
},
"dependencies": {
"@apollographql/apollo-tools": "^0.2.6",
"@apollographql/apollo-tools": "^0.3.0",
"@apollographql/graphql-playground-html": "^1.6.6",
"@types/ws": "^6.0.0",
"apollo-cache-control": "file:../apollo-cache-control",
@ -35,12 +35,12 @@
"apollo-server-errors": "file:../apollo-server-errors",
"apollo-server-plugin-base": "file:../apollo-server-plugin-base",
"apollo-tracing": "file:../apollo-tracing",
"fast-json-stable-stringify": "^2.0.0",
"graphql-extensions": "file:../graphql-extensions",
"graphql-subscriptions": "^1.0.0",
"graphql-tag": "^2.9.2",
"graphql-tools": "^4.0.0",
"graphql-upload": "^8.0.2",
"json-stable-stringify": "^1.0.1",
"lodash": "^4.17.10",
"subscriptions-transport-ws": "^0.9.11",
"ws": "^6.0.0"

View file

@ -1,7 +1,7 @@
import { parse } from 'graphql/language';
import { execute, ExecutionResult } from 'graphql/execution';
import { getIntrospectionQuery, IntrospectionSchema } from 'graphql/utilities';
import stableStringify from 'json-stable-stringify';
import stableStringify from 'fast-json-stable-stringify';
import { GraphQLSchema } from 'graphql/type';
import { createHash } from 'crypto';

View file

@ -15,6 +15,6 @@
"graphql-extensions": "file:../graphql-extensions"
},
"peerDependencies": {
"graphql": "0.10.x - 14.0.x"
"graphql": "0.10.x - 14.1.x"
}
}

View file

@ -14,7 +14,7 @@
"node": ">=6.0"
},
"dependencies": {
"@apollographql/apollo-tools": "^0.2.6"
"@apollographql/apollo-tools": "^0.3.0"
},
"devDependencies": {
"apollo-server-core": "file:../apollo-server-core",

View file

@ -0,0 +1 @@
export default function stringify(obj: any): string;