Skip to content

Commit eb700a1

Browse files
authored
Bump Hive Gateway and no cross-origin credentials (#7305)
1 parent 5fec03c commit eb700a1

File tree

6 files changed

+4559
-151
lines changed

6 files changed

+4559
-151
lines changed

configs/cargo/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deployment/config/public-graphql-api-gateway/gateway.config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// @ts-expect-error not a dependency
21
import { defineConfig } from '@graphql-hive/gateway';
3-
// @ts-expect-error not a dependency
42
import { hiveTracingSetup } from '@graphql-hive/plugin-opentelemetry/setup';
53
import type { Context } from '@opentelemetry/api';
64
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
@@ -69,6 +67,8 @@ if (
6967
// Noop is only there to not raise an exception in case we do not hive console tracing.
7068
target: process.env['HIVE_HIVE_TARGET'] ?? 'noop',
7169
contextManager: new AsyncLocalStorageContextManager(),
70+
// @ts-expect-error console uses otel v1 and hive gateway uses v2
71+
// TODO: upgrade console to otel v2
7272
processor: new MultiSpanProcessor([
7373
...(process.env['HIVE_HIVE_TRACE_ACCESS_TOKEN'] &&
7474
process.env['HIVE_HIVE_TRACE_ENDPOINT'] &&
@@ -111,8 +111,8 @@ export const gatewayConfig = defineConfig({
111111
},
112112
supergraph: {
113113
type: 'hive',
114-
endpoint: process.env['SUPERGRAPH_ENDPOINT'],
115-
key: process.env['HIVE_CDN_ACCESS_TOKEN'],
114+
endpoint: process.env['SUPERGRAPH_ENDPOINT'] || '',
115+
key: process.env['HIVE_CDN_ACCESS_TOKEN'] || '',
116116
},
117117
graphiql: {
118118
title: 'Hive Console - GraphQL API',
@@ -127,12 +127,13 @@ export const gatewayConfig = defineConfig({
127127
},
128128
},
129129
disableWebsockets: true,
130-
prometheus: true,
130+
prometheus: {
131+
metrics: true,
132+
},
131133
openTelemetry:
132134
process.env['OPENTELEMETRY_COLLECTOR_ENDPOINT'] || process.env['HIVE_HIVE_TRACE_ACCESS_TOKEN']
133135
? {
134136
traces: true,
135-
serviceName: 'public-graphql-api-gateway',
136137
}
137138
: undefined,
138139
demandControl: {
@@ -141,4 +142,8 @@ export const gatewayConfig = defineConfig({
141142
},
142143
maxTokens: 1_000,
143144
maxDepth: 20,
145+
cors: {
146+
origin: '*', // allow all origins
147+
credentials: false, // do not allow credentials in cross-origin requests
148+
},
144149
});

deployment/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"prettier": "3.4.2"
2323
},
2424
"devDependencies": {
25+
"@graphql-hive/gateway": "^2.1.19",
2526
"@types/js-yaml": "4.0.9",
2627
"@types/mime-types": "2.1.4",
2728
"@types/node": "22.10.5",

deployment/services/public-graphql-api-gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { type OTELCollector } from './otel-collector';
1515
* Hive Gateway Docker Image Version
1616
* Bump this to update the used gateway version.
1717
*/
18-
const dockerImage = 'ghcr.io/graphql-hive/gateway:2.1.10';
18+
const dockerImage = 'ghcr.io/graphql-hive/gateway:2.1.19';
1919

2020
const gatewayConfigDirectory = path.resolve(
2121
__dirname,

0 commit comments

Comments
 (0)