Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.21.0 #4922

Merged
merged 7 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ The version headers in this history reflect the versions of Apollo Server itself

> 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.

## v2.21.0

- Apollo Server can now be installed with `graphql@15` without causing peer dependency errors or warnings. (Apollo Server has a [file upload](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) feature which was implemented as a wrapper around the `graphql-upload` package. We have been unable to upgrade our dependency on that package due to backwards-incompatible changes in later versions, and the version we were stuck on did not allow `graphql@15` as a peer dependency. We have now switched to a fork of that old version called `@apollographql/graphql-upload-8-fork` that allows `graphql@15`.) Also bump the `graphql-tools` dependency from 4.0.0 to 4.0.8 for `graphql@15` support. [Issue #4865](https://github.com/apollographql/apollo-server/issues/4865)

## v2.20.0

- `apollo-server`: Previously, `ApolloServer.stop()` functioned like `net.Server.close()` in that it did not close idle connections or close active connections after a grace period. This meant that trying to `await ApolloServer.stop()` could hang indefinitely if there are open connections. Now, this method closes idle connections, and closes active connections after 10 seconds. The grace period can be adjusted by passing the new `stopGracePeriodMillis` option to `new ApolloServer`, or disabled by passing `Infinity` (though it will still close idle connections). Note that this only applies to the "batteries-included" `ApolloServer` in the `apollo-server` package with its own built-in Express and HTTP servers. [PR #4908](https://github.com/apollographql/apollo-server/pull/4908) [Issue #4097](https://github.com/apollographql/apollo-server/issues/4097)
Expand Down
88 changes: 52 additions & 36 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
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"graphql-extensions": "file:packages/graphql-extensions"
},
"devDependencies": {
"@apollographql/graphql-upload-8-fork": "^8.1.3",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this to make it visible to a build-time-only import type in apollo-server-fastify (I think that's the right way to do it?).

"@types/async-retry": "1.4.2",
"@types/aws-lambda": "8.10.66",
"@types/body-parser": "1.19.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-azure-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-azure-functions",
"version": "2.20.0",
"version": "2.21.0-alpha.2",
"description": "Production-ready Node.js GraphQL server for Azure Functions",
"keywords": [
"GraphQL",
Expand Down Expand Up @@ -31,7 +31,7 @@
"apollo-server-core": "file:../apollo-server-core",
"apollo-server-env": "file:../apollo-server-env",
"apollo-server-types": "file:../apollo-server-types",
"graphql-tools": "^4.0.0"
"graphql-tools": "^4.0.8"
},
"devDependencies": {
"apollo-server-integration-testsuite": "file:../apollo-server-integration-testsuite"
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-cloud-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-cloud-functions",
"version": "2.20.0",
"version": "2.21.0-alpha.2",
"description": "Production-ready Node.js GraphQL server for Google Cloud Functions",
"keywords": [
"GraphQL",
Expand Down Expand Up @@ -30,7 +30,7 @@
"apollo-server-core": "file:../apollo-server-core",
"apollo-server-env": "file:../apollo-server-env",
"apollo-server-types": "file:../apollo-server-types",
"graphql-tools": "^4.0.0"
"graphql-tools": "^4.0.8"
},
"devDependencies": {
"apollo-server-integration-testsuite": "file:../apollo-server-integration-testsuite"
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-cloudflare",
"version": "2.20.0",
"version": "2.21.0-alpha.2",
"description": "Production-ready Node.js GraphQL server for Cloudflare workers",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
7 changes: 3 additions & 4 deletions packages/apollo-server-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-core",
"version": "2.20.0",
"version": "2.21.0-alpha.2",
"description": "Core engine for Apollo GraphQL server",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -27,7 +27,7 @@
"dependencies": {
"@apollographql/apollo-tools": "^0.4.3",
"@apollographql/graphql-playground-html": "1.6.26",
"@types/graphql-upload": "^8.0.0",
"@apollographql/graphql-upload-8-fork": "^8.1.3",
"@types/ws": "^7.0.0",
"apollo-cache-control": "file:../apollo-cache-control",
"apollo-datasource": "file:../apollo-datasource",
Expand All @@ -43,8 +43,7 @@
"fast-json-stable-stringify": "^2.0.0",
"graphql-extensions": "file:../graphql-extensions",
"graphql-tag": "^2.11.0",
"graphql-tools": "^4.0.0",
"graphql-upload": "^8.0.2",
"graphql-tools": "^4.0.8",
"loglevel": "^1.6.7",
"lru-cache": "^6.0.0",
"sha.js": "^2.4.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export class ApolloServerBase {
}

if (this.uploadsConfig) {
const { GraphQLUpload } = require('graphql-upload');
const { GraphQLUpload } = require('@apollographql/graphql-upload-8-fork');
if (Array.isArray(resolvers)) {
if (resolvers.every(resolver => !resolver.Upload)) {
resolvers.push({ Upload: GraphQLUpload });
Expand Down
19 changes: 10 additions & 9 deletions packages/apollo-server-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ import runtimeSupportsUploads from './utils/runtimeSupportsUploads';
import { GraphQLScalarType } from 'graphql';
export { default as processFileUploads } from './processFileUploads';

// This is a conditional export intended to avoid traversing the
// entire module tree of `graphql-upload`. This only defined if the
// version of Node.js is >= 8.5.0 since those are the only Node.js versions
// which are supported by `graphql-upload@8`. Since the source of
// `graphql-upload` is not transpiled for older targets (in fact, it includes
// experimental ECMAScript modules), this conditional export is necessary
// to avoid modern ECMAScript from failing to parse by versions of Node.js
// which don't support it (yet — eg. Node.js 6 and async/await).
// This is a conditional export intended to avoid traversing the entire module
// tree of `graphql-upload` (or specifically, our fork of it). This only
// defined if the version of Node.js is >= 8.5.0 since those are the only
// Node.js versions which are supported by `graphql-upload@8`. Since the source
// of `graphql-upload` is not transpiled for older targets (in fact, it includes
// experimental ECMAScript modules), this conditional export is necessary to
// avoid modern ECMAScript from failing to parse by versions of Node.js which
// don't support it (yet — eg. Node.js 6 and async/await).
export const GraphQLUpload = runtimeSupportsUploads
? (require('graphql-upload').GraphQLUpload as GraphQLScalarType)
? (require('@apollographql/graphql-upload-8-fork')
.GraphQLUpload as GraphQLScalarType)
: undefined;

export * from './plugin';
6 changes: 3 additions & 3 deletions packages/apollo-server-core/src/processFileUploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import runtimeSupportsUploads from './utils/runtimeSupportsUploads';
// change during runtime. In the event that we're using a version of Node.js
// less than 8.5.0, we'll
const processFileUploads:
| typeof import('graphql-upload').processRequest
| typeof import('@apollographql/graphql-upload-8-fork').processRequest
| undefined = (() => {
if (runtimeSupportsUploads) {
return require('graphql-upload')
.processRequest as typeof import('graphql-upload').processRequest;
return require('@apollographql/graphql-upload-8-fork')
.processRequest as typeof import('@apollographql/graphql-upload-8-fork').processRequest;
}
return undefined;
})();
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export interface Config extends BaseConfig {
engine?: boolean | EngineReportingOptions<Context>;
}

// Configuration for how Apollo Server talks to the Apollo registry.
// Configuration for the built-in graphql-upload integration.
export interface FileUploadOptions {
//Max allowed non-file multipart form field size in bytes; enough for your queries (default: 1 MB).
maxFieldSize?: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-express",
"version": "2.20.0",
"version": "2.21.0-alpha.2",
"description": "Production-ready Node.js GraphQL server for Express and Connect",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -40,7 +40,7 @@
"cors": "^2.8.4",
"express": "^4.17.1",
"graphql-subscriptions": "^1.0.0",
"graphql-tools": "^4.0.0",
"graphql-tools": "^4.0.8",
"parseurl": "^1.3.2",
"subscriptions-transport-ws": "^0.9.16",
"type-is": "^1.6.16"
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-server-fastify/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-server-fastify",
"version": "2.20.0",
"version": "2.21.0-alpha.2",
"description": "Production-ready Node.js GraphQL server for Fastify",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -32,7 +32,7 @@
"fastify-accepts": "^1.0.0",
"fastify-cors": "^0.2.0",
"graphql-subscriptions": "^1.0.0",
"graphql-tools": "^4.0.0"
"graphql-tools": "^4.0.8"
},
"devDependencies": {
"apollo-server-integration-testsuite": "file:../apollo-server-integration-testsuite"
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-server-fastify/src/ApolloServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
import { IncomingMessage, OutgoingMessage, ServerResponse, Server } from 'http';
import { graphqlFastify } from './fastifyApollo';
import { GraphQLOperation } from 'graphql-upload';
import type { GraphQLOperation } from '@apollographql/graphql-upload-8-fork';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure what you've done here and the corresponding change in package.json is correct, though I'm having a hard time saying with certainty. Just noting since you also had a question about it and I don't want to say "yes" without saying "I'm not totally sure".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well two people at "pretty sure" equals a "totally sure", right?


const kMultipart = Symbol('multipart');
const fastJson = require('fast-json-stringify');
Expand Down
Loading