diff --git a/CHANGELOG.md b/CHANGELOG.md index f58fce271a9..71b41dec8a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package-lock.json b/package-lock.json index 43240132a93..5a5cea3e835 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1331,12 +1331,6 @@ "integrity": "sha512-0uZZ+nffpr480zwwUXsk0Z5O0szllffNW1EbkI+dDzKhNKhiX4QOwpwK37WpKIpaPLk9V8U9y2We/VOeD6zyhQ==", "dev": true }, - "@types/json-stable-stringify": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz", - "integrity": "sha512-q9Q6+eUEGwQkv4Sbst3J4PNgDOvpuVuKj79Hl/qnmBMEIPzB5QoFRUtjcgcg2xNUZyYUGXBk5wYIBKHt0A+Mxw==", - "dev": true - }, "@types/keygrip": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.1.tgz", @@ -2163,12 +2157,12 @@ "apollo-server-errors": "file:packages/apollo-server-errors", "apollo-server-plugin-base": "file:packages/apollo-server-plugin-base", "apollo-tracing": "file:packages/apollo-tracing", + "fast-json-stable-stringify": "^2.0.0", "graphql-extensions": "file:packages/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" @@ -8222,14 +8216,6 @@ "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", "dev": true }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "requires": { - "jsonify": "~0.0.0" - } - }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -8251,11 +8237,6 @@ "graceful-fs": "^4.1.6" } }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" - }, "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", diff --git a/package.json b/package.json index d35c9a3bee2..edaba3c0bb1 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "@types/graphql": "14.0.3", "@types/hapi": "17.8.2", "@types/jest": "23.3.10", - "@types/json-stable-stringify": "1.0.32", "@types/koa-multer": "1.0.0", "@types/koa-router": "7.0.35", "@types/lodash": "4.14.119", diff --git a/packages/apollo-server-core/package.json b/packages/apollo-server-core/package.json index 605e524d14f..c02ce0fff65 100644 --- a/packages/apollo-server-core/package.json +++ b/packages/apollo-server-core/package.json @@ -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" diff --git a/packages/apollo-server-core/src/utils/schemaHash.ts b/packages/apollo-server-core/src/utils/schemaHash.ts index d790a3146f7..a1b01b3628f 100644 --- a/packages/apollo-server-core/src/utils/schemaHash.ts +++ b/packages/apollo-server-core/src/utils/schemaHash.ts @@ -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'; diff --git a/types/fast-json-stable-stringify/index.d.ts b/types/fast-json-stable-stringify/index.d.ts new file mode 100644 index 00000000000..c94014460d9 --- /dev/null +++ b/types/fast-json-stable-stringify/index.d.ts @@ -0,0 +1 @@ +export default function stringify(obj: any): string;