@graphql-hive/gateway-runtime 2.9.4 → 2.9.5-alpha-b7489a975b028febc901c3072f6b52f4e96be380
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +14 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +15 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @graphql-hive/gateway-runtime
|
|
2
2
|
|
|
3
|
+
## 2.9.5-alpha-b7489a975b028febc901c3072f6b52f4e96be380
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#2391](https://github.com/graphql-hive/gateway/pull/2391) [`b966366`](https://github.com/graphql-hive/gateway/commit/b9663668bd5f1334de9b28774f7a9c868e19ae9f) Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates:
|
|
9
|
+
|
|
10
|
+
- Updated dependency [`@whatwg-node/server@0.11.0-alpha-20260601161904-05f344aaf80bd89e9e8ffbe8e554a6798132f863` ↗︎](https://www.npmjs.com/package/@whatwg-node/server/v/0.11.0) (from `^0.10.17`, in `dependencies`)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
- [#2391](https://github.com/graphql-hive/gateway/pull/2391) [`bdb20f7`](https://github.com/graphql-hive/gateway/commit/bdb20f7c0ddfb5101238dc6820eaaab836a09189) Thanks [@enisdenjo](https://github.com/enisdenjo)! - Use `useRequestDeadline` plugin from `@whatwg-node/server` for enforcing per-request timeouts
|
|
14
|
+
|
|
15
|
+
Read more: https://github.com/ardatan/whatwg-node/pull/3399.
|
|
16
|
+
|
|
3
17
|
## 2.9.4
|
|
4
18
|
### Patch Changes
|
|
5
19
|
|
package/dist/index.cjs
CHANGED
|
@@ -17,6 +17,7 @@ var pluginPersistedOperations = require('@graphql-yoga/plugin-persisted-operatio
|
|
|
17
17
|
var disposablestack = require('@whatwg-node/disposablestack');
|
|
18
18
|
var fetch = require('@whatwg-node/fetch');
|
|
19
19
|
var promiseHelpers = require('@whatwg-node/promise-helpers');
|
|
20
|
+
var server = require('@whatwg-node/server');
|
|
20
21
|
var serverPluginCookies = require('@whatwg-node/server-plugin-cookies');
|
|
21
22
|
var graphql = require('graphql');
|
|
22
23
|
var graphqlYoga = require('graphql-yoga');
|
|
@@ -24,7 +25,6 @@ var federation = require('@graphql-tools/federation');
|
|
|
24
25
|
var pluginApolloUsageReport = require('@graphql-yoga/plugin-apollo-usage-report');
|
|
25
26
|
var yoga = require('@graphql-hive/yoga');
|
|
26
27
|
require('@graphql-tools/executor-common');
|
|
27
|
-
var server = require('@whatwg-node/server');
|
|
28
28
|
var delegate = require('@graphql-tools/delegate');
|
|
29
29
|
var transportCommon = require('@graphql-mesh/transport-common');
|
|
30
30
|
var signal = require('@graphql-hive/signal');
|
|
@@ -3113,6 +3113,19 @@ function createGatewayRuntime(config) {
|
|
|
3113
3113
|
if (config.upstreamTimeout) {
|
|
3114
3114
|
extraPlugins.push(useUpstreamTimeout(config.upstreamTimeout));
|
|
3115
3115
|
}
|
|
3116
|
+
if (config.requestDeadline) {
|
|
3117
|
+
extraPlugins.push(
|
|
3118
|
+
server.useRequestDeadline({
|
|
3119
|
+
timeout: config.requestDeadline,
|
|
3120
|
+
response: () => new fetchAPI.Response("Request deadline exceeded", {
|
|
3121
|
+
status: 503,
|
|
3122
|
+
headers: {
|
|
3123
|
+
Connection: "close"
|
|
3124
|
+
}
|
|
3125
|
+
})
|
|
3126
|
+
})
|
|
3127
|
+
);
|
|
3128
|
+
}
|
|
3116
3129
|
if (config.upstreamRetry) {
|
|
3117
3130
|
extraPlugins.push(useUpstreamRetry(config.upstreamRetry));
|
|
3118
3131
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -846,6 +846,15 @@ interface GatewayConfigBase<TContext extends Record<string, any>> {
|
|
|
846
846
|
* Configure the retry for upstream requests.
|
|
847
847
|
*/
|
|
848
848
|
upstreamRetry?: UpstreamRetryPluginOptions;
|
|
849
|
+
/**
|
|
850
|
+
* Sets a hard end-to-end time limit in milliseconds for the
|
|
851
|
+
* entire request lifecycle — from connection to response completion.
|
|
852
|
+
*
|
|
853
|
+
* Unlike Node's `requestTimeout`, this timer is NOT cancelled when the body
|
|
854
|
+
* is received; it runs until the response is finished or the socket
|
|
855
|
+
* is destroyed.
|
|
856
|
+
*/
|
|
857
|
+
requestDeadline?: number;
|
|
849
858
|
/**
|
|
850
859
|
* Configure the request ID for the gateway
|
|
851
860
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -846,6 +846,15 @@ interface GatewayConfigBase<TContext extends Record<string, any>> {
|
|
|
846
846
|
* Configure the retry for upstream requests.
|
|
847
847
|
*/
|
|
848
848
|
upstreamRetry?: UpstreamRetryPluginOptions;
|
|
849
|
+
/**
|
|
850
|
+
* Sets a hard end-to-end time limit in milliseconds for the
|
|
851
|
+
* entire request lifecycle — from connection to response completion.
|
|
852
|
+
*
|
|
853
|
+
* Unlike Node's `requestTimeout`, this timer is NOT cancelled when the body
|
|
854
|
+
* is received; it runs until the response is finished or the socket
|
|
855
|
+
* is destroyed.
|
|
856
|
+
*/
|
|
857
|
+
requestDeadline?: number;
|
|
849
858
|
/**
|
|
850
859
|
* Configure the request ID for the gateway
|
|
851
860
|
*
|
package/dist/index.js
CHANGED
|
@@ -18,8 +18,9 @@ import { useDeferStream } from '@graphql-yoga/plugin-defer-stream';
|
|
|
18
18
|
import { usePersistedOperations } from '@graphql-yoga/plugin-persisted-operations';
|
|
19
19
|
import { AsyncDisposableStack } from '@whatwg-node/disposablestack';
|
|
20
20
|
export * from '@whatwg-node/disposablestack';
|
|
21
|
-
import {
|
|
21
|
+
import { Response, URLSearchParams, URL as URL$1, URLPattern, TextDecoder, TextEncoder, btoa, crypto, File, Blob, TextEncoderStream, TextDecoderStream, DecompressionStream, CompressionStream, TransformStream, WritableStream, ReadableStream, FormData, Headers, Request, fetch } from '@whatwg-node/fetch';
|
|
22
22
|
import { handleMaybePromise, iterateAsync, fakePromise, fakeRejectPromise } from '@whatwg-node/promise-helpers';
|
|
23
|
+
import { useContentEncoding as useContentEncoding$1, useRequestDeadline } from '@whatwg-node/server';
|
|
23
24
|
import { useCookies } from '@whatwg-node/server-plugin-cookies';
|
|
24
25
|
import { print, visit, visitWithTypeInfo, getArgumentValues, getNamedType, isIntrospectionType, isListType, isCompositeType, BREAK, getOperationAST, isSchema, buildASTSchema, buildSchema, parse, Kind, OperationTypeNode } from 'graphql';
|
|
25
26
|
import { isAsyncIterable as isAsyncIterable$1, mergeSchemas, useReadinessCheck, useExecutionCancellation, createYoga, chain } from 'graphql-yoga';
|
|
@@ -27,7 +28,6 @@ import { DEFAULT_UPLINKS, fetchSupergraphSdlFromManagedFederation } from '@graph
|
|
|
27
28
|
import { useApolloUsageReport } from '@graphql-yoga/plugin-apollo-usage-report';
|
|
28
29
|
import { useHive } from '@graphql-hive/yoga';
|
|
29
30
|
import '@graphql-tools/executor-common';
|
|
30
|
-
import { useContentEncoding as useContentEncoding$1 } from '@whatwg-node/server';
|
|
31
31
|
import { getTypeInfo, EMPTY_OBJECT, delegateToSchema, defaultMergedResolver } from '@graphql-tools/delegate';
|
|
32
32
|
import { defaultPrintFn } from '@graphql-mesh/transport-common';
|
|
33
33
|
import { abortSignalAny } from '@graphql-hive/signal';
|
|
@@ -3112,6 +3112,19 @@ function createGatewayRuntime(config) {
|
|
|
3112
3112
|
if (config.upstreamTimeout) {
|
|
3113
3113
|
extraPlugins.push(useUpstreamTimeout(config.upstreamTimeout));
|
|
3114
3114
|
}
|
|
3115
|
+
if (config.requestDeadline) {
|
|
3116
|
+
extraPlugins.push(
|
|
3117
|
+
useRequestDeadline({
|
|
3118
|
+
timeout: config.requestDeadline,
|
|
3119
|
+
response: () => new fetchAPI.Response("Request deadline exceeded", {
|
|
3120
|
+
status: 503,
|
|
3121
|
+
headers: {
|
|
3122
|
+
Connection: "close"
|
|
3123
|
+
}
|
|
3124
|
+
})
|
|
3125
|
+
})
|
|
3126
|
+
);
|
|
3127
|
+
}
|
|
3115
3128
|
if (config.upstreamRetry) {
|
|
3116
3129
|
extraPlugins.push(useUpstreamRetry(config.upstreamRetry));
|
|
3117
3130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-hive/gateway-runtime",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.5-alpha-b7489a975b028febc901c3072f6b52f4e96be380",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@whatwg-node/disposablestack": "^0.0.6",
|
|
78
78
|
"@whatwg-node/fetch": "^0.10.13",
|
|
79
79
|
"@whatwg-node/promise-helpers": "^1.3.2",
|
|
80
|
-
"@whatwg-node/server": "
|
|
80
|
+
"@whatwg-node/server": "0.11.0-alpha-20260601161904-05f344aaf80bd89e9e8ffbe8e554a6798132f863",
|
|
81
81
|
"@whatwg-node/server-plugin-cookies": "^1.0.5",
|
|
82
82
|
"graphql-ws": "^6.0.6",
|
|
83
83
|
"graphql-yoga": "^5.21.0",
|