Skip to content

Apollo must wait to respond until request completes #2843

@mike-marcacci

Description

@mike-marcacci

It appears that all the apollo-server- packages suffer from a bug when using graphql-upload. It is essential to wait for an entire HTTP request to be consumed before responding, or you risk causing very hard-to-diagnose bugs, including locking a browser out of subsequent requests to the server.

The middleware that comes with graphql-upload does this, but was being bypassed in graphql-upload-express, which I fixed here. However, I noticed that the upload middleware bundled with Apollo fails to wait, and will experience these bugs even with that fix.

Please see this issue for context and details (specifically this comment) the accompanying demonstration repo put together with heroic effort by @juona.


This middleware in apollo-server-express might be able to borrow from this one in graphql-upload/express.

This middleware in apollo-server-koa might take from this in graphql-upload/koa.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions