From 012bb176d9e49c2c21bb4f89e4573586cf1d2f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 4 Mar 2026 20:11:08 +0100 Subject: [PATCH] fix: convert Web API ReadableStream to Node.js Readable for Fastify graphql-yoga's handleNodeRequestAndResponse returns a Response with a Web API ReadableStream body. Fastify's reply.send() requires a Node.js Readable stream, causing all GraphQL requests to hang indefinitely. Co-Authored-By: Claude Sonnet 4.6 --- packages/backend/src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index c723e8a..1390743 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -4,6 +4,7 @@ import fastifyCors from "@fastify/cors"; import fastifyMultipart from "@fastify/multipart"; import fastifyStatic from "@fastify/static"; import { createYoga } from "graphql-yoga"; +import { Readable } from "stream"; import path from "path"; import { schema } from "./graphql/index"; import { buildContext } from "./graphql/context"; @@ -69,7 +70,7 @@ async function main() { for (const [key, value] of response.headers.entries()) { reply.header(key, value); } - return reply.send(response.body); + return reply.send(Readable.from(response.body)); }, });