@graphql-tools/executor-http
Advanced tools
Comparing version 1.2.4 to 1.2.5-alpha-09b31c8104f4c0b9d87e30144cf822c5ffd19740
# @graphql-tools/executor-http | ||
## 1.2.5-alpha-09b31c8104f4c0b9d87e30144cf822c5ffd19740 | ||
### Patch Changes | ||
- [#420](https://github.com/graphql-hive/gateway/pull/420) [`82cc7d6`](https://github.com/graphql-hive/gateway/commit/82cc7d6d2b2c6689f0436a1bef299f0462959581) Thanks [@ardatan](https://github.com/ardatan)! - - In case of schema reload, throw `SCHEMA_RELOAD` error while recreating the transports and executors | ||
- In case of shut down, throw `SHUTTING_DOWN` error while cleaning the transports and executors up | ||
Previously, these errors are only thrown for subscriptions not it is thrown in other type of operations as well. | ||
And previously the thrown errors during these two cleanup and restart process were cryptic, now the mentioned two errors above are thrown with more clear messages | ||
## 1.2.4 | ||
@@ -4,0 +15,0 @@ |
@@ -82,2 +82,6 @@ import { ExecutionRequest, DisposableSyncExecutor, DisposableAsyncExecutor } from '@graphql-tools/utils'; | ||
disposable?: boolean; | ||
/** | ||
* On dispose abort error | ||
*/ | ||
getDisposeReason?(): Error | undefined; | ||
} | ||
@@ -84,0 +88,0 @@ type HeadersConfig = Record<string, string>; |
@@ -123,5 +123,2 @@ import { abortSignalAny } from '@graphql-hive/gateway-abort-signal-any'; | ||
function createAbortErrorReason() { | ||
return new Error("Executor was disposed."); | ||
} | ||
function createGraphQLErrorForAbort(reason, extensions) { | ||
@@ -133,7 +130,14 @@ if (reason instanceof GraphQLError) { | ||
return createGraphQLError(reason.message, { | ||
extensions, | ||
extensions: { | ||
http: { | ||
status: 504, | ||
...extensions?.["http"] || {} | ||
}, | ||
code: "TIMEOUT_ERROR", | ||
...extensions || {} | ||
}, | ||
originalError: reason | ||
}); | ||
} | ||
return createGraphQLError("The operation was aborted. reason: " + reason, { | ||
return createGraphQLError(reason.message, { | ||
extensions, | ||
@@ -184,3 +188,3 @@ originalError: reason | ||
if (signal?.aborted) { | ||
await push(createResultForAbort(signal)); | ||
await push(createResultForAbort(signal.reason)); | ||
return stop(); | ||
@@ -586,3 +590,3 @@ } | ||
return function dispose() { | ||
return disposeCtrl.abort(createAbortErrorReason()); | ||
return disposeCtrl.abort(options?.getDisposeReason?.()); | ||
}; | ||
@@ -594,3 +598,3 @@ } | ||
return function asyncDispose() { | ||
return disposeCtrl.abort(createAbortErrorReason()); | ||
return disposeCtrl.abort(options?.getDisposeReason?.()); | ||
}; | ||
@@ -597,0 +601,0 @@ } |
{ | ||
"name": "@graphql-tools/executor-http", | ||
"version": "1.2.4", | ||
"version": "1.2.5-alpha-09b31c8104f4c0b9d87e30144cf822c5ffd19740", | ||
"type": "module", | ||
@@ -59,5 +59,5 @@ "description": "A set of utils for faster development of GraphQL tools", | ||
"graphql-yoga": "^5.10.6", | ||
"pkgroll": "2.6.0" | ||
"pkgroll": "2.6.1" | ||
}, | ||
"sideEffects": false | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
75826
1350
2