Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed May 17, 2023
1 parent 0ffefd6 commit 462da0b
Show file tree
Hide file tree
Showing 45 changed files with 209 additions and 210 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@typescript-eslint/eslint-plugin": "5.59.5",
"@typescript-eslint/parser": "5.59.5",
"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"
}
}
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"
}
}
5 changes: 4 additions & 1 deletion packages/executors/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
5 changes: 4 additions & 1 deletion packages/load/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
5 changes: 4 additions & 1 deletion packages/loaders/apollo-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"directory": "dist",
"access": "public"
},
"type": "module"
"type": "module",
"engines": {
"node": ">=16.0.0"
}
}
3 changes: 3 additions & 0 deletions packages/loaders/code-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"author": "Dotan Simha <dotansimha@gmail.com>",
"license": "MIT",
"sideEffects": false,
"engines": {
"node": ">=16.0.0"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
Expand Down
3 changes: 3 additions & 0 deletions packages/loaders/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"url": "ardatan/graphql-tools",
"directory": "packages/loaders/git"
},
"engines": {
"node": ">=16.0.0"
},
"author": "Dotan Simha <dotansimha@gmail.com>",
"license": "MIT",
"sideEffects": false,
Expand Down
3 changes: 3 additions & 0 deletions packages/loaders/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
},
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
"@ardatan/sync-fetch": "^0.0.1",
"@graphql-tools/executor-http": "^0.1.9",
Expand Down
3 changes: 3 additions & 0 deletions packages/loaders/graphql-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"url": "ardatan/graphql-tools",
"directory": "packages/loaders/graphql-file"
},
"engines": {
"node": ">=16.0.0"
},
"author": "Dotan Simha <dotansimha@gmail.com>",
"license": "MIT",
"sideEffects": false,
Expand Down
3 changes: 3 additions & 0 deletions packages/loaders/json-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"url": "ardatan/graphql-tools",
"directory": "packages/loaders/json-file"
},
"engines": {
"node": ">=16.0.0"
},
"author": "Dotan Simha <dotansimha@gmail.com>",
"license": "MIT",
"sideEffects": false,
Expand Down
3 changes: 3 additions & 0 deletions packages/loaders/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"url": "ardatan/graphql-tools",
"directory": "packages/loaders/module"
},
"engines": {
"node": ">=16.0.0"
},
"author": "Dotan Simha <dotansimha@gmail.com>",
"license": "MIT",
"sideEffects": false,
Expand Down
3 changes: 3 additions & 0 deletions packages/loaders/prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"typescript": {
"definition": "dist/typings/index.d.ts"
},
"engines": {
"node": ">=16.0.0"
},
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/loaders/url/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@graphql-tools/url-loader",
"version": "7.17.18",
"description": "A set of utils for faster development of GraphQL tools",
"engines": {
"node": ">=16.0.0"
},
"repository": {
"type": "git",
"url": "ardatan/graphql-tools",
Expand Down
3 changes: 3 additions & 0 deletions packages/merge/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "@graphql-tools/merge",
"engines": {
"node": ">=16.0.0"
},
"version": "8.4.2",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions packages/mock/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "@graphql-tools/mock",
"engines": {
"node": ">=16.0.0"
},
"version": "8.7.20",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions packages/node-require/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "@graphql-tools/node-require",
"engines": {
"node": ">=16.0.0"
},
"version": "6.4.22",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions packages/optimize/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "@graphql-tools/optimize",
"engines": {
"node": ">=16.0.0"
},
"version": "1.4.0",
"description": "A set of utils for faster development of GraphQL tools",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions packages/relay-operation-optimizer/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "@graphql-tools/relay-operation-optimizer",
"engines": {
"node": ">=16.0.0"
},
"version": "6.5.18",
"description": "Package for optimizing your GraphQL operations relay style.",
"author": {
Expand Down
3 changes: 3 additions & 0 deletions packages/resolvers-composition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@graphql-tools/resolvers-composition",
"version": "6.5.18",
"description": "Common package containing utils and types for GraphQL tools",
"engines": {
"node": ">=16.0.0"
},
"repository": {
"type": "git",
"url": "ardatan/graphql-tools",
Expand Down
3 changes: 3 additions & 0 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
},
"engines": {
"node": ">=16.0.0"
},
"devDependencies": {
"graphql-scalars": "1.21.3"
},
Expand Down

0 comments on commit 462da0b

Please sign in to comment.