Skip to content

Commit 7638f64

Browse files
committed
fastify: Switch req type to ServerResponse rather than OutgoingMessage.
While currently we use `OutgoingMessage`, it actually seems to be suggested that `ServerResonse` — which is an extension of `OutgoingMessage`: https://github.com/fastify/fastify/blob/master/docs/TypeScript.md#example Helps-to-land: #2844
1 parent 9f01d9c commit 7638f64

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/apollo-server-fastify/src/ApolloServer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
processFileUploads,
99
} from 'apollo-server-core';
1010
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
11-
import { IncomingMessage, OutgoingMessage, Server } from 'http';
11+
import { IncomingMessage, ServerResponse, Server } from 'http';
1212
import { graphqlFastify } from './fastifyApollo';
1313
import { GraphQLOperation } from 'graphql-upload';
1414

@@ -36,7 +36,7 @@ const fileUploadMiddleware = (
3636
server: ApolloServerBase,
3737
) => (
3838
req: FastifyRequest<IncomingMessage>,
39-
reply: FastifyReply<OutgoingMessage>,
39+
reply: FastifyReply<ServerResponse>,
4040
done: (err: Error | null, body?: any) => void,
4141
) => {
4242
if (
@@ -80,7 +80,7 @@ export class ApolloServer extends ApolloServerBase {
8080
const promiseWillStart = this.willStart();
8181

8282
return async (
83-
app: FastifyInstance<Server, IncomingMessage, OutgoingMessage>,
83+
app: FastifyInstance<Server, IncomingMessage, ServerResponse>,
8484
) => {
8585
await promiseWillStart;
8686

@@ -121,7 +121,7 @@ export class ApolloServer extends ApolloServerBase {
121121
const beforeHandlers = [
122122
(
123123
req: FastifyRequest<IncomingMessage>,
124-
reply: FastifyReply<OutgoingMessage>,
124+
reply: FastifyReply<ServerResponse>,
125125
done: () => void,
126126
) => {
127127
// Note: if you enable playground in production and expect to be able to see your

0 commit comments

Comments
 (0)