Skip to content

Commit 8e49b28

Browse files
committed
hapi: Switch uploads to receive "raw" request and response.
The immediately pressing reason is to align on the same types that the `processRequest` method from `graphql-upload` (aliased here as `processFileUploads`) uses. Using the raw types should be fine as `graphql-upload` only binds to the `response` to receive "close"-like `EventEmitter` events, and uses the `request` side for the piping of data, which should be identical to Hapi's abstraction. Helps-to-land: #2844
1 parent 7638f64 commit 8e49b28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ function handleFileUploads(uploadsConfig: FileUploadOptions) {
2323
) {
2424
Object.defineProperty(request, 'payload', {
2525
value: await processFileUploads(
26-
request as any,
27-
request.response as any,
26+
request.raw.req,
27+
request.raw.res,
2828
uploadsConfig,
2929
),
3030
writable: false,

0 commit comments

Comments
 (0)