diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f523b2224..03e5c2e4651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -533,7 +533,7 @@ The version headers in this history reflect the versions of Apollo Server itself - `apollo-datasource-rest`: If another `Content-type` is already set on the response, don't overwrite it with `application/json`, allowing the user's initial `Content-type` to prevail. [PR #2520](https://github.com/apollographql/apollo-server/issues/2035) - Don't add `cacheControl` directive if one has already been defined. [PR #2428](https://github.com/apollographql/apollo-server/pull/2428) - `apollo-cache-control`: Do not respond with `Cache-control` headers if the HTTP response contains `errors`. [PR #2715](https://github.com/apollographql/apollo-server/pull/2715) -- `apollo-server-core`: Skip loading `util.promisify` polyfill in Node.js engines >= 8.0 [PR #2278](https://github.com/apollographql/apollo-server/pull/2278) +- `apollo-server-core`: Skip loading `util.promisify`, `Array.flat`, `Array.flatMap`, and `Object.fromEntries` polyfills, none of which are needed in Node 12+. [PR #2278](https://github.com/apollographql/apollo-server/pull/2278) [PR #FIXME](https://github.com/apollographql/apollo-server/pull/FIXME) - `apollo-server-core`: Lazy load `subscriptions-transport-ws` in core [PR #2278](https://github.com/apollographql/apollo-server/pull/2278) - `apollo-server-cache-redis`: **BREAKING FOR USERS OF `apollo-server-cache-redis`** (This is a package that must be updated separately but shares the same `CHANGELOG.md` with Apollo Server itself.) A new **major** version of this package has been published and updated to support Redis Standalone, Cluster and Sentinel modes. This is a breaking change since it is now based on [`ioredis`](https://github.com/luin/ioredis) instead of [`node_redis`](https://github.com/NodeRedis/node_redis). Although this update is compatible with the most common uses of `apollo-server-cache-redis`, please check the [options supported by `ioredis`](https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options) while updating to this version. The constructor options are passed directly from `RedisCache` to the new Redis adapter. The pre-1.0 versions should continue to work with Apollo Server without modification. [PR #1770](https://github.com/apollographql/apollo-server/pull/1770) diff --git a/package-lock.json b/package-lock.json index 3de97609f71..c81ebed8830 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@apollographql/apollo-tools": "0.5.0", + "@apollographql/apollo-tools": "0.5.1", "apollo-datasource": "file:packages/apollo-datasource", "apollo-datasource-rest": "file:packages/apollo-datasource-rest", "apollo-reporting-protobuf": "file:packages/apollo-reporting-protobuf", @@ -143,11 +143,9 @@ "license": "MIT" }, "node_modules/@apollographql/apollo-tools": { - "version": "0.5.0", - "license": "MIT", - "dependencies": { - "apollo-env": "^0.10.0" - }, + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.1.tgz", + "integrity": "sha512-ZII+/xUFfb9ezDU2gad114+zScxVFMVlZ91f8fGApMzlS1kkqoyLnC4AJaQ1Ya/X+b63I20B4Gd+eCL8QuB4sA==", "engines": { "node": ">=8", "npm": ">=6" @@ -4579,6 +4577,7 @@ }, "node_modules/@types/node-fetch": { "version": "2.5.10", + "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", @@ -4587,6 +4586,7 @@ }, "node_modules/@types/node-fetch/node_modules/form-data": { "version": "3.0.1", + "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", @@ -5028,19 +5028,6 @@ "resolved": "packages/apollo-datasource-rest", "link": true }, - "node_modules/apollo-env": { - "version": "0.10.0", - "license": "MIT", - "dependencies": { - "@types/node-fetch": "^2.5.10", - "core-js": "^3.0.1", - "node-fetch": "^2.6.1", - "sha.js": "^2.4.11" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/apollo-graphql": { "version": "0.9.2", "license": "MIT", @@ -5378,6 +5365,7 @@ }, "node_modules/asynckit": { "version": "0.4.0", + "dev": true, "license": "MIT" }, "node_modules/at-least-node": { @@ -6324,6 +6312,7 @@ }, "node_modules/combined-stream": { "version": "1.0.8", + "dev": true, "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" @@ -6722,15 +6711,6 @@ "version": "2.0.1", "license": "MIT" }, - "node_modules/core-js": { - "version": "3.11.1", - "hasInstallScript": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/core-js-pure": { "version": "3.11.0", "hasInstallScript": true, @@ -7020,6 +7000,7 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=0.4.0" @@ -17767,7 +17748,7 @@ "version": "3.0.0-alpha.4", "license": "MIT", "dependencies": { - "@apollographql/apollo-tools": "^0.5.0", + "@apollographql/apollo-tools": "^0.5.1", "@apollographql/graphql-playground-html": "1.6.29", "@graphql-tools/mock": "^8.1.2", "@graphql-tools/schema": "^7.1.5", @@ -17796,6 +17777,15 @@ "graphql": "^15.3.0" } }, + "packages/apollo-server-core/node_modules/@apollographql/apollo-tools": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.1.tgz", + "integrity": "sha512-ZII+/xUFfb9ezDU2gad114+zScxVFMVlZ91f8fGApMzlS1kkqoyLnC4AJaQ1Ya/X+b63I20B4Gd+eCL8QuB4sA==", + "engines": { + "node": ">=8", + "npm": ">=6" + } + }, "packages/apollo-server-core/node_modules/apollo-graphql": { "version": "0.9.0", "license": "MIT", @@ -18547,10 +18537,9 @@ } }, "@apollographql/apollo-tools": { - "version": "0.5.0", - "requires": { - "apollo-env": "^0.10.0" - } + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.1.tgz", + "integrity": "sha512-ZII+/xUFfb9ezDU2gad114+zScxVFMVlZ91f8fGApMzlS1kkqoyLnC4AJaQ1Ya/X+b63I20B4Gd+eCL8QuB4sA==" }, "@apollographql/graphql-playground-html": { "version": "1.6.29", @@ -21715,6 +21704,7 @@ }, "@types/node-fetch": { "version": "2.5.10", + "dev": true, "requires": { "@types/node": "*", "form-data": "^3.0.0" @@ -21722,6 +21712,7 @@ "dependencies": { "form-data": { "version": "3.0.1", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -22055,15 +22046,6 @@ "http-cache-semantics": "^4.1.0" } }, - "apollo-env": { - "version": "0.10.0", - "requires": { - "@types/node-fetch": "^2.5.10", - "core-js": "^3.0.1", - "node-fetch": "^2.6.1", - "sha.js": "^2.4.11" - } - }, "apollo-graphql": { "version": "0.9.2", "requires": { @@ -22286,7 +22268,7 @@ "apollo-server-core": { "version": "file:packages/apollo-server-core", "requires": { - "@apollographql/apollo-tools": "^0.5.0", + "@apollographql/apollo-tools": "^0.5.1", "@apollographql/graphql-playground-html": "1.6.29", "@graphql-tools/mock": "^8.1.2", "@graphql-tools/schema": "^7.1.5", @@ -22309,6 +22291,11 @@ "uuid": "^8.0.0" }, "dependencies": { + "@apollographql/apollo-tools": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.1.tgz", + "integrity": "sha512-ZII+/xUFfb9ezDU2gad114+zScxVFMVlZ91f8fGApMzlS1kkqoyLnC4AJaQ1Ya/X+b63I20B4Gd+eCL8QuB4sA==" + }, "apollo-graphql": { "version": "0.9.0", "requires": { @@ -22885,7 +22872,8 @@ } }, "asynckit": { - "version": "0.4.0" + "version": "0.4.0", + "dev": true }, "at-least-node": { "version": "1.0.0", @@ -23530,6 +23518,7 @@ }, "combined-stream": { "version": "1.0.8", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -23802,9 +23791,6 @@ "copy-to": { "version": "2.0.1" }, - "core-js": { - "version": "3.11.1" - }, "core-js-pure": { "version": "3.11.0" }, @@ -23998,7 +23984,8 @@ } }, "delayed-stream": { - "version": "1.0.0" + "version": "1.0.0", + "dev": true }, "delegates": { "version": "1.0.0" diff --git a/package.json b/package.json index 140e6adf137..d3cb512f28b 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "npm": "7.x" }, "dependencies": { - "@apollographql/apollo-tools": "0.5.0", + "@apollographql/apollo-tools": "0.5.1", "apollo-datasource": "file:packages/apollo-datasource", "apollo-datasource-rest": "file:packages/apollo-datasource-rest", "apollo-reporting-protobuf": "file:packages/apollo-reporting-protobuf", diff --git a/packages/apollo-server-core/package.json b/packages/apollo-server-core/package.json index 041118f35a5..5f718504453 100644 --- a/packages/apollo-server-core/package.json +++ b/packages/apollo-server-core/package.json @@ -25,7 +25,7 @@ "node": ">=12.0" }, "dependencies": { - "@apollographql/apollo-tools": "^0.5.0", + "@apollographql/apollo-tools": "^0.5.1", "@apollographql/graphql-playground-html": "1.6.29", "@graphql-tools/mock": "^8.1.2", "@graphql-tools/schema": "^7.1.5", diff --git a/packages/apollo-server-core/src/types.ts b/packages/apollo-server-core/src/types.ts index b9be43167f9..60c3928d8b6 100644 --- a/packages/apollo-server-core/src/types.ts +++ b/packages/apollo-server-core/src/types.ts @@ -18,8 +18,8 @@ import type { } from './graphqlOptions'; import type { ApolloServerPlugin } from 'apollo-server-plugin-base'; -import { GraphQLSchemaModule } from '@apollographql/apollo-tools'; -export { GraphQLSchemaModule }; +import type { GraphQLSchemaModule } from '@apollographql/apollo-tools'; +export type { GraphQLSchemaModule }; export { KeyValueCache } from 'apollo-server-caching'; diff --git a/packages/apollo-server-core/src/utils/schemaInstrumentation.ts b/packages/apollo-server-core/src/utils/schemaInstrumentation.ts index d0a1fe6b5bc..9f2df5ba960 100644 --- a/packages/apollo-server-core/src/utils/schemaInstrumentation.ts +++ b/packages/apollo-server-core/src/utils/schemaInstrumentation.ts @@ -9,7 +9,7 @@ import { import { defaultFieldResolver } from "graphql/execution"; import { FieldNode } from "graphql/language"; import { GraphQLRequestExecutionListener } from "apollo-server-plugin-base"; -import { GraphQLObjectResolver } from "@apollographql/apollo-tools"; +import type { GraphQLObjectResolver } from "@apollographql/apollo-tools"; export const symbolExecutionDispatcherWillResolveField = Symbol("apolloServerExecutionDispatcherWillResolveField");