From eef0fbbae272424f38923b5471b68f0f8bd73671 Mon Sep 17 00:00:00 2001 From: Carson Full Date: Thu, 1 May 2025 08:49:52 -0500 Subject: [PATCH] Fastify actually supports WhatWG/Web Responses natively as of v4.26.0 This just simplifies our code --- src/core/graphql/driver.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/core/graphql/driver.ts b/src/core/graphql/driver.ts index 7fbf2ac037..0197013b15 100644 --- a/src/core/graphql/driver.ts +++ b/src/core/graphql/driver.ts @@ -78,16 +78,11 @@ export class Driver extends AbstractDriver { ); } - httpHandler: FastifyRoute['handler'] = async (req, reply) => { - const res = await this.yoga.handleNodeRequestAndResponse(req, reply, { + httpHandler: FastifyRoute['handler'] = (req, reply) => + this.yoga.handleNodeRequestAndResponse(req, reply, { req, response: reply, }); - return await reply - .headers(Object.fromEntries(res.headers)) - .status(res.status) - .send(res.body); - }; /** * This code ties fastify, yoga, and graphql-ws together.