Skip to content

Commit

Permalink
Drop Node 14 & remove deprecated stuff as breaking changes (#5274)
Browse files Browse the repository at this point in the history
* Drop Node 14

Drop 14 in CI

Drop 14 in Windows tests

Changeset

Tests

* chore(dependencies): updated changesets for modified dependencies

* ..

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ardatan and github-actions[bot] authored May 17, 2023
1 parent 7ec8eac commit 944a68e
Show file tree
Hide file tree
Showing 67 changed files with 339 additions and 319 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/apollo-engine-loader': patch
---
dependencies updates:
- Updated dependency [`@whatwg-node/fetch@^0.9.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.9.0) (from `^0.8.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-tools_executor-http-5274-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/executor-http': patch
---
dependencies updates:
- Updated dependency [`@whatwg-node/fetch@^0.9.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.9.0) (from `^0.8.1`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-tools_github-loader-5274-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/github-loader': patch
---
dependencies updates:
- Updated dependency [`@whatwg-node/fetch@^0.9.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.9.0) (from `^0.8.0`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-tools_prisma-loader-5274-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/prisma-loader': patch
---
dependencies updates:
- Updated dependency [`@whatwg-node/fetch@^0.9.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.9.0) (from `^0.8.2`, in `dependencies`)
5 changes: 5 additions & 0 deletions .changeset/@graphql-tools_url-loader-5274-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/url-loader': patch
---
dependencies updates:
- Updated dependency [`@whatwg-node/fetch@^0.9.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.9.0) (from `^0.8.0`, in `dependencies`)
46 changes: 46 additions & 0 deletions .changeset/moody-days-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
'@graphql-tools/executor-urql-exchange': major
'@graphql-tools/executor-apollo-link': major
'@graphql-tools/apollo-engine-loader': major
'@graphql-tools/graphql-file-loader': major
'@graphql-tools/executor-envelop': major
'@graphql-tools/graphql-tag-pluck': major
'@graphql-tools/code-file-loader': major
'@graphql-tools/json-file-loader': major
'@graphql-tools/batch-delegate': major
'@graphql-tools/executor-http': major
'@graphql-tools/github-loader': major
'@graphql-tools/prisma-loader': major
'@graphql-tools/batch-execute': major
'@graphql-tools/git-loader': major
'@graphql-tools/url-loader': major
'@graphql-tools/federation': major
'@graphql-tools/delegate': major
'@graphql-tools/executor': major
'@graphql-tools/schema': major
'@graphql-tools/stitch': major
'@graphql-tools/links': major
'@graphql-tools/merge': major
'@graphql-tools/utils': major
'@graphql-tools/load': major
'@graphql-tools/wrap': major
'@graphql-tools/documents': major
'@graphql-tools/executor-graphql-ws': major
'@graphql-tools/executor-legacy-ws': major
'@graphql-tools/executor-yoga': major
'graphql-tools': major
'@graphql-tools/import': major
'@graphql-tools/jest-transform': major
'@graphql-tools/load-files': major
'@graphql-tools/module-loader': major
'@graphql-tools/mock': major
'@graphql-tools/node-require': major
'@graphql-tools/optimize': major
'@graphql-tools/relay-operation-optimizer': major
'@graphql-tools/resolvers-composition': major
'@graphql-tools/stitching-directives': major
'@graphql-tools/webpack-loader': major
'@graphql-tools/webpack-loader-runtime': major
---

Drop Node 14 support
6 changes: 6 additions & 0 deletions .changeset/new-panthers-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-tools/utils': major
---

`AggregateError` is no longer exported from `@graphql-tools/utils`.
You can use the native `AggregateError` instead.
5 changes: 5 additions & 0 deletions .changeset/spicy-pillows-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/wrap': major
---

`introspectSchema` has been removed, use `schemaFromExecutor` instead
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest] # remove windows to speed up the tests
node-version: [14, 16, 18]
node-version: [16, 18, 20]
graphql_version:
- 15
- 16
- '17.0.0-alpha.1'
include:
- node-version: 14
- node-version: 16
os: windows-latest
graphql_version: 15
steps:
Expand All @@ -94,11 +94,15 @@ jobs:
restore-keys: |
${{ runner.os }}-${{matrix.node-version}}-${{matrix.graphql_version}}-jest-
- name: Test
if: ${{ matrix.node-version == 20 }}
run: yarn test --ci
- name: Test
if: ${{ matrix.node-version != 20 }}
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 5
command: yarn test --ci
command: yarn test:leaks --ci

trackback:
name: trackback rc dependencies
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"ci:lint": "eslint --ext .ts . --output-file eslint_report.json --format json",
"prettier": "prettier --ignore-path .prettierignore --write --list-different .",
"prettier:check": "prettier --ignore-path .prettierignore --check .",
"test": "jest --no-watchman --detectOpenHandles --detectLeaks",
"test": "jest --no-watchman",
"test:leaks": "jest --no-watchman --detectOpenHandles --detectLeaks --logHeapUsage",
"prerelease": "yarn build",
"release": "changeset publish"
},
Expand Down Expand Up @@ -47,7 +48,7 @@
"@typescript-eslint/eslint-plugin": "5.59.6",
"@typescript-eslint/parser": "5.59.6",
"babel-jest": "29.5.0",
"bob-the-bundler": "6.0.0",
"bob-the-bundler": "7.0.0",
"chalk": "4.1.2",
"concurrently": "8.0.1",
"eslint": "8.40.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/batch-delegate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/batch-execute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/delegate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/delegate/src/checkResultAndHandleErrors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphQLResolveInfo, GraphQLOutputType, GraphQLError, responsePathAsArray, locatedError } from 'graphql';

import { AggregateError, getResponseKeyFromInfo, ExecutionResult, relocatedError } from '@graphql-tools/utils';
import { getResponseKeyFromInfo, ExecutionResult, relocatedError } from '@graphql-tools/utils';

import { DelegationContext } from './types.js';
import { resolveExternalValue } from './resolveExternalValue.js';
Expand Down
1 change: 0 additions & 1 deletion packages/delegate/src/delegateToSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
Executor,
ExecutionRequest,
Maybe,
AggregateError,
isAsyncIterable,
getDefinedRootType,
memoize1,
Expand Down
2 changes: 1 addition & 1 deletion packages/delegate/src/resolveExternalValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
GraphQLOutputType,
} from 'graphql';

