Skip to content

Commit dacad53

Browse files
enhance(cli): serve graphiql offline by default (#1172)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b4ba778 commit dacad53

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@graphql-hive/gateway': patch
3+
---
4+
5+
dependencies updates:
6+
7+
- Added dependency [`@graphql-yoga/render-graphiql@^5.13.5` ↗︎](https://www.npmjs.com/package/@graphql-yoga/render-graphiql/v/5.13.5) (to `dependencies`)

.changeset/fresh-squids-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-hive/gateway': minor
3+
---
4+
5+
Serve GraphiQL offline by default instead of fetching it from CDN

packages/gateway/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"@graphql-tools/graphql-file-loader": "^8.0.14",
8282
"@graphql-tools/load": "^8.0.14",
8383
"@graphql-tools/utils": "^10.8.1",
84+
"@graphql-yoga/render-graphiql": "^5.13.5",
8485
"commander": "^13.1.0",
8586
"dotenv": "^16.4.7",
8687
"graphql-ws": "^6.0.4",

packages/gateway/src/cli.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import type { JWTAuthPluginOptions } from '@graphql-mesh/plugin-jwt-auth';
2222
import type { OpenTelemetryMeshPluginOptions } from '@graphql-mesh/plugin-opentelemetry';
2323
import type { PrometheusPluginOptions } from '@graphql-mesh/plugin-prometheus';
2424
import type { KeyValueCache, Logger, YamlConfig } from '@graphql-mesh/types';
25+
import { renderGraphiQL } from '@graphql-yoga/render-graphiql';
2526
import parseDuration from 'parse-duration';
2627
import { getDefaultLogger } from '../../runtime/src/getDefaultLogger';
2728
import { addCommands } from './commands/index';
@@ -262,6 +263,7 @@ export const defaultOptions = {
262263
: '0.0.0.0',
263264
port: 4000,
264265
pollingInterval: 10_000,
266+
renderGraphiQL,
265267
};
266268

267269
/** Root cli for the gateway. */

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4041,6 +4041,7 @@ __metadata:
40414041
"@graphql-tools/graphql-file-loader": "npm:^8.0.14"
40424042
"@graphql-tools/load": "npm:^8.0.14"
40434043
"@graphql-tools/utils": "npm:^10.8.1"
4044+
"@graphql-yoga/render-graphiql": "npm:^5.13.5"
40444045
"@rollup/plugin-commonjs": "npm:^28.0.0"
40454046
"@rollup/plugin-json": "npm:^6.1.0"
40464047
"@rollup/plugin-node-resolve": "npm:^16.0.0"
@@ -5351,6 +5352,15 @@ __metadata:
53515352
languageName: node
53525353
linkType: hard
53535354

5355+
"@graphql-yoga/render-graphiql@npm:^5.13.5":
5356+
version: 5.13.5
5357+
resolution: "@graphql-yoga/render-graphiql@npm:5.13.5"
5358+
peerDependencies:
5359+
graphql-yoga: ^5.13.5
5360+
checksum: 10c0/c9c008291e2c27a33cae8cd70bd64b1cd07310f5fb70ce98be3307317a100dcc57f5bbabd2e953ce5196f4ca765bf1cb69b87d078746a838c678037e312e8013
5361+
languageName: node
5362+
linkType: hard
5363+
53545364
"@graphql-yoga/subscription@npm:^5.0.5":
53555365
version: 5.0.5
53565366
resolution: "@graphql-yoga/subscription@npm:5.0.5"

0 commit comments

Comments
 (0)