@graphql-hive/gateway 1.16.3-alpha-b036abed553a3f749bb6b76a78885feaca2ce77a → 1.16.3-alpha-addb72faf6da0a03455c069877d3592536812e45
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 +5 -2
- package/dist/bin.cjs +1 -1
- package/dist/bin.js +1 -1
- package/dist/{cli-zNcDKN5C.cjs → cli-Bn1nfisS.cjs} +76 -2
- package/dist/{cli-BFgyRHpc.js → cli-BqlvyFPa.js} +76 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
# @graphql-hive/gateway
|
2
2
|
|
3
|
-
## 1.16.3-alpha-
|
3
|
+
## 1.16.3-alpha-addb72faf6da0a03455c069877d3592536812e45
|
4
4
|
|
5
5
|
### Patch Changes
|
6
6
|
|
7
|
+
- [#1374](https://github.com/graphql-hive/gateway/pull/1374) [`addb72f`](https://github.com/graphql-hive/gateway/commit/addb72faf6da0a03455c069877d3592536812e45) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates:
|
8
|
+
- Added dependency [`uWebSockets.js@uNetworking/uWebSockets.js#v20.52.0` ↗︎](https://www.npmjs.com/package/uWebSockets.js/v/20.52.0) (to `dependencies`)
|
9
|
+
|
7
10
|
- Updated dependencies [[`bed67a6`](https://github.com/graphql-hive/gateway/commit/bed67a6eaf57b2aa6c7d08d1137b3bd8c4d4b066)]:
|
8
|
-
- @graphql-hive/plugin-aws-sigv4@1.0.18-alpha-
|
11
|
+
- @graphql-hive/plugin-aws-sigv4@1.0.18-alpha-addb72faf6da0a03455c069877d3592536812e45
|
9
12
|
|
10
13
|
## 1.16.2
|
11
14
|
|
package/dist/bin.cjs
CHANGED
package/dist/bin.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import 'dotenv/config';
|
3
3
|
import module from 'node:module';
|
4
|
-
import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, c as getDefaultLogger, r as run } from './cli-
|
4
|
+
import { e as enableModuleCachingIfPossible, h as handleNodeWarnings, c as getDefaultLogger, r as run } from './cli-BqlvyFPa.js';
|
5
5
|
import 'node:cluster';
|
6
6
|
import 'node:os';
|
7
7
|
import 'node:path';
|
@@ -705,7 +705,68 @@ async function startNodeHttpServer(gwRuntime, opts) {
|
|
705
705
|
});
|
706
706
|
}
|
707
707
|
|
708
|
-
function
|
708
|
+
function createUWSStartFn(uws) {
|
709
|
+
return async function startUwsServer(gwRuntime, opts) {
|
710
|
+
const {
|
711
|
+
log,
|
712
|
+
host = defaultOptions.host,
|
713
|
+
port = defaultOptions.port,
|
714
|
+
sslCredentials,
|
715
|
+
maxHeaderSize,
|
716
|
+
disableWebsockets
|
717
|
+
} = opts;
|
718
|
+
if (maxHeaderSize) {
|
719
|
+
process.env["UWS_HTTP_MAX_HEADER_SIZE"] = maxHeaderSize.toString();
|
720
|
+
}
|
721
|
+
let app;
|
722
|
+
let protocol;
|
723
|
+
if (sslCredentials) {
|
724
|
+
protocol = "https";
|
725
|
+
app = uws.SSLApp({
|
726
|
+
key_file_name: sslCredentials.key_file_name,
|
727
|
+
cert_file_name: sslCredentials.cert_file_name,
|
728
|
+
ca_file_name: sslCredentials.ca_file_name,
|
729
|
+
passphrase: sslCredentials.passphrase,
|
730
|
+
dh_params_file_name: sslCredentials.dh_params_file_name,
|
731
|
+
ssl_ciphers: sslCredentials.ssl_ciphers,
|
732
|
+
ssl_prefer_low_memory_usage: sslCredentials.ssl_prefer_low_memory_usage
|
733
|
+
});
|
734
|
+
} else {
|
735
|
+
protocol = "http";
|
736
|
+
app = uws.App();
|
737
|
+
}
|
738
|
+
const url = `${protocol}://${host}:${port}`.replace("0.0.0.0", "localhost");
|
739
|
+
log.debug(`Starting server on ${url}`);
|
740
|
+
if (!disableWebsockets) {
|
741
|
+
log.debug("Setting up WebSocket server");
|
742
|
+
const { makeBehavior } = await import('graphql-ws/use/uWebSockets');
|
743
|
+
const wsBehavior = makeBehavior(
|
744
|
+
gatewayRuntime.getGraphQLWSOptions(gwRuntime, (ctx) => ({
|
745
|
+
req: ctx.extra?.persistedRequest,
|
746
|
+
socket: ctx.extra?.socket
|
747
|
+
}))
|
748
|
+
);
|
749
|
+
app.ws(gwRuntime.graphqlEndpoint, wsBehavior);
|
750
|
+
}
|
751
|
+
app.any("/*", gwRuntime);
|
752
|
+
return new Promise((resolve, reject) => {
|
753
|
+
app.listen(host, port, (listenSocket) => {
|
754
|
+
if (listenSocket) {
|
755
|
+
log.info(`Listening on ${url}`);
|
756
|
+
} else {
|
757
|
+
reject(new Error(`Failed to start server on ${url}`));
|
758
|
+
}
|
759
|
+
});
|
760
|
+
gwRuntime.disposableStack.defer(() => {
|
761
|
+
log.info(`Stopping the server`);
|
762
|
+
app.close();
|
763
|
+
resolve();
|
764
|
+
});
|
765
|
+
});
|
766
|
+
};
|
767
|
+
}
|
768
|
+
|
769
|
+
async function startServerForRuntime(runtime, {
|
709
770
|
log,
|
710
771
|
host = defaultOptions.host,
|
711
772
|
port = defaultOptions.port,
|
@@ -727,7 +788,20 @@ function startServerForRuntime(runtime, {
|
|
727
788
|
disableWebsockets,
|
728
789
|
...sslCredentials ? { sslCredentials } : {}
|
729
790
|
};
|
730
|
-
|
791
|
+
let startServer;
|
792
|
+
if (globalThis.Bun) {
|
793
|
+
startServer = startBunServer;
|
794
|
+
} else {
|
795
|
+
try {
|
796
|
+
const uws = await import('uWebSockets.js');
|
797
|
+
startServer = createUWSStartFn(uws);
|
798
|
+
} catch (error) {
|
799
|
+
log.warn(
|
800
|
+
"uWebSockets.js is not available, falling back to Node.js HTTP server."
|
801
|
+
);
|
802
|
+
startServer = startNodeHttpServer;
|
803
|
+
}
|
804
|
+
}
|
731
805
|
return startServer(runtime, serverOpts);
|
732
806
|
}
|
733
807
|
|
@@ -698,7 +698,68 @@ async function startNodeHttpServer(gwRuntime, opts) {
|
|
698
698
|
});
|
699
699
|
}
|
700
700
|
|
701
|
-
function
|
701
|
+
function createUWSStartFn(uws) {
|
702
|
+
return async function startUwsServer(gwRuntime, opts) {
|
703
|
+
const {
|
704
|
+
log,
|
705
|
+
host = defaultOptions.host,
|
706
|
+
port = defaultOptions.port,
|
707
|
+
sslCredentials,
|
708
|
+
maxHeaderSize,
|
709
|
+
disableWebsockets
|
710
|
+
} = opts;
|
711
|
+
if (maxHeaderSize) {
|
712
|
+
process.env["UWS_HTTP_MAX_HEADER_SIZE"] = maxHeaderSize.toString();
|
713
|
+
}
|
714
|
+
let app;
|
715
|
+
let protocol;
|
716
|
+
if (sslCredentials) {
|
717
|
+
protocol = "https";
|
718
|
+
app = uws.SSLApp({
|
719
|
+
key_file_name: sslCredentials.key_file_name,
|
720
|
+
cert_file_name: sslCredentials.cert_file_name,
|
721
|
+
ca_file_name: sslCredentials.ca_file_name,
|
722
|
+
passphrase: sslCredentials.passphrase,
|
723
|
+
dh_params_file_name: sslCredentials.dh_params_file_name,
|
724
|
+
ssl_ciphers: sslCredentials.ssl_ciphers,
|
725
|
+
ssl_prefer_low_memory_usage: sslCredentials.ssl_prefer_low_memory_usage
|
726
|
+
});
|
727
|
+
} else {
|
728
|
+
protocol = "http";
|
729
|
+
app = uws.App();
|
730
|
+
}
|
731
|
+
const url = `${protocol}://${host}:${port}`.replace("0.0.0.0", "localhost");
|
732
|
+
log.debug(`Starting server on ${url}`);
|
733
|
+
if (!disableWebsockets) {
|
734
|
+
log.debug("Setting up WebSocket server");
|
735
|
+
const { makeBehavior } = await import('graphql-ws/use/uWebSockets');
|
736
|
+
const wsBehavior = makeBehavior(
|
737
|
+
getGraphQLWSOptions(gwRuntime, (ctx) => ({
|
738
|
+
req: ctx.extra?.persistedRequest,
|
739
|
+
socket: ctx.extra?.socket
|
740
|
+
}))
|
741
|
+
);
|
742
|
+
app.ws(gwRuntime.graphqlEndpoint, wsBehavior);
|
743
|
+
}
|
744
|
+
app.any("/*", gwRuntime);
|
745
|
+
return new Promise((resolve, reject) => {
|
746
|
+
app.listen(host, port, (listenSocket) => {
|
747
|
+
if (listenSocket) {
|
748
|
+
log.info(`Listening on ${url}`);
|
749
|
+
} else {
|
750
|
+
reject(new Error(`Failed to start server on ${url}`));
|
751
|
+
}
|
752
|
+
});
|
753
|
+
gwRuntime.disposableStack.defer(() => {
|
754
|
+
log.info(`Stopping the server`);
|
755
|
+
app.close();
|
756
|
+
resolve();
|
757
|
+
});
|
758
|
+
});
|
759
|
+
};
|
760
|
+
}
|
761
|
+
|
762
|
+
async function startServerForRuntime(runtime, {
|
702
763
|
log,
|
703
764
|
host = defaultOptions.host,
|
704
765
|
port = defaultOptions.port,
|
@@ -720,7 +781,20 @@ function startServerForRuntime(runtime, {
|
|
720
781
|
disableWebsockets,
|
721
782
|
...sslCredentials ? { sslCredentials } : {}
|
722
783
|
};
|
723
|
-
|
784
|
+
let startServer;
|
785
|
+
if (globalThis.Bun) {
|
786
|
+
startServer = startBunServer;
|
787
|
+
} else {
|
788
|
+
try {
|
789
|
+
const uws = await import('uWebSockets.js');
|
790
|
+
startServer = createUWSStartFn(uws);
|
791
|
+
} catch (error) {
|
792
|
+
log.warn(
|
793
|
+
"uWebSockets.js is not available, falling back to Node.js HTTP server."
|
794
|
+
);
|
795
|
+
startServer = startNodeHttpServer;
|
796
|
+
}
|
797
|
+
}
|
724
798
|
return startServer(runtime, serverOpts);
|
725
799
|
}
|
726
800
|
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { b as defaultOptions, d as defineConfig, e as enableModuleCachingIfPossible, a as getBuiltinPluginsFromConfig, g as getCacheInstanceFromConfig, h as handleNodeWarnings, r as run } from './cli-
|
1
|
+
export { b as defaultOptions, d as defineConfig, e as enableModuleCachingIfPossible, a as getBuiltinPluginsFromConfig, g as getCacheInstanceFromConfig, h as handleNodeWarnings, r as run } from './cli-BqlvyFPa.js';
|
2
2
|
export * from '@graphql-hive/gateway-runtime';
|
3
3
|
export { DefaultLogger, LogLevel } from '@graphql-mesh/utils';
|
4
4
|
export { PubSub } from '@graphql-hive/pubsub';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@graphql-hive/gateway",
|
3
|
-
"version": "1.16.3-alpha-
|
3
|
+
"version": "1.16.3-alpha-addb72faf6da0a03455c069877d3592536812e45",
|
4
4
|
"type": "module",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -55,7 +55,7 @@
|
|
55
55
|
"@escape.tech/graphql-armor-max-tokens": "^2.5.0",
|
56
56
|
"@graphql-hive/gateway-runtime": "^1.10.2",
|
57
57
|
"@graphql-hive/importer": "^1.1.0",
|
58
|
-
"@graphql-hive/plugin-aws-sigv4": "1.0.18-alpha-
|
58
|
+
"@graphql-hive/plugin-aws-sigv4": "1.0.18-alpha-addb72faf6da0a03455c069877d3592536812e45",
|
59
59
|
"@graphql-hive/plugin-deduplicate-request": "^1.0.3",
|
60
60
|
"@graphql-hive/pubsub": "^1.0.0",
|
61
61
|
"@graphql-mesh/cache-cfw-kv": "^0.105.5",
|
@@ -87,6 +87,7 @@
|
|
87
87
|
"graphql-ws": "^6.0.6",
|
88
88
|
"graphql-yoga": "^5.15.1",
|
89
89
|
"tslib": "^2.8.1",
|
90
|
+
"uWebSockets.js": "uNetworking/uWebSockets.js#v20.52.0",
|
90
91
|
"ws": "^8.18.3"
|
91
92
|
},
|
92
93
|
"devDependencies": {
|