import { AggregateError, Maybe } from '@graphql-tools/utils';
import { Maybe } from '@graphql-tools/utils';

import { StitchingInfo, SubschemaConfig } from './types.js';
import { annotateExternalObject, isExternalObject, mergeFields } from './mergeFields.js';
Expand Down
5 changes: 4 additions & 1 deletion packages/documents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/executors/apollo-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@
"graphql": "^15.2.0 || ^16.0.0",
"@apollo/client": "^3.5.9"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/executors/envelop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,8 @@
"peerDependencies": {
"@envelop/core": "^3.0.4"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/executors/graphql-ws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
7 changes: 5 additions & 2 deletions packages/executors/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"dependencies": {
"@graphql-tools/utils": "^9.2.1",
"value-or-promise": "^1.0.12",
"@whatwg-node/fetch": "^0.8.1",
"@whatwg-node/fetch": "^0.9.0",
"@repeaterjs/repeater": "^3.0.4",
"dset": "^3.1.2",
"meros": "^1.2.1",
Expand All @@ -64,5 +64,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
17 changes: 16 additions & 1 deletion packages/executors/http/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ValueOrPromise } from 'value-or-promise';
import { createFormDataFromVariables } from './createFormDataFromVariables.js';
import { handleEventStreamResponse } from './handleEventStreamResponse.js';
import { handleMultipartMixedResponse } from './handleMultipartMixedResponse.js';
import { fetch as defaultFetch, AbortController } from '@whatwg-node/fetch';
import { fetch as defaultFetch } from '@whatwg-node/fetch';

export type SyncFetchFn = (url: string, init?: RequestInit, context?: any, info?: GraphQLResolveInfo) => SyncResponse;
export type SyncResponse = Omit<Response, 'json' | 'text'> & {
Expand Down Expand Up @@ -273,6 +273,21 @@ export function buildHTTPExecutor(options?: HTTPExecutorOptions): Executor<any,
}),
],
};
} else if (e.name === 'AbortError' && controller?.signal?.reason) {
return {
errors: [
createGraphQLError('The operation was aborted. reason: ' + controller.signal.reason, {
extensions: {
requestBody: {
query,
operationName: request.operationName,
},
responseDetails: responseDetailsForError,
},
originalError: e,
}),
],
};
} else if (e.message) {
return {
errors: [
Expand Down
3 changes: 3 additions & 0 deletions packages/executors/legacy-ws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"sideEffects": false,
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"engines": {
"node": ">=16.0.0"
},
"exports": {
".": {
"require": {
Expand Down
5 changes: 4 additions & 1 deletion packages/executors/urql-exchange/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,8 @@
"@urql/core": "^3.0.0 || ^4.0.0",
"wonka": "^6.0.0"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/executors/yoga/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@
"graphql": "^15.2.0 || ^16.0.0",
"graphql-yoga": "^3.5.1"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/federation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@
"value-or-promise": "^1.0.12",
"tslib": "^2.4.0"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/graphql-tag-pluck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/graphql-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"@graphql-tools/schema": "^9.0.18",
"tslib": "^2.4.0"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@
"resolve-from": "5.0.0",
"tslib": "^2.4.0"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/jest-transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/load-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
Loading

0 comments on commit 944a68e

Please sign in to comment.