Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configs/cargo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 21 additions & 7 deletions deployment/config/public-graphql-api-gateway/gateway.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// @ts-expect-error not a dependency
import { defineConfig } from '@graphql-hive/gateway';
// @ts-expect-error not a dependency
import { defineConfig, Logger } from '@graphql-hive/gateway';
import { hiveTracingSetup } from '@graphql-hive/plugin-opentelemetry/setup';
import type { Context } from '@opentelemetry/api';
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
Expand Down Expand Up @@ -69,6 +67,11 @@ if (
// Noop is only there to not raise an exception in case we do not hive console tracing.
target: process.env['HIVE_HIVE_TARGET'] ?? 'noop',
contextManager: new AsyncLocalStorageContextManager(),
resource: {
serviceName: 'public-graphql-api-gateway',
serviceVersion: '0.0.0', // TODO: use actual version
},
// @ts-expect-error types are incorrect?
processor: new MultiSpanProcessor([
...(process.env['HIVE_HIVE_TRACE_ACCESS_TOKEN'] &&
process.env['HIVE_HIVE_TRACE_ENDPOINT'] &&
Expand Down Expand Up @@ -103,16 +106,19 @@ const defaultQuery = `#
#
`;

const log = new Logger();

export const gatewayConfig = defineConfig({
logging: log,
transportEntries: {
graphql: {
location: process.env['GRAPHQL_SERVICE_ENDPOINT'],
},
},
supergraph: {
type: 'hive',
endpoint: process.env['SUPERGRAPH_ENDPOINT'],
key: process.env['HIVE_CDN_ACCESS_TOKEN'],
endpoint: process.env['SUPERGRAPH_ENDPOINT'] || '',
key: process.env['HIVE_CDN_ACCESS_TOKEN'] || '',
},
graphiql: {
title: 'Hive Console - GraphQL API',
Expand All @@ -127,12 +133,16 @@ export const gatewayConfig = defineConfig({
},
},
disableWebsockets: true,
prometheus: true,
prometheus: {
log,
metrics: {
// use defaults
},
},
openTelemetry:
process.env['OPENTELEMETRY_COLLECTOR_ENDPOINT'] || process.env['HIVE_HIVE_TRACE_ACCESS_TOKEN']
? {
traces: true,
serviceName: 'public-graphql-api-gateway',
}
: undefined,
demandControl: {
Expand All @@ -141,4 +151,8 @@ export const gatewayConfig = defineConfig({
},
maxTokens: 1_000,
maxDepth: 20,
cors: {
origin: '*', // allow all origins
credentials: false, // do not allow credentials in cross-origin requests
},
});
1 change: 1 addition & 0 deletions deployment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"prettier": "3.4.2"
},
"devDependencies": {
"@graphql-hive/gateway": "^2.1.18",
"@types/js-yaml": "4.0.9",
"@types/mime-types": "2.1.4",
"@types/node": "22.10.5",
Expand Down
2 changes: 1 addition & 1 deletion deployment/services/public-graphql-api-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { type OTELCollector } from './otel-collector';
* Hive Gateway Docker Image Version
* Bump this to update the used gateway version.
*/
const dockerImage = 'ghcr.io/graphql-hive/gateway:2.1.10';
const dockerImage = 'ghcr.io/graphql-hive/gateway:2.1.18';

const gatewayConfigDirectory = path.resolve(
__dirname,
Expand Down
5 changes: 5 additions & 0 deletions packages/services/emails/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@
"sendmail": "1.6.1",
"tslib": "2.8.1",
"zod": "3.25.76"
},
"buildOptions": {
"external": [
"ansi-color"
]
}
}
5 changes: 4 additions & 1 deletion packages/services/policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"tags": [
"backend"
],
"banner": "../../../scripts/banner.js"
"banner": "../../../scripts/banner.js",
"external": [
"ansi-color"
]
}
}
5 changes: 5 additions & 0 deletions packages/services/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
"pino-pretty": "11.3.0",
"reflect-metadata": "0.2.2",
"zod": "3.25.76"
},
"buildOptions": {
"external": [
"ansi-color"
]
}
}
3 changes: 2 additions & 1 deletion packages/services/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
},
"buildOptions": {
"external": [
"pg-native"
"pg-native",
"ansi-color"
]
}
}
3 changes: 2 additions & 1 deletion packages/services/tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
},
"buildOptions": {
"external": [
"pg-native"
"pg-native",
"ansi-color"
]
}
}
5 changes: 5 additions & 0 deletions packages/services/usage-ingestor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@
"tiny-lru": "8.0.2",
"tslib": "2.8.1",
"zod": "3.25.76"
},
"buildOptions": {
"external": [
"ansi-color"
]
}
}
5 changes: 5 additions & 0 deletions packages/services/webhooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"pino-pretty": "11.3.0",
"tslib": "2.8.1",
"zod": "3.25.76"
},
"buildOptions": {
"external": [
"ansi-color"
]
}
}
Loading
Loading