graphql-yoga
6.1.0 · 12 Nov 2026MIT3.3M / weekRepositoryHomepagenpmAtom feed
259 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 6.x · latest line
6.1.0
12 Nov 2026#4647
cfd0092
Thanks @egoodwinx! - Add support for the HTTPQUERYmethod as
described in
graphql/graphql-over-http#411.QUERYrequests carry the GraphQL params in the request body, exactly likePOST
(application/json,application/graphql+json,application/graphql, andapplication/x-www-form-urlencodedare all supported), but are treated as safe/read-only likeGET: sending a mutation overQUERYis rejected with a405 Method Not Allowedresponse, the
same way it already is forGET.#4650
045fc2f
Thanks @Shaurya55555! - Match the requestContent-Typemedia
type case-insensitively and allow optional whitespace before its parameters, as required by
RFC 9110. A request sent withApplication/JSONorapplication/json ; charset=utf-8was
rejected with415 Unsupported Media Type.#4658
38e9f1b
Thanks @egoodwinx! - dependencies updates:
Minor Changes
#4647
cfd0092
Thanks @egoodwinx! - Add support for the HTTPQUERYmethod as
described in
graphql/graphql-over-http#411.QUERYrequests carry the GraphQL params in the request body, exactly likePOST
(application/json,application/graphql+json,application/graphql, andapplication/x-www-form-urlencodedare all supported), but are treated as safe/read-only likeGET: sending a mutation overQUERYis rejected with a405 Method Not Allowedresponse, the
same way it already is forGET.
Patch Changes
#4650
045fc2f
Thanks @Shaurya55555! - Match the requestContent-Typemedia
type case-insensitively and allow optional whitespace before its parameters, as required by
RFC 9110. A request sent withApplication/JSONorapplication/json ; charset=utf-8was
rejected with415 Unsupported Media Type.#4658
38e9f1b
Thanks @egoodwinx! - dependencies updates:Updated dependency
@whatwg-node/promise-helpers@^2.0.2↗︎
(from^2.0.0, independencies)Updated dependency
@whatwg-node/server@^0.13.3↗︎
(from^0.13.1, independencies)
#4646
35501fe
Thanks @mattkrick! - A schema factory function now works whengetEnvelopedis called outside of the request pipeline, for example bygraphql-ws. When the
context passed togetEnvelopedhas a Fetch APIRequestasrequest, the factory is called
with that context instead of throwing "No schema found for this request", and it has to return the
schema synchronously there. The WebSocket recipes now pass the upgrade request asrequest.#4656
807c7af
Thanks @mattkrick! - Mutations sent over a WebSocket no longer
fail with "Can only perform a mutation operation from a POST request." when the WebSocket server
passes the upgrade request togetEnvelopedorgetResultForParams. The check now applies only
to requests that Yoga's HTTP handler parsed.
6.0.1
23 Oct 2026#4634
d73f61c
Thanks @ardatan! - dependencies: bump@whatwg-node/serverto^0.13.1so nativeRequestsubclasses (Next.jsNextRequest, including the App RouterproxyNextRequestProxy) are classified as the platform Fetch API. The body-size limiter no
longer throws a cross-realmTypeError/ 500 on those requests; oversized bodies still
return 413.
6.0.0
22 Oct 2026- Breaking
#4575
862447a
Thanks @egoodwinx! - Use@graphql-hive/loggerand add correlated, per-request
logging (closes #4048)Every request now gets its own logger, available as
context.log(andserverContext.login
plugin hooks), tagged with arequestId. Everything logged while handling a request can be
correlated by that id.The request id is taken from the host integration if it already assigned one (e.g. Fastify's
request.id), otherwise from the incomingx-request-idheader, otherwise generated. It is also
sent back in thex-request-idresponse header. Configure it with the newrequestIdoption:createYoga({ requestId: { // don't trust the incoming header, recommended when clients can reach the server directly trustHeader: false, headerName: 'x-correlation-id', generateRequestId: () => myId() } })Pass
requestId: falseto disable it.At the
infolevel, a single "Request processed" line is logged per request with the method,
path, operation name and type, response status, error count and duration. At thedebuglevel,
more details about request processing are logged.Masked errors are now logged with the request's logger, so they can be traced back to the request
that caused them. CustommaskErrorfunctions receive the request's context as an optional fourth
argument.The
@envelop/newrelic,@envelop/auth0,@envelop/resource-limitations,@envelop/statsd,@envelop/graphql-jit,@envelop/response-cacheand@envelop/response-cache-cloudflare-kv
plugins accept a newlogoption for their own messages, instead of always writing to the
console.@envelop/response-cache'sshouldCacheResultnow also receives the GraphQLcontext. - Breaking
The
@graphql-yoga/loggerpackage has been removed.graphql-yogare-exportsLogger,MemoryLogWriterandLogLevelfrom@graphql-hive/loggerinstead. - Breaking
createLoggerand theYogaLoggertype are no longer exported. Usenew Logger(options)
instead.
Major Changes
- Breaking
#4575
862447a
Thanks @egoodwinx! - Use@graphql-hive/loggerand add correlated, per-request
logging (closes #4048)Every request now gets its own logger, available as
context.log(andserverContext.login
plugin hooks), tagged with arequestId. Everything logged while handling a request can be
correlated by that id.The request id is taken from the host integration if it already assigned one (e.g. Fastify's
request.id), otherwise from the incomingx-request-idheader, otherwise generated. It is also
sent back in thex-request-idresponse header. Configure it with the newrequestIdoption:createYoga({ requestId: { // don't trust the incoming header, recommended when clients can reach the server directly trustHeader: false, headerName: 'x-correlation-id', generateRequestId: () => myId() } })Pass
requestId: falseto disable it.At the
infolevel, a single "Request processed" line is logged per request with the method,
path, operation name and type, response status, error count and duration. At thedebuglevel,
more details about request processing are logged.Masked errors are now logged with the request's logger, so they can be traced back to the request
that caused them. CustommaskErrorfunctions receive the request's context as an optional fourth
argument.The
@envelop/newrelic,@envelop/auth0,@envelop/resource-limitations,@envelop/statsd,@envelop/graphql-jit,@envelop/response-cacheand@envelop/response-cache-cloudflare-kv
plugins accept a newlogoption for their own messages, instead of always writing to the
console.@envelop/response-cache'sshouldCacheResultnow also receives the GraphQLcontext.
Breaking Changes
- Breaking
The
@graphql-yoga/loggerpackage has been removed.graphql-yogare-exportsLogger,MemoryLogWriterandLogLevelfrom@graphql-hive/loggerinstead. - Breaking
createLoggerand theYogaLoggertype are no longer exported. Usenew Logger(options)
instead. - Breaking
The
loggingoption now takesboolean | Logger | LogLevel, whereLoggeris the one from@graphql-hive/logger. - Breaking
yoga.loggerhas been renamed toyoga.log. - Breaking
The
loggeroption ofuseGraphiQLanduseHealthCheckhas been removed. They now log through
the request's logger. - Breaking
@graphql-yoga/nestjsnow logs through Nest'sLoggerby default instead of not logging at
all. Passlogging: falseto keep the previous behaviour.logging: trueon Fastify no longer
logs through Fastify's logger, pass it explicitly instead (see below). - Breaking
@envelop/apollo-federation,@envelop/auth0,@envelop/graphql-jit,@envelop/newrelic,@envelop/resource-limitations,@envelop/response-cache,@envelop/response-cache-cloudflare-kvand@envelop/statsdnow have a peer dependency on@graphql-hive/loggerthat you must install. - Breaking
@envelop/apollo-federation'sloggeroption now expects aLoggerfrom@graphql-hive/loggerand defaults tonew Logger()instead ofconsole.
Migration
Create loggers with
Logger:- import { createLogger } from 'graphql-yoga'; + import { Logger } from 'graphql-yoga'; createYoga({ - logging: createLogger('debug'), + logging: new Logger({ level: 'debug' }), });Use
loginstead ofloggeron the Yoga instance:const plugin = { onYogaInit({ yoga }) { - yoga.logger.info('ready'); + yoga.log.info('ready'); }, };Prefer the request-scoped logger inside resolvers and plugin hooks so the logs carry the request
id:const resolvers = { Query: { hello: (_, __, context) => { context.log.debug('resolving hello') return 'world' } } }If you use any of the
@envelop/*plugins listed above, install the logger:npm i @graphql-hive/logger
If you depended on
@graphql-yoga/loggerdirectly, switch to@graphql-hive/logger:- import { Logger } from '@graphql-yoga/logger'; + import { Logger } from '@graphql-hive/logger';To keep logging through Fastify's logger in
@graphql-yoga/nestjs:import { Logger } from 'graphql-yoga' import { PinoLogWriter } from '@graphql-hive/logger/writers/pino' // in your yoga driver options logging: new Logger({ writers: [new PinoLogWriter(app.log)] })- Breaking
#4574
79b0e8b
Thanks @egoodwinx! - ### Breaking ChangesNode: minimum supported version is now Node 22. Node 18 and 20 are no longer supported.
Future releases will only support Node >=22.GraphQL: minimum supported version is now GraphQL 16. GraphQL 14 and 15 are no longer
supported.Request body parsing: Yoga now limits request bodies to 25,000,000 bytes by default.
Enforcing this limit streams the body through a byte counter, making POST body parsing
asynchronous even for an in-memory body. As a result,yoga.fetch()can return a Promise where
it previously returned a synchronous Response, even when all resolvers and plugins are
synchronous.
Migration
- Breaking
If you're on Node 18/20, upgrade to Node 22 or later before upgrading this package.
- Breaking
If you're on graphql 14/15, upgrade to graphql 16 or 17 first.
- Breaking
Await
yoga.fetch()and response body parsing instead of relying on synchronous results. SetmaxRequestBodySize: falseincreateYogato disable the body-size limit and preserve
synchronous parsing for in-memory bodies, but only if you enforce an appropriate request-body
limit elsewhere. - Breaking
#4623
be89d05
Thanks @ardatan! - ### DependenciesBump
@graphql-tools/utilsto^13.1.1,@graphql-tools/schemato^11.0.0, and@graphql-tools/executorto^4.1.2.
Incremental delivery
Yoga maps the GraphQL HTTP
Acceptheader throughINCREMENTAL_DELIVERY_SPECSfrom@graphql-tools/utilsonto executorincrementalSpec.multipart/mixed;incrementalSpec=v0.2
runs the v0.2 payload format and echoes that spec onContent-Type.multipart/mixed;deferSpec=20220824or baremultipart/mixedstays on v0.1. An unsupported
incremental spec yields 406.A later incremental spec is a graphql-tools table row plus an executor publisher. Yoga, Hive
Gateway, and HTTP executors pick it up by bumping@graphql-tools/utils/@graphql-tools/executor.Breaking Changes
- Breaking
createGraphQLErroris removed. Usenew GraphQLError(message, options)fromgraphql. To
attach Yoga's experimental schema coordinate, usewithSchemaCoordinate(error, coordinate)and
read withgetSchemaCoordinatefrom@graphql-tools/utils. - Breaking
mapMaybePromiseis removed (was exported from Yoga /@envelop/core). UsehandleMaybePromisefrom@whatwg-node/promise-helpers. - Breaking
Yoga no longer re-exports helpers that already live upstream:
getSchemaCoordinate->@graphql-tools/utilsmergeSchemas->@graphql-tools/schemaDisposableSymbols->@whatwg-node/servermapAsyncIterator/isPromise/fakePromise/handleMaybePromise/MaybePromise->@whatwg-node/promise-helpers
- Breaking
@envelop/coreutilsno longer re-exportsmapAsyncIteratororisPromise. Import from@whatwg-node/promise-helpers. - Breaking
Use
asGetArgumentValuesVariables/coerceGetVariableValuesResultfrom@graphql-tools/utils
for GraphQL 16/17VariableValuescompatibility.
Migration
import { GraphQLError } from 'graphql' import { withSchemaCoordinate } from 'graphql-yoga' import { mergeSchemas } from '@graphql-tools/schema' import { getSchemaCoordinate } from '@graphql-tools/utils' import { handleMaybePromise, isPromise, type MaybePromise } from '@whatwg-node/promise-helpers' import { DisposableSymbols } from '@whatwg-node/server' throw withSchemaCoordinate(new GraphQLError('not found'), 'Query.user')- Breaking
#4574
79b0e8b
Thanks @egoodwinx! - ### DependenciesBump
@whatwg-node/serverto^0.13.0,@whatwg-node/fetchto^0.12.0, and@whatwg-node/promise-helpersto^2.0.0.Delegate to @whatwg-node/server's useLimitRequestBodySize instead of a hand-rolled byte counter,
and swap in the native TransformStream when the incoming request already has a native
ReadableStream body — piping it through the ponyfill TransformStream throws since they're
different realms. Thread an optionalfetchAPIparam through handle/parseRequest/
getResultForParams so callers can override which fetchAPI (native vs ponyfill) the rest of the
pipeline uses.Unread request bodies are discarded after the response is decided (keep-alive friendly).
Incoming global
Requestinstances automatically use the native Fetch API
(pickRightFetchAPI), so Next.js no longer needsfetchAPI: { Response }.
Breaking Changes
- Breaking
engines.nodeis now>=22.15.0(aligned with whatwg-node 0.12+/0.13). - Breaking
@envelop/coreno longer exportsmapMaybePromise(removed upstream in@whatwg-node/promise-helpersv2). UsehandleMaybePromise(() => value, ...)instead. - Breaking
@whatwg-node/fetchno longer exportscrypto; use the platformcryptoglobal.TextEncoder
still comes fromfetchAPIwhere hashing goes through Yoga’s FetchAPI.
Patch Changes
#4622
5334079
Thanks @ardatan! - Stop swapping inglobalThis.TransformStream
inside the request body-size limiter.@whatwg-node/serveralready passes the request-appropriate
Fetch API (native vs ponyfill) into Yoga as the handler's third argument, soonRequestParse
receives a realm-compatibleTransformStreamwithout an ad-hoc guard.
- 5.x
5.24.5
13 Oct 2026@envelop/graphql-jit@11.2.2
Patch Changes
#4611
b2a35ee
Thanks @ardatan! - dependencies updates:Updated dependency
graphql-jit@^0.8.10↗︎ (from0.8.7,
independencies)
@graphql-yoga/nestjs@4.0.3
@graphql-yoga/nestjs-federation@4.0.3
@graphql-yoga/plugin-apollo-inline-trace@3.24.5
@graphql-yoga/apollo-managed-federation@0.23.5
@graphql-yoga/plugin-apollo-usage-report@0.19.5
@graphql-yoga/plugin-apq@3.24.5
@graphql-yoga/plugin-csrf-prevention@3.24.5
@graphql-yoga/plugin-defer-stream@3.24.5
@graphql-yoga/plugin-disable-introspection@2.25.5
@graphql-yoga/plugin-graphql-sse@3.24.5
@graphql-yoga/plugin-jwt@3.18.5
@graphql-yoga/plugin-persisted-operations@3.24.5
@graphql-yoga/plugin-prometheus@6.19.5
@graphql-yoga/plugin-response-cache@3.26.5
@graphql-yoga/plugin-sofa@3.24.5
@graphql-yoga/render-apollo-sandbox@0.10.5
@graphql-yoga/render-graphiql@5.24.5
5.24.4
8 Oct 2026#4607
d8b8860
Thanks @enisdenjo! - dependencies updates:
5.24.3
8 Oct 2026#4604
c6febdc
Thanks @enisdenjo! - dependencies updates:
5.24.2
5 Oct 2026#4589
c08efde
Thanks @egoodwinx! - Remove the built-insubscriptionsdriver
option and itsgraphql-ws/subscriptions-transport-wswiring (previously implemented via@nestjs/graphql'sGqlSubscriptionService).Fix open handle leak in multipart tests.
@nestjs/graphqlv14 (required for NestJS 12 support) dropped server-side support forsubscriptions-transport-ws, and the driver-levelgraphql-wsintegration held a socket open
after shutdown. Rather than keep a partial, driver-managed subscriptions setup,YogaDriverandYogaFederationDriverno longer accept asubscriptionsoption. Wire up subscriptions yourself
using GraphQL Yoga's own subscription support (e.g. thegraphql-wspackage, or@graphql-yoga/plugin-graphql-sse) the same way you would for a standalonegraphql-yogaserver.
5.24.1
17 Sep 2026#4586
c6a9aa4
Thanks @ardatan! - Fixes the issue thrown in the plugin that limits
the incoming request body's size, when the incomingRequestobject is not the instance of thefetchAPI.Requestwhich is usually the ponyfill implementation from@whatwg-node/node-fetch.This will be fixed in the following breaking release in
@whatwg-node/node-fetchbut in order to
unblock the current users of GraphQL Yoga, a small normalization layer has been added to the
plugin as a temporary workaround.Since the native
Request.bodyis a nativeReadableStream, that doesn't support otherTransformStreamimplementation to itspipeThroughmethod, the limiting implementation didn't
work properly.When the user ran Yoga within Next.js that uses the native
Requestobject, it threw aTypeErrorwhich causes a cryptic500 Internal Server Errorfor Next.js users.This workaround checks whether the incoming
Request's body object is an instance of the nativeReadableStreamand applies the appropriateTransformStreamimplementation to ensure the
request body size limiting works correctly.
5.24.0
16 Sep 2026#4580
3763aca
Thanks @egoodwinx! - Limit the size of incoming HTTP request
bodies by default to protect against denial-of-service attacks from oversized payloads.Requests whose
Content-Lengthexceeds the limit are rejected with an HTTP 413 response before
the body is read, and the limit is also enforced while streaming the body so that requests with a
missing, incorrect, or chunked-transfer-encoded body are covered too.The default limit is 25 MB. Configure it with the new
maxRequestBodySizeoption, or set it tofalseto disable the limit (not recommended unless an upstream reverse proxy already enforces
one):createYoga({ // Allow bodies up to 25 MB maxRequestBodySize: 25_000_000 })Also return an HTTP 400 response for malformed
multipart/form-datarequests (e.g. a missing or
invalidboundary), instead of masking the parse error as a generic 500 Internal Server Error.#4577
7bff35c
Thanks @egoodwinx! - Add homepage and bugs.url to package.json
files
graphql-yoga@5.24.0
Minor Changes
#4580
3763aca
Thanks @egoodwinx! - Limit the size of incoming HTTP request
bodies by default to protect against denial-of-service attacks from oversized payloads.Requests whose
Content-Lengthexceeds the limit are rejected with an HTTP 413 response before
the body is read, and the limit is also enforced while streaming the body so that requests with a
missing, incorrect, or chunked-transfer-encoded body are covered too.The default limit is 25 MB. Configure it with the new
maxRequestBodySizeoption, or set it tofalseto disable the limit (not recommended unless an upstream reverse proxy already enforces
one):createYoga({ // Allow bodies up to 25 MB maxRequestBodySize: 25_000_000 })Also return an HTTP 400 response for malformed
multipart/form-datarequests (e.g. a missing or
invalidboundary), instead of masking the parse error as a generic 500 Internal Server Error.
Patch Changes
#4577
7bff35c
Thanks @egoodwinx! - Add homepage and bugs.url to package.json
files
5.23.0
11 Sep 2026#4573
d3b4164
Thanks @cpruijsen! - Keep SSE keep-alive pings running when the
stream reports backpressure (desiredSize === 0) instead of treating a full queue as a closed
connection.
graphql-yoga@5.23.0
Patch Changes
#4569
c80f43c
Thanks @Urigo! - Serve the favicon of the built-in GraphiQL and
landing pages from a file that stays in the repository (packages/render-graphiql/favicon.ico)
now that the website sources moved.#4573
d3b4164
Thanks @cpruijsen! - Keep SSE keep-alive pings running when the
stream reports backpressure (desiredSize === 0) instead of treating a full queue as a closed
connection.
5.22.0
19 Aug 2026Reading the note…
5.21.3
13 Aug 2026Reading the note…
5.21.2
8 Jun 2026Reading the note…
5.21.1
2 Jun 2026Reading the note…
5.21.0
4 Apr 2026Reading the note…
5.20.0
3 Apr 2026Reading the note…
5.19.0
1 Apr 2026Reading the note…
5.18.1
6 Mar 2026Reading the note…
5.18.0
18 Dec 2025Reading the note…
5.17.1
2 Dec 2025Reading the note…
5.17.0
28 Nov 2025Reading the note…
5.16.2
7 Nov 2025Reading the note…
5.16.1
4 Nov 2025Reading the note…
5.16.0
19 Sep 2025Reading the note…
5.15.2
6 Sep 2025Reading the note…
5.15.1
11 Jul 2025Reading the note…
5.15.0
11 Jul 2025Reading the note…
5.14.0
1 Jul 2025Reading the note…
5.13.5
23 May 2025Reading the note…
5.13.4
15 Apr 2025Reading the note…
5.13.3
9 Apr 2025Reading the note…
5.13.2
17 Mar 2025Reading the note…
5.13.1
6 Mar 2025Reading the note…
5.13.0
5 Mar 2025Reading the note…
5.12.2
3 Mar 2025Reading the note…
5.12.1
24 Feb 2025Reading the note…
5.12.0
19 Feb 2025Reading the note…
5.11.0
6 Feb 2025Reading the note…
5.10.11
27 Jan 2025Reading the note…
5.10.10
16 Jan 2025Reading the note…
5.10.9
6 Jan 2025Reading the note…
5.10.8
24 Dec 2024Reading the note…
5.10.7
24 Dec 2024Reading the note…
5.10.6
14 Dec 2024Reading the note…
5.10.5
13 Dec 2024Reading the note…
5.10.4
29 Nov 2024Reading the note…
5.10.3
20 Nov 2024Reading the note…
5.10.2
14 Nov 2024Reading the note…
5.10.1
11 Nov 2024Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.