Migrating Hive Gateway from v2 to v3
This document guides you through the process of migrating your Hive Gateway from version 2 to version 3. It outlines the key changes, potential breaking points, and provides step-by-step instructions to ensure a smooth transition.
v3 is built on GraphQL Yoga v6 and the latest major versions of GraphQL Tools. Most of the breaking changes are removals of deprecated APIs. If you use GraphQL Yoga APIs in your plugins, also check the Yoga v5 to v6 migration guide. The most significant changes are:
- Drop Support for Node v20
- Drop Support for GraphQL v15
- GraphQL v17 in Docker Images and Binary
- Request ID
- Request Summary Logs
- Request Body Size Limit
- Execution and Upstream Cancellation Enabled by Default
- Removed Delegation Plan Hooks
- Removed Legacy Logger
- Removed Deprecated Options
- Removed Upstream Helpers
- NestJS 12
- OpenTelemetry JS SDK 3
- GraphQL Tools Stitching
Drop Support for Node v20
Node v20 has reached its end of life (as of 30 Apr 2026), and Hive Gateway v3, with its dependencies, no longer supports it. The minimum Node version required to run Hive Gateway is now Node v22.15.0.
The following packages have been updated to their latest versions, which require Node v22.15.0 or higher:
@graphql-hive/gateway@graphql-hive/gateway-runtime@graphql-hive/gateway-testing@graphql-hive/router-runtime@graphql-hive/importer@graphql-hive/logger@graphql-hive/nestjs@graphql-hive/pubsub@graphql-hive/signal@graphql-hive/plugin-aws-sigv4@graphql-hive/plugin-deduplicate-request@graphql-hive/plugin-mcp@graphql-hive/plugin-opentelemetry@graphql-mesh/fusion-runtime@graphql-mesh/hmac-upstream-signature@graphql-mesh/plugin-jwt-auth@graphql-mesh/plugin-prometheus@graphql-mesh/transport-common@graphql-mesh/transport-http@graphql-mesh/transport-http-callback@graphql-mesh/transport-ws@graphql-tools/batch-delegate@graphql-tools/batch-execute@graphql-tools/delegate@graphql-tools/executor-common@graphql-tools/executor-graphql-ws@graphql-tools/executor-http@graphql-tools/federation@graphql-tools/stitch@graphql-tools/stitching-directives@graphql-tools/wrap
Drop Support for GraphQL v15
Hive Gateway v3 supports only GraphQL v16 and v17. The graphql peer dependency of all Hive Gateway
packages is now ^16.9.0 || ^17.0.0.
If your project depends on graphql directly, upgrade it:
@graphql-tools/stitch no longer reads legacy # comment descriptions from type definitions,
because the commentDescriptions option was removed in GraphQL v16. Use string descriptions instead:
GraphQL v17 in Docker Images and Binary
The Hive Gateway Docker images and the standalone binary come with graphql@17.1.0, so plugins,
additional resolvers, transforms and hooks loaded by the gateway configuration run against GraphQL
v17. If you install the packages yourself, you keep the GraphQL version you already use.
Code that only uses the gateway APIs needs no changes. If your code reads info.variableValues, it
is an object of { sources, coerced } instead of a flat map of variables. Use
getCoercedVariableValues from @graphql-tools/delegate to support both versions:
For other uses of GraphQL internals, see the GraphQL.js v16 to v17 upgrade guide.
Request ID
Hive Gateway uses the request ID handling of
GraphQL Yoga.
The request ID is the ID your server framework already assigned to the request (for example
Fastify’s request.id), and otherwise a newly generated UUID. It is still set on the
x-request-id header of the response and forwarded to subgraph requests.
The incoming x-request-id header is no longer trusted by default, so that clients reaching Hive
Gateway directly cannot choose their own request IDs. In v2, the incoming header always took
precedence. If Hive Gateway is reachable only through a proxy or another gateway that sets the
header itself, trust the header to keep using the request ID of the proxy:
Request Summary Logs
Once a request has been processed, Hive Gateway logs a single info level line summarizing it,
including the operation, the response status, the number of GraphQL errors and the request duration:
Since info is the default log level, you will see one such line for every request. If you do not
want them, set the log level to warn or higher:
Request Body Size Limit
The request body size limit of 25 MB is configurable with the maxRequestBodySize option. Set a
different limit in bytes, or false to disable it:
Enforcing the limit streams request bodies through a byte counter, which makes body parsing
asynchronous even for in-memory bodies. If you use the runtime programmatically and relied on
gateway.fetch() returning a Response synchronously, you have to await the result:
Disabling the limit removes this asynchronous step, but it does not guarantee a synchronous response if plugins, resolvers or subgraph requests are asynchronous. Only disable the limit if an appropriate request body limit is enforced elsewhere.
Execution and Upstream Cancellation Enabled by Default
The executionCancellation and upstreamCancellation options are enabled by default. When the
client disconnects or aborts the request, Hive Gateway stops executing the operation and aborts the
in-flight requests to the subgraphs, instead of doing work whose results would never be delivered.
If you rely on operations and upstream requests running to completion after the client went away (for example, mutations with side effects that must finish), disable them:
Removed Delegation Plan Hooks
The onDelegationPlan and onDelegationStageExecute plugin hooks have been removed, together with
their onDelegationPlanDone and onDelegationStageExecuteDone counterparts. These hooks prevented
the JavaScript Query Planner from caching delegation plans, were rarely used, and were never
supported by the Rust Query Planner.
Remove the hooks from your plugins:
If you used the hooks for monitoring, use onSubgraphExecute,
the OpenTelemetry integration or the
logging instead.
Removed Legacy Logger
The deprecated logger property has been removed in favour of the
Hive Logger available as log.
Transport Context
If you have implemented a custom transport, use log from the transport context:
onFetch Hook
The onFetch hook payload no longer has the logger property. Use the logger from the context:
Yoga Logger
GraphQL Yoga v6 uses the Hive Logger too. If your plugins use the Yoga logger, rename yoga.logger
to yoga.log:
Removed Deprecated Options
Persisted Documents allowArbitraryOperations
Use allowArbitraryDocuments instead:
Rate Limiting Rules Array
Passing an array of rules directly to rateLimiting is no longer supported. Pass the rules to the
config option instead:
Usage Reporting clientInfo Object
The clientInfo usage reporting option no longer accepts an object. Pass a function that receives
the GraphQL context and returns the client info, or null:
Hive Usage Reporting CLI Options
The --hive-registry-token and --hive-usage-target CLI options, and their
HIVE_REGISTRY_TOKEN and HIVE_USAGE_TARGET environment variables, have been removed. Use
--hive-target with --hive-access-token instead, or the usage and tracing specific
--hive-usage-access-token and --hive-trace-access-token options:
The --hive-target CLI option and HIVE_TARGET environment variable take precedence over the
target from the configuration file.
Removed Upstream Helpers
Hive Gateway v3 uses GraphQL Yoga v6 and the latest major versions of GraphQL Tools and
@whatwg-node, which no longer export a number of helpers. If your plugins, transports or other
custom code use them, replace them as follows (see also the
Yoga v5 to v6 migration guide):
| Removed | Replacement |
|---|---|
createGraphQLError | new GraphQLError(...) from graphql |
YogaLogger, createLogger and yoga.logger | Logger and yoga.log |
crypto from @whatwg-node/fetch | The platform global crypto |
mapMaybePromise, isPromise and MaybePromise | handleMaybePromise, isPromise and MaybePromise from @whatwg-node/promise-helpers |
createDeferred and createDeferredPromise | Promise.withResolvers() |
NestJS 12
@graphql-hive/nestjs supports NestJS 12 and drops NestJS 10 and 11. Its peer dependencies are now
@nestjs/common@^12, @nestjs/graphql@^14 and graphql@^16.11.0 || ^17.0.0 (the range
@nestjs/graphql 14 requires). Upgrade NestJS, its HTTP adapter and @nestjs/graphql:
If you use the Fastify adapter, upgrade @nestjs/platform-fastify@^12 instead of
@nestjs/platform-express.
HiveGatewayDriver also works with the new @nestjs/platform-node HTTP adapter, alongside Express
and Fastify. Its NodeRequest and NodeResponse are available as req and res in the GraphQL
context.
@nestjs/graphql 14 removed subscriptions-transport-ws, so the driver no longer configures it.
installSubscriptionHandlers: true already registered graphql-ws, and still does. If you
configured subscriptions-transport-ws explicitly, use graphql-ws instead and move your clients to
the graphql-transport-ws protocol:
OpenTelemetry JS SDK 3
Hive Gateway and @graphql-hive/plugin-opentelemetry use OpenTelemetry JS SDK 3 (the stable
packages at 3.x, the experimental packages like @opentelemetry/sdk-node at 0.301.x) and
@opentelemetry/api 1.10. SDK 2 packages can’t be used together with @opentelemetry/api 1.10, so
custom code using OpenTelemetry packages has to upgrade to SDK 3 too. The
OpenTelemetry JS 3.x migration guide
describes all changes, the ones affecting Hive Gateway are listed below.
The CLI options are unchanged. The Docker images and the binary bundle @opentelemetry/sdk-trace
instead of @opentelemetry/sdk-trace-base, and don’t bundle @opentelemetry/api-logs and
@opentelemetry/propagator-jaeger anymore.
Jaeger Exporter and Propagator
@opentelemetry/exporter-jaeger and @opentelemetry/propagator-jaeger were removed by
OpenTelemetry. Jaeger receives OTLP natively, so export to it with the OTLP exporters, for example
with the --opentelemetry CLI option:
The gateway propagates the W3C Trace Context and Baggage headers by default. Services that send or
expect the uber-trace-id header have to switch to W3C Trace Context for their traces to be
correlated with the gateway’s. OTEL_PROPAGATORS=jaeger is not accepted by NodeSDK anymore, use
OTEL_PROPAGATORS=tracecontext instead.
@opentelemetry/sdk-trace Replaces @opentelemetry/sdk-trace-base
Import the samplers, processors and exporters from @opentelemetry/sdk-trace.
BasicTracerProvider is called TracerProvider, and the span processors take the exporter as an
option:
The BufferConfig type of the traces.batching option is exported from
@graphql-hive/gateway/opentelemetry/setup and @graphql-hive/plugin-opentelemetry/setup.
Removed generalLimits Option
The generalLimits option of openTelemetrySetup has been removed. Set the limits in
traces.spanLimits instead:
Batching and Limits Environment Variables
openTelemetrySetup, hiveTracingSetup and the --opentelemetry CLI option don’t read the
OTEL_BSP_* environment variables and the attribute, span, event and link limit environment
variables (like OTEL_ATTRIBUTE_COUNT_LIMIT or OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) anymore.
Use the traces.batching and traces.spanLimits options instead, or set up the SDK with NodeSDK,
which still reads them.
Logs API
@opentelemetry/api-logs was removed by OpenTelemetry. Import the Logs API from
@opentelemetry/api, or from @graphql-hive/gateway/opentelemetry/api:
Bundled @opentelemetry/sdk-node
The @opentelemetry/sdk-node bundled in the Docker images and the binary exports only NodeSDK,
startNodeSdk and the configuration types. It has no default export and no namespaces (api,
contextBase, core, logs, metrics, node, resources and tracing). Import from the
packages directly, they are bundled too:
The bundled @opentelemetry/context-async-hooks exports only AsyncLocalStorageContextManager,
AsyncHooksContextManager was removed by OpenTelemetry. Imports of files inside OpenTelemetry
packages (like @opentelemetry/core/build/src/...) don’t resolve anymore, import from the package
name instead.
GraphQL Tools Stitching
The following changes affect you only if you use the GraphQL Tools packages directly, for example to build a stitched schema programmatically.
Removed isolateComputedFieldsTransformer
Computed and @requires fields stay on a single subschema instead of on cloned subschemas, and the
defaults of stitchSchemas already defer them. Remove the transformer from your configuration:
Multiple merged type entryPoints are kept on one subschema too, instead of cloning a subschema per
entry point. If you already use entryPoints, no change is required.
Removed stitchingDirectivesTypeDefs
Use allStitchingDirectivesTypeDefs from @graphql-tools/stitching-directives instead:
Removed disposable Option from buildHTTPExecutor
Executors built with buildHTTPExecutor from @graphql-tools/executor-http are always disposable.
Remove the disposable option: