-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use community provided types for graphql-upload #2844
Use community provided types for graphql-upload #2844
Conversation
Tests seem to be failing because I'm not sure how to proceed other than typing as |
Thanks for submitting the pull request. Someone will need to look into this more to figure out exactly what the issue may be, as we'd want to avoid typing those as |
…essage`. 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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a couple follow-up commits that I believe are the correct adjustments for the typing errors you encountered. I do believe that IncomingMessage
(which extends stream.Readable
) and ServerResponse
(which extends stream.Writeable
) from @types/node
are both types to rally around!
Hi 👋
apollo-server
is currently bundling its own incomplete type definition forgraphql-upload
. This PR moves to the@types/graphql-upload
package instead.